- @sancarn: I've been doing various tests with Acc.
- Most of the time I haven't been able to get anything useful out of the accChild method.
- Typically these fail: oAcc.accChild(n) and Acc_Child(oAcc, n) (from Acc.ahk), as do attempts to call the vtable directly via DllCall.
- When I test on a child object, I get the error E_INVALIDARG := 0x80070057, and message 'The parameter is incorrect.'
- When I test on a child non-object I get S_FALSE := 1 as expected.
- However, I did find 2 examples in my script libraries where all 3 approaches did work, they were for Firefox and Chrome. I tested the Firefox code and it was still working, it retrieved text from Show All History (Ctrl+Shift+H).
- Virtually every time I've referred to child objects, it's been via the Acc_Children function in the Acc.ahk library, which uses oleacc\AccessibleChildren. That's been something that has seemed to always work.
- So perhaps when accChild fails, it's simply dependent on how something is implemented in the software you're using. So perhaps the message 'The parameter is incorrect.', is misleading/wrong, what we've sent is correct, and should work in theory, but for whatever reason the receiver isn't it handling it.
- When oAcc.accChild(n)
has worked, n was simply an integer. I did not need to use oAcc.accChild(ComObject(type, n))
IAccessible::get_accChild (oleacc.h) - Win32 apps | Microsoft Docs
- Example code to get a pointer from an Acc object:
Code: Select all
WinGet, hWnd, ID, A
oAcc := Acc_Get("Object", "4.4.4", 0, "ahk_id " hWnd) ;Notepad Find dialog 'Match case'
pAcc := ComObjValue(oAcc)
;pAcc := ComObject(oAcc) ;equivalent to line above
- List of methods for IAccessible:
Code: Select all
;INTERFACE - IAccessible