Jump to content
Sign in to follow this  
ChiGGz

Unable to use WinMenuSelectItem

Recommended Posts

ChiGGz

I've searched exhaustively and now resort to the kind members!

I'm doing regressive testing for my company product and wish to use AutoIt. Apparently the menus are of non-standard design so I can't obtain a ID.

I read that Auto3Lib can be used. And that it is prepackaged....(currently using AutoIt 3.2.10.0)

I don't see it, after doing the reg patch I installed Auto3Lib and now I'm getting a constants error trying to run the samples.

Problem after problem!

#1. Is there a built in alternative (non manual mouse X,Y) to WinMenuSelectItem.

#2. Is Auto3Lib built into the latest version (3.2.10.0)

Thank-you for your support!

Share this post


Link to post
Share on other sites
ChiGGz

User Defined Functions

GuiMenu Management

in the help

Thanks for your input.

But its to my understanding that the GuiMenu Management functions are for creating your own custom GUI. In my case I'm looking to specifically invoke a certain GUI option from a third party application.

If I'm wrong can you point me specifically to the function that is similiar to WinMenuSelectItem?

Thanks alot

Share this post


Link to post
Share on other sites
Zedna

Thanks for your input.

But its to my understanding that the GuiMenu Management functions are for creating your own custom GUI. In my case I'm looking to specifically invoke a certain GUI option from a third party application.

If I'm wrong can you point me specifically to the function that is similiar to WinMenuSelectItem?

Thanks alot

Don't worry. GUIMenu UDF is also for manipulating menus in external applications.

Look at _GUICtrlMenu_TrackPopupMenu() _GUICtrlMenu_FindItem() and also other functions there.

Share this post


Link to post
Share on other sites
ChiGGz

Don't worry. GUIMenu UDF is also for manipulating menus in external applications.

Look at _GUICtrlMenu_TrackPopupMenu() _GUICtrlMenu_FindItem() and also other functions there.

I notice that there is a parameter $hWnd What is the getter function for this parameter?

EDIT:

ControlGetHandle seems to be the function for that if I'm not mistaken

Edited by ChiGGz

Share this post


Link to post
Share on other sites
ChiGGz

$hWnd = ControlGetHandle("VPN Manager","",590778)
$hMenu = _GUICtrlMenu_GetMenu($hWnd)
$test = _GUICtrlMenu_FindItem($hMenu,"About", False,0)
MsgBox(0,"VPN Manager",$hMenu)

It would seem that $hWnd and $hMenu have the same values. 0x000903BA

This must be wrong...

The $test returns -1. Not 0 as per the help file for failure.

Edited by ChiGGz

Share this post


Link to post
Share on other sites
GEOSoft

$hWnd = ControlGetHandle("VPN Manager","",590778)
$hMenu = _GUICtrlMenu_GetMenu($hWnd)
$test = _GUICtrlMenu_FindItem($hMenu,"About", False,0)
MsgBox(0,"VPN Manager",$hMenu)

It would seem that $hWnd and $hMenu have the same values. 0x000903BA

This must be wrong...

The $test returns -1. Not 0 as per the help file for failure.

Try WinGetHandle()

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
ChiGGz

Try WinGetHandle()

Hi GEOSoft.

I've tried the following now.

#Include <GuiMenu.au3>

WinActivate("VPN Manager")
Sleep(1000)
$hWnd = WinGetHandle("VPN Manager")
$hMenu = _GUICtrlMenu_GetMenu($hWnd)

MsgBox(0,"VPN Manager",$hMenu)

$hWnd returns 0x000403A6

but $hMenu returns 0x00000000

does this mean $hMenu does not exist for this app or am I using the wrong syntax?

Thanks

Share this post


Link to post
Share on other sites
LarryDalooza

You mentioned yourself that the menus are "non-standard" ... so ... don't use menu commands ... they won't work...

Best chance is to ControlSend keystrokes directly to the control...

Lar.

p.s. to the people that are trying to help ... read carefully ... please.

Edited by LarryDalooza

f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites
Zedna

Larry is right. If WinMenuSelectItem doesn't work then also menu API functions will not work.

If your menus are in Office like style then you may try ToolBar UDF. I saw some scripts for manipulating such Microsoft's modern menus by using ToolBars API functions. I think nice examples for that were in Auto3Library but I'm not 100%. sure about that.

Edited by Zedna

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  

×