Flavio
Flavio

Reputation: 461

Get keyboard language on Windows

I know that I can use the GetKeyboardLayout function in order to retrieve the current keyboard language. However I am still confused on how to use the return value of this function.

Can someone write down a practical example on how to use it, for example, to check if keyboard is set to English language? (I'm using C++)

Thank you in advance.

Upvotes: 0

Views: 717

Answers (1)

Flavio
Flavio

Reputation: 461

Found solution!

HKL KeyboardLayout = GetKeyboardLayout(0);
if (PRIMARYLANGID(KeyboardLayout) == LANG_ENGLISH)

Upvotes: 1

Related Questions