Jump to content

_GUICtrlMenu_GetItemSubMenu


Recommended Posts

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)
Link to comment
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 :)

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