Jump to content
Sign in to follow this  
Guest johnq

How to bring up a menu?

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.

Share this post


Link to post
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.


.

Share this post


Link to post
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

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...