So far I'm able to get the text, but only if the mouse cursor is positioned above it. Is there a way to define the exact position of the text without needing to use the current mouse coordinates? I see in the AccViewer script there's mention of the "path" -- Can that be used to do what I need?
Here's the script I have which requires using the mouse coordinates:
Code: Select all
#SingleInstance, Force
F1::
Acc := Acc_ObjectFromPoint(ChildId)
MsgBox, % Acc.accName(ChildId)
return
Acc_Init() {
Static h
If (!h) {
h := DllCall("LoadLibrary", "Str", "Oleacc.dll", "Ptr")
}
}
Acc_ObjectFromPoint(ByRef _idChild_ := "", x := "", y := "") {
Acc_Init()
If (DllCall("Oleacc.dll\AccessibleObjectFromPoint", "Int64", x == "" || y == "" ? 0 * DllCall("GetCursorPos", "Int64*", pt) + pt : x & 0xFFFFFFFF | y << 32, "Ptr*", pacc, "Ptr", VarSetCapacity(varChild, 8 + (2 * A_PtrSize), 0) * 0 + &varChild) = 0) {
return ComObjEnwrap(9, pacc, 1), _idChild_ := NumGet(varChild, 8, "UInt")
}
}
Acc_WindowFromObject(pacc) {
If (DllCall("Oleacc.dll\WindowFromAccessibleObject", "Ptr", IsObject(pacc) ? ComObjValue(pacc) : pacc, "Ptr*", hWnd) = 0) {
return hWnd
}
}
Acc.ahk
https://github.com/Drugoy/Autohotkey-sc ... es/Acc.ahk
AccViewer.ahk
https://github.com/Drugoy/Autohotkey-sc ... Viewer.ahk