Эти кнопки не являются контролами. Можно так:
~LButton::
CoordMode, Mouse
MouseGetPos, X, Y
AccObj := AccObjectFromPoint(child)
Pos := AccLocation(AccObj, child)
ToolTip, % "X: " . X - Pos.x . " Y:" . Y - Pos.y
Return
AccObjectFromPoint(ByRef _idChild_ = "", x = "", y = "") {
static VT_DISPATCH := 9, F_OWNVALUE := 1, h := DllCall("LoadLibrary", "Str", "oleacc", "Ptr")
AccObject := 0
(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
_idChild_ := NumGet(varChild, 8, "UInt"), AccObject := ComObject(VT_DISPATCH, pAcc, F_OWNVALUE)
Return AccObject
}
AccLocation(Acc, ChildId := 0, ByRef Position := "") {
static type := (VT_BYREF := 0x4000) | (VT_I4 := 3)
try Acc.accLocation( ComObject(type, &x := 0), ComObject(type, &y := 0)
, ComObject(type, &w := 0), ComObject(type, &h := 0), ChildId )
catch
Return
_x := NumGet(x, "int"), _y := NumGet(y, "int"), _w = NumGet(w, "int"), _h := NumGet(h, "int")
Position := "x" . _x . " y" . _y . " w" . _w . " h" . _h
Return {x: _x, y: _y, w: _w, h: _h}
}
Разработка AHK-скриптов:
e-mail
dfiveg@mail.ruTelegram
jollycoder