Jump to content

Menu & Shortcut Keys

Recommended Posts

What am i doing wrong -

When I enter <ALT>f the file menu does not open? Tried the example in the help file and it seems to work.

#include "GUIConstants.au3"

GUICreate("My GUI menu",300,200)

$oFileMenu = GUICtrlCreateMenu ("&File")

$oFileNew = GUICtrlCreateMenuItem ( "&New", $oFileMenu )

$oFileOpen = GUICtrlCreateMenuItem ("&Open",$oFileMenu)

$oRecentFilesMenu = GUICtrlCreateMenu ("Recent Files",$oFileMenu,2)

$oSeparator1 = GUICtrlCreateMenuitem ("",$oFileMenu,3)

$oSaveFile = GUICtrlCreateMenuitem ("&Save", $oFileMenu)


$oSaveFileAs = GUICtrlCreateMenuitem ("Save &As...", $oFileMenu)


$oSeparator2 = GUICtrlCreateMenuitem ("",$oFileMenu,6)

$oClose = GUICtrlCreateMenuitem ("&Close", $oFileMenu)

$oEditMenu = GUICtrlCreateMenu ( "&Edit" )

GUISetState ()

While 1

$msg = GUIGetMsg()

If $msg = $oFileOpen Then

$file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)")


If $msg = $oClose Then







Edited by alawoona
Link to post
Share on other sites

If you add the following two lines to the start of your script, the problem goes away:

$okbutton = GUICtrlCreateButton ("OK",50,130,70,20)

So why does the $GUI_FOCUS affect the Alt keys?

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to post
Share on other sites


Seems to be a general problem with a menu- and 'controlfree'-window.

I used some other sample menu applications and removed the controls from the windows -> and now they have the same problem.

So I see no chance to correct a default-will-ever-happens-bug :(

P.S.: I never saw an application with only menus in it but however, you could use the small workaround with creating a small label.

I somebody knows a solution let us know :ph34r:

So long and regards


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

    No registered users viewing this page.

  • Create New...