Detect current keyboard language/layout name in multi-language computer

前端 未结 6 1457
感动是毒
感动是毒 2020-12-09 00:06

I am trying to develop an application in C# which required to detect user selected language (keyboard layout). However two languages are installed on my computer, the code a

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-09 00:31

    You can get this by calling the GetKeyboardLayout Windows API function.

    Keyboard layout is by thread.

    I am not aware if there is a built-in managed version of this function.

提交回复
热议问题