Jump to content

GUI Event Mode and $GUI_EVENT_CLOSE issues...


Recommended Posts

Greetings yet again,

I decided to try out the GUI Event Mode to save some CPU load and it has done wonders. Only having one problem. The X to close the GUI doesn't work. I dunno why, I mean, I get no compile errors or anything. Here is the code:

#include <GUIConstants.au3>
#NoTrayIcon
Opt("GUIOnEventMode", 1)

HotKeySet("{ESC}", "Do_Quit")

$Menu       = GuiCtrlCreateMenu ("Menu")
$MenuItem[1]    = GuiCtrlCreateMenuitem("About", $Menu)
$Separator1 = GuiCtrlCreateMenuitem("", $Menu)
$MenuItem[2]    = GuiCtrlCreateMenuitem("Exit", $Menu)

GUICtrlSetOnEvent( $MenuItem[1] ,   "Do_About")
GUICtrlSetOnEvent( $MenuItem[2] ,   "Do_Quit")
GUICtrlSetOnEvent( $GUI_EVENT_CLOSE ,   "Do_Quit")

Func Do_Quit()
    If (WinActive($Title)) Then Fade($Title,-1)
    Exit
EndFunc

Of course I've stripped the non-important code, but I think the problem is with the SetOnEvent function. Maybe someone knows what's up.

Thanx,

-CMR

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