ACC.AHK - Get IAccessible for Context menu
Posted: 16 Jul 2017, 11:36
Hi all,
I'm trying to get the IAccessible interface for the right-click context menu using acc.ahk.
I've noticed that "Context" is a direct child of the Desktop client window, so I'm trying to loop over all children of the Desktop window until accName=="Context" and accRole==0xb
So far I've managed to get the IAccessible interface for the desktop client window:
I can tell this is indeed the desktop window because: msgbox, % getRoot().accChildCount ;==> 351 which is the same as the count that I see in Inspect.exe.
However when I try to use msgbox, % """" Acc_Child(getRoot(),1).accName """" I get "".
Looking deeper into the issue ComObjType(Acc_Child(getRoot(),1)) returns an empty string. I.E. Acc_Child does not return a COM Object...
Any ideas why this doesn't work?
Edit:
When running getRoot().accChild(1), I get an error "The parameter is incorrect." ... Specifically accChild.
Edit2:
I found that someone using AutoIt got a similar error:
https://www.autoitscript.com/forum/topi ... ent=251855
I'm trying to get the IAccessible interface for the right-click context menu using acc.ahk.
I've noticed that "Context" is a direct child of the Desktop client window, so I'm trying to loop over all children of the Desktop window until accName=="Context" and accRole==0xb
So far I've managed to get the IAccessible interface for the desktop client window:
Code: Select all
getRoot(){
return acc_ObjectFromWindow(dllcall("GetDesktopWindow"))
}
However when I try to use msgbox, % """" Acc_Child(getRoot(),1).accName """" I get "".
Looking deeper into the issue ComObjType(Acc_Child(getRoot(),1)) returns an empty string. I.E. Acc_Child does not return a COM Object...
Any ideas why this doesn't work?
Edit:
When running getRoot().accChild(1), I get an error "The parameter is incorrect." ... Specifically accChild.
Edit2:
I found that someone using AutoIt got a similar error:
https://www.autoitscript.com/forum/topi ... ent=251855