Jump to content

$GUI_EVENT_CLOSE not defined?


Rezert
 Share

Recommended Posts

WTF? This is my code:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.12.0
 Author:         Rezert

 Script Function:
    Just a simple window.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

GUICreate("Simple Window", 500, 500);
GUICtrlCreateLabel("Welcome to my small GUI!", 30, 10);
$okbutton = GUICtrlCreateButton("OK", 30, 40, 60);
$firstmen = GUICtrlCreateMenu("File");
$infmenu4 = GUICtrlCreateMenuItem("Exit...", $firstmen);
GUISetState();
While True
    $msg = GUIGetMsg();
    If $msg = $infmenu4 Or $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

I get a message about it $GUI_EVENT_CLOSE not being defined. Please help. =]

Link to comment
Share on other sites

Fixed:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.12.0
 Author:         Rezert

 Script Function:
    Just a simple window.

#ce ----------------------------------------------------------------------------
#include <GUIConstantsEx.au3>

; Script Start - Add your code below here

GUICreate("Simple Window", 500, 500);
GUICtrlCreateLabel("Welcome to my small GUI!", 30, 10);
$okbutton = GUICtrlCreateButton("OK", 30, 40, 60);
$firstmen = GUICtrlCreateMenu("File");
$menuexit = GUICtrlCreateMenuItem("Exit...", $firstmen);
GUISetState();
While True
    $msg = GUIGetMsg();
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $menuexit
            ExitLoop
    EndSelect
WEnd
Edited by Rezert
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...