can't get current keyboard layout
I have tried GetKeyboardLayoutName() and GetKeyboardLayout() for getting the current keyboard layout, but they both give me the default layout and changing the layout doesn't affect the output! while(1) { Sleep(5); for(int i = 8; i < 191; i++) { if(GetAsyncKeyState(i)&1 ==1) { TCHAR szKeyboard[KL_NAMELENGTH]; GetKeyboardLayoutName(szKeyboard); if(GetAsyncKeyState(i)&1 ==1) { TCHAR szKeyboard[KL_NAMELENGTH]; GetKeyboardLayoutName(szKeyboard); cout << szKeyboard << endl ; } } } } It always gives me "00000409" when the default layout is set to English, while I expect it to be "00000429" when I