CodeMaster Rapture Posted September 6, 2005 Posted September 6, 2005 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
andd Posted September 6, 2005 Posted September 6, 2005 You should use the GUISetOnEvent() instead of the B]GUICtrlSetOnEvent()function for the close event, because the GUI is not a control, then it should work
CodeMaster Rapture Posted September 6, 2005 Author Posted September 6, 2005 Aaahhh, ok. Silly me. Thanx a bunch. I was begginning to think I was crazy. -CMR
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now