Sign in to follow this  
Followers 0
dazza

_GUICtrlMenu_GetItemSubMenu

4 posts in this topic

Dear Bods,

How do I do a _GUICtrlMenu_GetItemSubMenu from a sub-sub menu?

If an application has a menu of:

File | Edit | View | Report | Help

And Report has:

Report1 | Report2 | Report3

And Report2 has:

Report2a | Report2b | Report 2c

How do I get the state/name of Report2b?

So far my code is:

$hWnd = WinGetHandle("Window name")
$hMenu = _GUICTRLMenu_GetMenu($hWnd)
$hReports = _GUICTRLMenu_GetItemSubMenu($hMenu, 4)

$data = _GUICTRLMenu_GetItemText($hReports, 2)

Share this post


Link to post
Share on other sites



Make sure that Report2 has a variable name assigned to it:

$Report2 = GuiCtrlCreateMenu($Report, "Report 2")

Then all you need to do is call, _GUICtrlMenu_GetItemSubMenu like so:

_GUICtrlMenu_GetItemSubMenu($Report2, 2)

That should work?

Share this post


Link to post
Share on other sites

Make sure that Report2 has a variable name assigned to it:

$Report2 = GuiCtrlCreateMenu($Report, "Report 2")

Then all you need to do is call, _GUICtrlMenu_GetItemSubMenu like so:

_GUICtrlMenu_GetItemSubMenu($Report2, 2)

That should work?

Many thanks :)

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  
Followers 0