I'm quite new in autohotkey and I'm currently facing a misunderstanding about the ControlClick.
My aim is to right click on an icon on the toolbarWindow321 with a ControlClick to display the contextual menu. I do not want to use a Click or a Send as the action could be done when the session is locked on.
I search for a while in the web and tried several things.
ControlClick,,ahk_class Shell_TrayWnd,,R,NA x1500 y22
This thing works fine if I wanted to have the dropdown menu of the toolbar. That's not the case.
I tried something like this:
ControlClick,ToolbarWindow321,ahk_class Shell_TrayWnd,,Right,1,NA x1500 y22
But nothing is shown. I tried several coordinates, and used AutoIt3 spy to determined the position of my icon.
I'm certain I've done something wrong (of course or it would be working fine :)) Does somebody have an idea of what I must do to make it work?
I wrote some code to click on the Desktop button in Notepad's Save As window. On the Windows XP version of Notepad this was a ToolbarWindow32 control. The code uses functions from the Acc library, which you can put in your script's Lib folder.
Acc Library [AHK_L] (updated 09/27/2012) - Scripts and Functions - AutoHotkey Community https://autohotkey.com/board/topic/77303-acc-library-ahk-l-updated-09272012/
EDIT: In your particular case, accDoDefaultAction might not correspond to right-click.
For reference, my script that works on both Windows XP and 7: