#include <GUIConstantsEx.au3>
#include <Misc.au3>
_WinAPI_LoadKeyboardLayout(0x0409)
HotKeySet("`", "_Quit")
$hGUI = GUICreate("Fix for hotkey assign problem", 300, 200)
GUISetState(@SW_SHOW, $hGUI)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func _Quit()
If _IsPressed("20") Then
Exit
EndIf
EndFunc
Func _WinAPI_LoadKeyboardLayout($sLayoutID, $hWnd = 0)
Local Const $WM_INPUTLANGCHANGEREQUEST = 0x50
Local $aRet = DllCall("user32.dll", "long", "LoadKeyboardLayoutW", "wstr", Hex($sLayoutID, 8), "int", 0)
If Not @error And $aRet[0] Then
If $hWnd = 0 Then
$hWnd = WinGetHandle(AutoItWinGetTitle())
EndIf
DllCall("user32.dll", "ptr", "SendMessage", "hwnd", $hWnd, "int", $WM_INPUTLANGCHANGEREQUEST, "int", 1, "int", $aRet[0])
Return 1
EndIf
Return SetError(1)
EndFunc