网站首页  词典首页

请输入您要查询的函数:

 

术语 activatekeyboardlayout
释义 ActivateKeyboardLayout
语法:
HKL ActivateKeyboardLayout( HKL hkl,
UINT Flags
);
ActivateKeyboardLayout函数
该ActivateKeyboardLayout函数设置输入法区域设置标识符(前称键盘布局句柄调用线程或当前进程)。输入法区域设置标识符指定一个区域,以及键盘的物理布局。
参数
hkl
[in]输入区域设置标识符被激活。
在Windows 95/98/Me:此参数可使用LoadKeyboardLayout或GetKeyboardLayoutList,或者可以在下面的表中的值之一。
Windows NT/2000/XP的:输入区域设置标识符,必须是被以前的调用LoadKeyboardLayout函数加载。此参数必须是一个手柄,键盘布局或下列值之一。
HKL_NEXT
选择在装载的区域由系统维护通知,名单上的下识别区域设置标识符。
HKL_PREV
选择在装载的区域由系统维护标识符循环列表上的区域设置标识符。

[in]指定如何输入法区域设置标识符被激活。此参数可以是下列值之一。
KLF_REORDER
如果此位被设置,系统的循环加载的区域设置标识符列表是通过将重新排序区域设置标识符列表的头部。如果此位未设置,列表旋转没有秩序的变化。
例如,如果用户有一个英文的区域设置标识符活跃,以及有法语,德语,西班牙语区域加载(按此顺序排列)标识符,然后启动与KLF_REORDER位设置德语区域设置标识符将产生以下顺序:德国,英文,法文,西班牙文。激活无KLF_REORDER位设置德语区域设置标识符将产生以下顺序:德语,西班牙语,英语,法语。
如果不到三年的区域设置标识符被加载,这个标志的值是无关紧要的。
KLF_RESET
视窗2000/XP的:如果设置,但KLF_SHIFTLOCK是没有设置,大写锁定状态转向按Caps Lock键再次起飞。如果设置和KLF_SHIFTLOCK也设置的大写锁定状态是关闭的或者按SHIFT键。
这两种方法是相互排斥的,设立坚持为用户的注册表中的配置文件的一部分。
KLF_SETFORPROCESS
视窗2000/XP的:激活整个过程中指定的区域设置标识符和发送WM_INPUTLANGCHANGE消息发送到当前线程的焦点或活动窗口。
KLF_SHIFTLOCK
视窗2000/XP的:这是KLF_RESET使用。有关说明请KLF_RESET。
KLF_UNLOADPREVIOUS
这个标志是不受支持的。使用UnloadKeyboardLayout函数来代替。
返回值
Windows NT 3.51和更早版本:返回值bool类型的。如果函数成功,这是非零。如果函数失败,它是零。
Windows 95/98中,Windows NT 4.0和更高版本:返回值类型的 hkl 的。如果函数成功,返回值是以前的输入法区域设置标识符。否则,它是零。
为了获得更多错误信息,使用GetLastError函数。
备注
此功能只影响当前进程或线程布局。
此功能不仅限于键盘布局。该 hkl 参数实际上是一个输入法区域设置标识符。这是一个比一个键盘布局更广泛的概念,因为它也可以包括演讲到文本转换器,输入法编辑器(IME),或任何其他形式的投入。几个输入法区域设置标识符可以被装载在任何一个时间,但只有一个是一次积极的。装入多个输入法区域设置标识符使得有可能在它们之间快速切换。
Windows 95/98/Me的:创建一个应用程序可以通过设置高位字为零,低位字的区域设置标识符一个有效的输入法区域设置标识符。使用这种输入区域设置标识符的变化不影响物理布局的输入语言。
当多个输入法允许每个区域设置,通过输入区域设置标识符,其中高位字(设备句柄)为零激活在属于输入法区域设置列表中的第一。
视窗2000/XP的:在KLF_RESET和KLF_SHIFTLOCK旗帜改变,其中大写锁定状态是关闭的方法。默认情况下,大写锁定状态是关闭的击中再次Caps Lock键。如果只KLF_RESET被设置,默认状态是重新建立。如果KLF_RESET和KLF_SHIFTLOCK的设置,大写锁定状态是关闭的或者按Caps Lock键。此功能是用来符合以及个人喜好,本地键盘的行为标准。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
参见
键盘输入,LoadKeyboardLayout,GetKeyboardLayoutName,UnloadKeyboardLayout
==英文原文==ActivateKeyboardLayout Function
The ActivateKeyboardLayout function sets the input locale identifier (formerly called the keyboard layout handle) for the calling thread or the current process. The input locale identifier specifies a locale as well as the physical layout of the keyboard.
Syntax
HKL ActivateKeyboardLayout( HKL hkl,
UINT Flags
);
Parameters
hkl
[in] Input locale identifier to be activated.
Windows 95/98/Me: This parameter can be obtained using LoadKeyboardLayout or GetKeyboardLayoutList , or it can be one of the values in the table that follows.
Windows NT/2000/XP: The input locale identifier must have been loaded by a previous call to the LoadKeyboardLayout function. This parameter must be either the handle to a keyboard layout or one of the following values.
HKL_NEXT
Selects the next locale identifier in the circular list of loaded locale identifiers maintained by the system.
HKL_PREV
Selects the previous locale identifier in the circular list of loaded locale identifiers maintained by the system.
Flags
[in] Specifies how the input locale identifier is to be activated. This parameter can be one of the following values.
KLF_REORDER
If this bit is set, the system's circular list of loaded locale identifiers is reordered by moving the locale identifier to the head of the list. If this bit is not set, the list is rotated without a change of order.
For example, if a user had an English locale identifier active, as well as having French, German, and Spanish locale identifiers loaded (in that order), then activating the German locale identifier with the KLF_REORDER bit set would produce the following order: German, English, French, Spanish. Activating the German locale identifier without the KLF_REORDER bit set would produce the following order: German, Spanish, English, French.
If less than three locale identifiers are loaded, the value of this flag is irrelevant.
KLF_RESET
Windows 2000/XP: If set but KLF_SHIFTLOCK is not set, the Caps Lock state is turned off by pressing the Caps Lock key again. If set and KLF_SHIFTLOCK is also set, the Caps Lock state is turned off by pressing either SHIFT key.
These two methods are mutually exclusive, and the setting persists as part of the User's profile in the registry.
KLF_SETFORPROCESS
Windows 2000/XP: Activates the specified locale identifier for the entire process and sends the WM_INPUTLANGCHANGE message to the current thread's Focus or Active window.
KLF_SHIFTLOCK
Windows 2000/XP: This is used with KLF_RESET. See KLF_RESET for an explanation.
KLF_UNLOADPREVIOUS
This flag is unsupported. Use the UnloadKeyboardLayout function instead.
Return Value
Windows NT 3.51 and earlier: The return value is of type BOOL. If the function succeeds, it is nonzero. If the function fails, it is zero.
Windows 95/98, Windows NT 4.0 and later: The return value is of type HKL. If the function succeeds, the return value is the previous input locale identifier. Otherwise, it is zero.
To get extended error information, use the GetLastError function.
Remarks
This function only affects the layout for the current process or thread.
This function is not restricted to keyboard layouts. The hkl parameter is actually an input locale identifier. This is a broader concept than a keyboard layout, since it can also encompass a speech-to-text converter, an Input Method Editor (IME), or any other form of input. Several input locale identifiers can be loaded at any one time, but only one is active at a time. Loading multiple input locale identifiers makes it possible to rapidly switch between them.
Windows 95/98/Me: An application can create a valid input locale identifier by setting the high word to zero and the low word to a locale identifier. Using such an input locale identifier changes the input language without affecting the physical layout.
When multiple IMEs are allowed for each locale, passing an input locale identifier in which the high word (the device handle) is zero activates the first IME in the list belonging to the locale.
Windows 2000/XP: The KLF_RESET and KLF_SHIFTLOCK flags alter the method by which the Caps Lock state is turned off. By default, the Caps Lock state is turned off by hitting the Caps Lock key again. If only KLF_RESET is set, the default state is reestablished. If KLF_RESET and KLF_SHIFTLOCK are set, the Caps Lock state is turned off by pressing either Caps Lock key. This feature is used to conform to local keyboard behavior standards as well as for personal preferences.
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
See Also
Keyboard Input , LoadKeyboardLayout , GetKeyboardLayoutName , UnloadKeyboardLayout
==原始网址==http://msdn.microsoft.com/en-us/library/ms646289(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:28:17