Jump to content

How to click a menu item?


Yinan
 Share

Recommended Posts

guys,

I m new to AutoIt. Now I have a problem when I try to use AutoIt to click a menu item from a right-click context menu in XP.

The AutoIt Window Info can't detect any information in that menu, so that I can't use AutoIt to click it.

I m looking for something besides using Send key for this. Any idea?

Thanks!

post-44628-1231235956_thumb.jpg

Edited by Yinan
Link to comment
Share on other sites

WinMenuSelect() doesn't work?

@SmOke_N

I have a menu too, created this format:

Local $m_Gam = GUICtrlCreateMenu("&Games")
Local $m_GamSol = GUICtrlCreateMenuItem("Solitaire", $m_Gam)
Local $m_GamSpi = GUICtrlCreateMenuItem("Spider Solitaire", $m_Gam)

and I am running the programs in the While 1 ... WEnd loop:

While 1
    $ai_Msg = GUIGetMsg(1)
    Select
        Case $ai_Msg[0] = $m_GamSol And $ai_Msg[1] = $h_WinMain
            If @OSVersion = "WIN_VISTA" Then Run("C:\Program Files\Microsoft Games\Solitaire\Solitaire.exe")
            If @OSVersion = "WIN_XP" Then Run("C:\Windows\System32\sol.exe")
        Case $ai_Msg[0] = $m_GamSpi And $ai_Msg[1] = $h_WinMain
            If @OSVersion = "WIN_VISTA" Then Run("C:\Program Files\Microsoft Games\SpiderSolitaire\SpiderSolitaire.exe")
            If @OSVersion = "WIN_XP" Then Run("C:\Windows\System32\spider.exe")
    ;EndCase
    EndSelect
WEnd

but I don't understand the WinMenuSelect(). The example in the helpfile is too short for analyse. How should I use it in the above example?

Thanks in advance

Cheers, Charvi

Edited by charvi
Link to comment
Share on other sites

WinMenuSelect() doesn't work?

Looks like WinMenuSelect will only work for the menu item from the menu bar of a window.

What I face is the context menu from IE7's add favorate, as you can see from the snapshot of the first post of mine.

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...