Jump to content
Sign in to follow this  

Clicking a menu item for a desktop icon

Recommended Posts


I want to click the an item of a desktop icon menu.

I found the following code in the forum but it only goes as far as causing the menu to come up on the desktop.

#include <GuiListView.au3>
#include <array.au3>

$h_Desktop_LV = ControlGetHandle("[CLASS:Progman]", "", "SysListView321")
WinMinimizeAll() ; <=== only included so one can see what is happening

$iItemIndex = _GUICtrlListView_FindText($h_Desktop_LV, "Some arbitrary desktop icon title")
If $iItemIndex = -1 Then $iItemIndex = 0

$aItemPos = _GUICtrlListView_GetItemPosition($h_Desktop_LV, $iItemIndex)

ControlClick("", "", $h_Desktop_LV, "right", 1, $aItemPos[0], $aItemPos[1])

How do I do the next step of left clicking an item in the menu?


Should I be using another approach (a sample would be most helpful)



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this