unknown12 Posted March 21, 2005 Share Posted March 21, 2005 I have created a program with auto it, but the close button (X) won't work this is the code i'm using. #include <GuiConstants.au3> If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 GuiCreate("VirtuaDrums", 450, 535,(@DesktopWidth-450)/2, (@DesktopHeight-535)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) 2. How can I stop the window being resizable? thanks. Link to comment Share on other sites More sharing options...
automagician Posted March 21, 2005 Share Posted March 21, 2005 (edited) For #2, if there isn't a better way through the AutoIt GUI functions, you can always use a Dll call: $Hwnd = WinGetHandle("YOUR WINDOW") $menu = DllCall("user32.dll","hwnd","GetSystemMenu","hwnd", $Hwnd, "int",0) DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", 0xF000, "int", 0x0);removes SC_SIZE DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", 0xF030, "int", 0x0);removes SC_MAXIMIZE Edit: Regarding #1, have you tried something along these lines: GUISetOnEvent($GUI_EVENT_CLOSE, "_Foo") Func _Foo() Exit(0) EndFunc I haven't worked a lot with the AutoIt GUI's so if it doesn't work I am sorry, I am just trying to help. So I hope that helps a little, but there has to be an AutoIt function that controls the sizing functionality. Regards... Edited March 21, 2005 by automagician Link to comment Share on other sites More sharing options...
unknown12 Posted March 21, 2005 Author Share Posted March 21, 2005 (edited) don't want to call a dll, and i'm sure there theres a simpler way. i'll try the second one EDIT: Second dosn't work Edited March 21, 2005 by unknown12 Link to comment Share on other sites More sharing options...
Developers Jos Posted March 21, 2005 Developers Share Posted March 21, 2005 example where the X works and the window cannot be resized: #include <GuiConstants.au3> If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000 GuiCreate("VirtuaDrums", 450, 535,(@DesktopWidth-450)/2, (@DesktopHeight-535)/2 , $WS_SYSMENU) 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...
unknown12 Posted March 21, 2005 Author Share Posted March 21, 2005 thanks 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