Skip to content

Instantly share code, notes, and snippets.

@amitu
Created March 21, 2012 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amitu/2148197 to your computer and use it in GitHub Desktop.
Save amitu/2148197 to your computer and use it in GitHub Desktop.
autohotkey script to force language to any given language for all apps
en := DllCall("LoadKeyboardLayout", "Str", "00000409", "Int", 1)
Loop
{
#IfWinActive
{
w := DllCall("GetForegroundWindow")
pid := DllCall("GetWindowThreadProcessId", "UInt", w, "Ptr", 0)
l := DllCall("GetKeyboardLayout", "UInt", pid)
if (l <> en)
{
PostMessage 0x50, 0, %en%,, A
Sleep 1000
}
Sleep 1000
}
}
@amitu
Copy link
Author

amitu commented Mar 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment