Jump to content
Sign in to follow this  
Yinan

How to click a menu item?

Recommended Posts

Yinan

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

Share this post


Link to post
Share on other sites
FireFox

@Yinan

MouseClick("left",x,y,1)
Send("{ENTER}")

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
SmOke_N

WinMenuSelect() doesn't work?


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites
charvi

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

Share this post


Link to post
Share on other sites
Yinan

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.

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  

×