The implementations of ActivateKeyboardLayout in Windows NT and Windows 95 are substantially different. To accommodate these differences, this reference page first presents the Windows NT implementation in its entirety, followed by the Windows 95 version.
Windows NT:
The ActivateKeyboardLayout function activates a different keyboard layout and sets the active keyboard layout for the entire system rather than the calling thread.
HKL ActivateKeyboardLayout(
HKL hkl, |
// handle to keyboard layout |
UINT Flags |
// keyboard layout flags |
); |
Value |
Meaning |
HKL_NEXT |
Selects the next layout in the circular list of loaded layouts maintained by the system. |
HKL_PREV |
Selects the previous layout in the circular list of loaded layouts maintained by the system. |
Value |
Meaning |
KLF_REORDER |
If this bit is set, the system’s circular list of loaded keyboard layouts is reordered. If this bit is not set, the list is rotated without a change of order. For example, if a user had an English layout active, as well as having French, German and Spanish layouts loaded (in that order), then activating the German layout with the KLF_REORDER bit set would produce the following order: German, English, French, Spanish. Activating the German layout without the KLF_REORDER bit set would produce the following order: German, Spanish, English, French. If less than three keyboard layouts are loaded, the value of this flag is irrelevant. |
KLF_UNLOADPREVIOUS |
The previously active layout is unloaded. |
If the function succeeds, the return value is the previous keyboard layout handle. Otherwise, it is zero. To get extended error information, use the GetLastError function.
Several keyboard layouts can be loaded at any one time, but only one is active at a time. Loading multiple keyboard layouts makes it possible to rapidly switch between layouts.
LoadKeyboardLayout, GetKeyboardLayoutName, UnloadKeyboardLayout
Windows 95
The ActivateKeyboardLayout function sets the input language for the current thread. This function accepts a keyboard layout handle that identifies a locale as well as the physical layout of the keyboard.
HKL ActivateKeyboardLayout(
HKL hkl, |
// handle to keyboard layout |
UINT Flags |
// keyboard layout flags |
); |
Value |
Meaning |
HKL_NEXT |
Selects the next layout in the keyboard layouts list maintained by the system. |
HKL_PREV |
Selects the previous layout in the keyboards layout list maintained by the system. |
Value |
Meaning |
KLF_REORDER |
Reorders the keyboard layouts list by moving the given keyboard layout handle to the head of the list. If this value is not given, the list is rotated without a change of order. For example, if a user had an English layout active, as well as having French, German and Spanish layouts loaded (in that order), then activating the German layout with the KLF_REORDER bit set would produce the following order: German, English, French, Spanish. Activating the German layout without the KLF_REORDER value set would produce the following order: German, Spanish, English, French. |
If the function succeeds, the return value is the previous keyboard layout handle. Otherwise, it is zero. To get extended error information, use the GetLastError function.
Several keyboard layouts can be loaded at any one time, but only one is active at a time. Loading multiple keyboard layouts makes it possible to rapidly switch between layouts.
An application can create a valid keyboard layout handle by setting the high word to zero and the low word to a locale identifier. Using such keyboard layout handles changes the input language without affecting the physical layout.
When multiple input method editors (IMEs) are allowed for each locale, passing in a keyboard layout handle in which the high word (the device handle) is zero activates the first IME in the list “belonging” to the locale.
LoadKeyboardLayout, GetKeyboardLayoutName, UnloadKeyboardLayout
file: /Techref/os/win/api/win32/func/src/f00_17.htm, 8KB, , updated: 2000/4/7 11:19, local time: 2024/12/25 11:27,
18.117.105.184:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://ecomorder.com/techref/os/win/api/win32/func/src/f00_17.htm"> ActivateKeyboardLayout</A> |
Did you find what you needed? |
Welcome to ecomorder.com! |
Welcome to ecomorder.com! |
.