Jump to content

How to bring up a menu?


Guest johnq
 Share

Recommended Posts

Guest johnq

Now I have defined a hotkey and a menu in my autoit3 script, what function to use to bring up the menu upon receiving the hotkey.

Link to comment
Share on other sites

Now I have defined a hotkey and a menu in my autoit3 script, what function to use to bring up the menu upon receiving the hotkey.

<{POST_SNAPBACK}>

#include <GuiConstants.au3>
$Gui = GUICreate("Gui")
$menu = GUICtrlCreateMenu("&menu")
$Menu_Item = GUICtrlCreateMenuitem("item",$menu)
GUISetState()
HotKeySet("{ENTER}","_myfunction")
While 1
    $msg = GUIGetMsg()
    Select
        case $msg = -3
            Exit
        
    EndSelect
WEnd
Func _myfunction()
    send("{ALT}"&"m")
EndFunc

Take note of the "&" before the "m" in the word menu.

.

Link to comment
Share on other sites

Guest johnq

Tnanks! But I would change your

Func _myfunction()
    send("{ALT}"&"m")
EndFunc
to

Func _myfunction()
    WinActivate($Gui)
    send("{ALT}"&"m")
EndFunc
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...