sublimnl Posted March 27, 2005 Share Posted March 27, 2005 1. When I click the 'X' button to close my GUI window nothing happens. How can I get this to work normally? 2. I want to disable the Maximize/Restore button. How? Thanks! Link to comment Share on other sites More sharing options...
Developers Jos Posted March 27, 2005 Developers Share Posted March 27, 2005 1. When I click the 'X' button to close my GUI window nothing happens. How can I get this to work normally?<{POST_SNAPBACK}>Think every example in the helpfile has this in it:While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop2. I want to disable the Maximize/Restore button. How?<{POST_SNAPBACK}>WS_SYSMENU creates an window without the MAX/MIN/RESTORE button.#include <GUIConstants.au3> GUICreate("My GUI",-1,-1,-1,-1,$WS_SYSMENU) ; will create a dialog box that when displayed is centered GUISetState (@SW_SHOW) ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
sublimnl Posted March 27, 2005 Author Share Posted March 27, 2005 Guess I should have specified that I am using OnEvent mode. I tried "GUICtrlSetOnEvent($GUI_EVENT_CLOSE,"CGTerm")" but no joy. Is that not the proper syntax? Link to comment Share on other sites More sharing options...
Developers Jos Posted March 27, 2005 Developers Share Posted March 27, 2005 Guess I should have specified that I am using OnEvent mode. I tried "GUICtrlSetOnEvent($GUI_EVENT_CLOSE,"CGTerm")" but no joy. Is that not the proper syntax?<{POST_SNAPBACK}>GUICtrlSetOnEvent won't work on the GUI itself.... only on controls.You need to use GUISetOnEvent.heres and example from the helpfile:#include <GUIConstants.au3> Opt("GUIOnEventMode", 1) ; Change to OnEvent mode $mainwindow = GUICreate("Hello World", 200, 100) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlCreateLabel("Hello world! How are you?", 30, 10) $okbutton = GUICtrlCreateButton("OK", 70, 50, 60) GUICtrlSetOnEvent($okbutton, "OKButton") GUISetState(@SW_SHOW) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
sublimnl Posted March 28, 2005 Author Share Posted March 28, 2005 Duh! Late night/early morning mistake. Thank you! Link to comment Share on other sites More sharing options...
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