This script receives nothing from the library call and I'm not sure what I'm doing wrong.
Code: Select all
Acc_Init() ; Not sure this is needed.
Gui, Add, Edit, x5 y5 w490 h25 vedit1,
Gui, Add, Edit, x5 y+5 w490 h25 vedit2,
Gui, Show, w500 h70 ,
Return
!z::
MouseGetPos, OutX, OutY, OutWin, OutCon,
id = 0xFFFFFFFC ; OBJID_CLIENT = 0xFFFFFFFC
GetInfo := Acc_ObjectFromWindow(OutWin,id)
GuiControl, , edit1, %GetInfo%
GuiControl, , edit2, %OutWin%
Return
Code: Select all
Acc_ObjectFromWindow(hWnd, idObject = 0)
{
Acc_Init()
If DllCall("oleacc\AccessibleObjectFromWindow", "Ptr", hWnd, "UInt", idObject&=0xFFFFFFFF, "Ptr", -VarSetCapacity(IID,16)+NumPut(idObject==0xFFFFFFF0?0x46000000000000C0:0x719B3800AA000C81,NumPut(idObject==0xFFFFFFF0?0x0000000000020400:0x11CF3C3D618736E0,IID,"Int64"),"Int64"), "Ptr*", pacc)=0
Return ComObjEnwrap(9,pacc,1)
}
Code: Select all
Acc_ObjectFromWindow(hWnd [, idObject=-4])
- Retrieves the specified interface for the object associated with the specified window.
Parameters
hWnd [in]
Specifies the handle of a window for which an object is to be retrieved.
idObject [in]
Specifies the object ID. This value is one of the standard object identifier constants (defaults to OBJID_CLIENT) or a custom object ID such as OBJID_NATIVEOM.
Return value
If successful, returns an AHK wrapped IAccessible object.