Joshuaaaa Posted November 29, 2007 Share Posted November 29, 2007 How can I do this? Link to comment Share on other sites More sharing options...
Xandl Posted November 29, 2007 Share Posted November 29, 2007 Hello, try this: Func setGUICloseButton($hWnd, $bState = False, $hUser32dll = 'user32.dll') Local Const $SC_CLOSE = 0xF060 Local Const $MF_ENABLED = 0x00000000 Local Const $MF_GRAYED = 0x00000001 Local $hMenu = DllCall($hUser32dll, 'int', 'GetSystemMenu', 'hwnd', $hWnd, 'int', 0) If $bState Then DllCall($hUser32dll, 'int', 'EnableMenuItem', 'hwnd', $hMenu[0], 'int', $SC_CLOSE, 'int', $MF_ENABLED) Else DllCall($hUser32dll, 'int', 'EnableMenuItem', 'hwnd', $hMenu[0], 'int', $SC_CLOSE, 'int', $MF_GRAYED) EndIf EndFunc Use setGUICloseButton($guiWindowID,False) to disable the close button, setGUICloseButton($guiWindowID,True) enables it. ciao Xandl 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