Zari Posted December 14, 2009 Share Posted December 14, 2009 Hi, Is there a way to prevent users from closing the GUI (the X in the top right corner)? I would like to disable the X in the top right corner of the GUI. Thanks Link to comment Share on other sites More sharing options...
GEOSoft Posted December 14, 2009 Share Posted December 14, 2009 This is an iffy question but I'm going to roll the dice and give you some info. Set the window style to $WS_POPUP and then you don't even have the button. The other option is don't use $GUI_EVENT_CLOSE (or -3) on your code. IIRC you can also do it by creating a Parent window and a child window with all the controls on the child then set the Parent to @SW_DISABLE once the child has loaded. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 14, 2009 Moderators Share Posted December 14, 2009 Zari,This disables the red [X] and the System Menu "Close" item:#Include <GUIMenu.au3> $hGUI = GUICreate('MyGUI') $hMenu = _GUICtrlMenu_GetSystemMenu($hGUI) _GUICtrlMenu_EnableMenuItem($hMenu, $SC_CLOSE, $MF_GRAYED, False) ;_GUICtrlMenu_EnableMenuItem($hMenu, $SC_MINIMIZE, $MF_GRAYED, False) _GUICtrlMenu_EnableMenuItem($hMenu, $SC_MAXIMIZE, $MF_GRAYED, False) GUISetState() While 1 Sleep(10) WEndM23 pixelsearch 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
GEOSoft Posted December 14, 2009 Share Posted December 14, 2009 Nice one big M. I forgot about that file, although I'm still nervouse about people that want to start up an app and then not allow it to be closed. It can be used for good purposes or ... George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 14, 2009 Moderators Share Posted December 14, 2009 George,I initially shared your misgivings, but I felt just greying the [X] while leaving the GUI visible was a reasonably valid question. Nowhere near the level of "How do I stop my process being closed?" - that would be a real flashing red light, complete with screaming sirens. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
GEOSoft Posted December 14, 2009 Share Posted December 14, 2009 Ever had one of those popups saying "Your system is infected" and you can't close the damn thing? I went to a site 2 days ago to get a simple image file. The only thing I saw was a warning that the system was infected and it was downloading a file to fix it (and IE was blocked from closing). NOT HAPPENING A**HOLE. Hello reset button. Then clear the TIFs and the temp folder George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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