This 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.
HKL GetKeyboardLayout( DWORD idThread = 0 )
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 to the physical layout of the keyboard.
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.