Color1 := "0x0C0BC0", Color2 := "0x0FFC00", x := A_ScreenWidth//2, y := A_ScreenHeight//2, w := 18, h := 18 loop { If (InputLayout() = "English") && GetKeyState("Capslock","T") { Gui, +AlwaysOnTop -Caption +ToolWindow +LastFound Gui, Color, % Color2 Gui, Show, x%x% y%y% w%w% h%h% NA } else Gui Destroy sleep, 50 } InputLayout() { ThreadID := DllCall("GetWindowThreadProcessId", "Int", WinExist("A"), "Int", 0) HKL := DllCall("GetKeyboardLayout", "uint", ThreadID, "UShort") VarSetCapacity(sKbd, 260, 0) DllCall("GetLocaleInfo", "uint", HKL , "uint", 0x1001 , "str", sKbd , "uint", 260) Return sKbd } |