GetKeyboardLayout() and LoadKeyboardLayout() difficulty

Ioann
61
Reputation points
Hello guys,
What i want to do is GetKeyboardlayout(0) that returns a HKL object and i want to use this HKL as input for the first parameter of LoadKeyboardLayout() which is LPCWSTR. Is this possible ?
Thanks in advance
{count} votes
Is it possible to convert is somehow to be usable within LoadKeyboardLayout ?
Maybe you can use an approximation:
Do you want to duplicate the HKL for some different process?
The low word of the HKL will provide language but that approximation does not provide for the physical layout. Using the example that I mentioned earlier passing the approximation based on language alone could reset the physical layout of the keyboard, probably an unintended side effect.
Also, there are keyboard identifiers documented at windows-language-pack-default-values for which the high order word is not 0x0000.
Why do you want to load a keyboard layout that is already loaded, that you already have a handle for? This sounds like an XY problem. What are you really trying to achieve?
Sign in to comment