Page 1 of 1

active accessibility click selectable

Posted: 04 Oct 2017, 06:07
by hrvoje83
Hello,

Can anyone help me how to click this selectable "test" file?

Re: active accessibility click selectable

Posted: 04 Oct 2017, 08:21
by jeeswg
One of these two may work:

Code: Select all

q::
WinGet, hWnd, ID, A
oAcc := Acc_Get("Object", "5.1.1.1.1.1.4.1", 0, "ahk_id " hWnd)
oAcc.accDoDefaultAction(0)
oAcc := ""
return

w::
ControlGet, hCtl, Hwnd,, NETUIHWND4, A
oAcc := Acc_Get("Object", "5.1.1.1.1.1.4.1", 0, "ahk_id " hCtl)
oAcc.accDoDefaultAction(0)
oAcc := ""
return

Re: active accessibility click selectable

Posted: 04 Oct 2017, 08:54
by hrvoje83
Hmm, still nothing.
I am trying your combination and even this two bellow, still nothing.

This selectable folder is part of MS outlook, but I want to know this function also for other programs, because of that I am asking for a solution.

Also there was one try with oAcc.accDoDefaultState(0), but also nothing.

Code: Select all

WinActivate, ahk_class rctrl_renwnd32
#Include C:\Users\UI287714\Desktop\Active accesibility staviti lib u AH folder\Lib\Acc.ahk
WinGet, hWnd, ID, A
oAcc := Acc_Get("Object", "5.1.1.1.1.1.4.1", 0, "ahk_id " hWnd)
oAcc.accDoDefaultAction(0)
oAcc := ""
return

WinActivate, ahk_class rctrl_renwnd32
ControlGet, hCtl, Hwnd,, NETUIHWND4, A
#Include C:\Users\UI287714\Desktop\Active accesibility staviti lib u AH folder\Lib\Acc.ahk
oAcc := Acc_Get("Object", "5.1.1.1.1.1.4.1", 0, "ahk_id " hCtl)
oAcc.accDoDefaultAction(0)
oAcc := ""
return

Re: active accessibility click selectable

Posted: 04 Oct 2017, 09:02
by jeeswg
You could try "4.1.5.1.1.1.1.1.4.1", i.e. put '4.1.' at the front of the path. Hmm, there is no stated action for the element, that field is empty.

Or use the coordinates with Click/MouseClick/Send (with Click)/SendInput (with Click)/ControlClick.

Re: active accessibility click selectable

Posted: 06 Oct 2017, 05:26
by hrvoje83
Hi jeeswg,

Thank you but still nothing.

Is there any other way except click by coordinates to click on Outlook folder?

Re: active accessibility click selectable

Posted: 06 Oct 2017, 16:58
by jeeswg
I did some experiments with Explorer, and was to able to invoke opening a file. So perhaps some of the code below could be useful.

Something like MsgBox, % oAcc.accName(0) might be useful, to check that you have the right object.

Outlook uses COM, so perhaps that could be useful.

Sometimes you can paste a path into an Edit control and send Enter, or add a folder as a toolbar button (and you can invoke the toolbar button via Acc). Possibly you could create a shortcut that starts with an unusual character and send that character followed by Enter.

Code: Select all

q:: ;Explorer window - invoke first file (Windows 7, large icons)
WinGet, hWnd, ID, A
oAcc := Acc_Get("Object", "4.3.4.1.4.1.4.4.4.1.4.2", 0, "ahk_id " hWnd)
oAcc.accDoDefaultAction(0)
oAcc := ""
return

w:: ;Explorer window - invoke first file (Windows 7, large icons)
ControlGet, hCtl, Hwnd,, DirectUIHWND3, A
oAcc := Acc_Get("Object", "4.2", 0, "ahk_id " hCtl)
MsgBox, % oAcc.accName(0) "`r`n" oAcc.accValue(0)
oAcc.accDoDefaultAction(0)
oAcc := ""
return

e:: ;Explorer window - invoke first file (Windows 7, large icons)
ControlGet, hCtl, Hwnd,, DirectUIHWND3, A
oAcc := Acc_Get("Object", "4.2", 0, "ahk_id " hCtl)
oRect := Acc_Location(oAcc)
WinGetPos, vWinX, vWinY, vWinW, vWinH, A
vPosX := Round(oRect.x + oRect.w/2) - vWinX
vPosY := Round(oRect.y + oRect.h/2) - vWinY
MouseMove, % vPosX, % vPosY
ControlClick, % Format("X{} Y{}", vPosX, vPosY), A,,, 2
oAcc := ""
return