; Автор скрипта Irbis ;http://forum.script-coding.com/viewtopic.php?id=10392&p=3 #Persistent CoordMode, Caret Color:={"English":"0x0C0BC0", "Russian":"0xC00C0B"} ;Color:={"English":"0x0000FF", "Russian":"0xFF0000"} w0:=8, h0:=8, w1:=12, h1:=14 Gui, +AlwaysOnTop -Caption +ToolWindow +LastFound +HwndGuiHwnd WinSet, Transparent, 100 SetTimer, WatchCaret, 50 return ~LButton:: SetTimer, WatchCaret, Off Sleep 500 SetTimer, WatchCaret, On Return #if (GuiHwnd=id) LButton:: PostMessage, 0x50, 2,,, A #If WatchCaret: MouseGetPos,,,id ; Gui, Color, % Color[GetInputLangName(GetInputLangID("A")] Gui, Color, % Color[InputLayout()] w := GetKeyState("CapsLock", "T") ? w1 : w0, h := GetKeyState("CapsLock", "T") ? h1 : h0 (A_CaretX = "" && AccObjectFromPoint()) Gui, % (x:=A_CaretX+7)&&(y:=A_CaretY)&&(GuiHwnd!=WinExist("A")) ? "Show" : "Hide" , x%x% y%y% w%w% h%h% NA Return InputLayout() { If !(hWnd := WinExist("A")) return WinGetClass, Class if (Class == "ConsoleWindowClass") { WinGet, consolePID, PID DllCall("AttachConsole", Ptr, consolePID) VarSetCapacity(buff, 16) DllCall("GetConsoleKeyboardLayoutName", Str, buff) DllCall("FreeConsole") langID := "0x" . SubStr(buff, -3) } Else langID := DllCall("GetKeyboardLayout", Ptr, DllCall("GetWindowThreadProcessId", Ptr, hWnd, UInt, 0, Ptr), Ptr) & 0xFFFF Size := (DllCall("GetLocaleInfo", UInt, langId, UInt, 0x1001, UInt, 0, UInt, 0) * 2) ; LOCALE_SENGLANGUAGE := 0x1001 VarSetCapacity(localeSig, Size, 0) DllCall("GetLocaleInfo", UInt, langId, UInt, 0x1001, Str, localeSig, UInt, Size) return localeSig } AccObjectFromPoint(ByRef _idChild_ = "", x = "", y = "") { static VT_DISPATCH := 9, h := DllCall("LoadLibrary", Str, "oleacc", Ptr) (x = "" || y = "") ? DllCall("GetCursorPos", Int64P, pt) : pt := x & 0xFFFFFFFF | y << 32 VarSetCapacity(varChild, 8 + 2*A_PtrSize, 0) if DllCall("oleacc\AccessibleObjectFromPoint", Int64, pt, PtrP, pAcc, Ptr, &varChild) = 0 Return ComObjEnwrap(VT_DISPATCH, pAcc, 1), _idChild_ := NumGet(varChild, 8, "UInt") } |