joseedwin Posted April 12, 2006 Share Posted April 12, 2006 i am trying to disable the top right X on a gui i created. i was able to search the forums but i only found disabling minimize and maximize, can someone point me in the right direction to disable the close button. Thank you. Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 12, 2006 Share Posted April 12, 2006 i am trying to disable the top right X on a gui i created. i was able to search the forums but i only found disabling minimize and maximize, can someone point me in the right direction to disable the close button. Thank you.I can't test it right now, but did you try the $WS_DLGFRAME style when creating your GUI? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Holger Posted April 12, 2006 Share Posted April 12, 2006 Another possibility (from MSDN): #include <GUIConstants.au3> Opt('GUICloseOnEsc', 0) Global Const $SC_CLOSE = 0xF060 Global Const $MF_GRAYED = 0x00000001 $hGUI = GUICreate('Test') $Btn = GUICtrlCreateButton('Exit', 100, 100, 70, 25) GUISetState() $hMenu = DllCall('user32.dll', 'int', 'GetSystemMenu', 'hwnd', $hGUI, 'int', 0) DllCall('user32.dll', 'int', 'EnableMenuItem', 'hwnd', $hMenu[0], 'int', $SC_CLOSE, 'int', $MF_GRAYED) Do $Msg = GUIGetMsg() Until $Msg = $Btn Greets Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
joseedwin Posted April 13, 2006 Author Share Posted April 13, 2006 Thanks PsaltyDS, your approach did help, but i wanted to display the icon as well. My fault for not mentioning this before. Thanks Holger, your suggestion worked perfectly. Thank you guys! Link to comment Share on other sites More sharing options...
MadBoy Posted April 13, 2006 Share Posted April 13, 2006 You could also just have the button there and not set Case for it. So even if you click on it nothing happens. My little company: Evotec (PL version: Evotec) 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