Jump to content

Find menu ID


 Share

Recommended Posts

Good day,

Is there any way to find the menu ID number?

Via the example in HelpFile, i was able to insert the example menu in one application, but not another?

Contacting the developer, this is what i was told, "Perhaps the menu id numbers are clashing in SAW...try using different values starting at 30,000."

Thanks!

Link to comment
Share on other sites

Good day,

OKAY!

The first snippet is derived fr the HelpFile "_GUICtrlMenu_GetMenu" -  the other two are from SAC and SAW - with just the sections that matter:

; Example #1: From the HelpFile example
; Open Notepad
    Run("notepad.exe")
    WinWaitActive("[CLASS:Notepad]")
    $hWnd = WinGetHandle("[CLASS:Notepad]")
    $hMain = _GUICtrlMenu_GetMenu($hWnd)

; Insert new menu into Notepad
    _GUICtrlMenu_InsertMenuItem($hMain, 6, "&AutoIt", 0, $hItem2)
    _GUICtrlMenu_DrawMenuBar($hWnd)
; --------------------------------------------------------------
; Example #2
; In one application, I discovered that the [6] needed to updated to [7]...
; and that worked great!:

; Open SAC
    Run("C:\RML\SAC\SAC64.exe")
    WinWaitActive("[CLASS:SAC_MAIN]")
    $hWnd = WinGetHandle("[CLASS:SAC_MAIN]")
    $hMain = _GUICtrlMenu_GetMenu($hWnd)

; Insert new menu into SAC
    _GUICtrlMenu_InsertMenuItem($hMain, 7, "&AutoIt", 0, $hItem2)
    _GUICtrlMenu_DrawMenuBar($hWnd)
; --------------------------------------------------------------
; Example #3
; However, in the other application, I discovered that the [6] needed to
; updated to [13]...and that did NOT work out so great!:

; Open SAW
    Run("C:\RML\SAW\SAWStudio64.exe")
    WinWaitActive("[CLASS:SAWSTUDIO_MAIN]")
    $hWnd = WinGetHandle("[CLASS:SAWSTUDIO_MAIN]")
    $hMain = _GUICtrlMenu_GetMenu($hWnd)

; Insert new menu into SAW
    _GUICtrlMenu_InsertMenuItem($hMain, 13, "&AutoIt", 0, $hItem2)
    _GUICtrlMenu_DrawMenuBar($hWnd)
; --------------------------------------------------------------

See the following:

Combined.png.6d6a98270bf182d5765121fd95bb1492.png

As noted, I was told to try ""Perhaps the menu id numbers are clashing in SAW...try using different values starting at 30,000." - which I DID, but to no avail.

I tried various numbers, again with no results. "HELP!"

PS: I should mention that I did come across this [Link] ...but not too sure what this is doing...the result are in the attached...

Menu-Information.txt

Edited by mr-es335
Link to comment
Share on other sites

junkew,

I have two applications by the same developer...one works, the other does not [...please note...I am a neophyte here...]

You stated, "Whats the class of the menubar in all applications?" My response: I am not sure how to find that information?

You stated, "Whats your endgoal?" My response: I use a number of "external scripts" that would be much more efficient if i could access such scripts "integrally". I do hope that this makes sense?

Link to comment
Share on other sites

Use au3inf or see faq 31 and 40 for other tools to spy on classnames.

Regarding your endgoal it really depends on what your script needs to do. Some sendkeys will be easy. Did you try in notepad to really have the menuitem do something usefull?

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