Jump to content

Recommended Posts

Posted

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!

Posted (edited)

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
Posted

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?

Posted
On 11/7/2023 at 9:44 PM, mr-es335 said:

Are there utilities that can determine the menu ID number?

Use AutoIt Window Info tool and see what kind of controls you are dealing with.

Posted

Good day,

I have been attempting to discover the menu ID for a specific application - all with any success.
• See post above [Link]

Can anyone please provide me with any assistance. Such assistance would be greatly appreciated!

PS: I am a "rank:" neophyte here!!!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...