Sign in to follow this  
Followers 0
Rezert

$GUI_EVENT_CLOSE not defined?

2 posts in this topic

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. =]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

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  
Followers 0