Group: Keyboard Input - Library: user32
The GetKeyboardLayout function retrieves the active input locale identifier (formerly called the keyboard layout) for the specified thread. If the idThread parameter is zero, the input locale identifier for the active thread is returned.
Switching between keyboard layouts
HKL GetKeyboardLayout(
DWORD idThread // thread identifier
);
DECLARE INTEGER GetKeyboardLayout IN user32;
INTEGER idThread
idThread [in] Identifies the thread to query or is zero for the current thread.
The return value is the input locale identifier for the thread. The low word contains a language identifier for the input language and the high word contains a device handle for the physical layout of the keyboard.