The GetKeyboardLayoutName function retrieves the name of the active input locale identifier (formerly called the keyboard layout).
Syntax
BOOL GetKeyboardLayoutName(
LPTSTR pwszKLID
);
Parameters
- pwszKLID
-
[out] Pointer to the buffer (of at least KL_NAMELENGTH characters in length) that receives the name of the input locale identifier, including the terminating null character. This will be a copy of the string provided to the LoadKeyboardLayout function, unless layout substitution took place.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Remarks
The input locale identifier 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.
Windows NT/2000/XP: GetKeyboardLayoutName receives the name of the active input locale identifier for the system.
Windows 95/98/Me: GetKeyboardLayoutName receives the name of the active input locale identifier for the calling thread.
Windows 95/98/Me: GetKeyboardLayoutNameW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.
Function Information
| Minimum DLL Version | user32.dll |
|---|
| Header | Declared in Winuser.h, include Windows.h |
|---|
| Import library | User32.lib |
|---|
| Minimum operating systems |
Windows 95, Windows NT 3.1 |
|---|
| Unicode | Implemented as
ANSI and Unicode versions. |
|---|
See Also