Jump to content

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?

Or

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

Regards,

Jim

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...