Pasukun Posted May 5, 2005 Share Posted May 5, 2005 Before I ask.. I want you to know that I am very new to AutoIt3. :"> Q: I am trying to make a resizable GUI window. How do I do that? For example. Your internet browser, you can use the mouse pointer to shrink or expand the size of it by clicking either the corner or the edge and drag. Here is my noob script. What can I add to make that possible? #include <GUIConstants.au3> $Title_01 = "My Project" $Width_01 = "500" $Height_01 = "250" $Xcoord_01 = "150" $YCoord_01 = "150" GuiCreate( $Title_01, $Width_01, $Height_01, $Xcoord_01, $Ycoord_01) GUISetState () While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend Thanks in advance. Link to comment Share on other sites More sharing options...
kjactive Posted May 5, 2005 Share Posted May 5, 2005 (edited) Well this is a little strange and told me to be changed BUT you has to do a default minemized window and move/resize it like this... $Form = GuiCreate('Form Window',180, 60,-1,.... WinMove($Form,-1,... // to the actually diaplay size but told me to be changed... I think that this is one thing an automated language should take care of for you... kjactive Edited May 5, 2005 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
jpm Posted May 5, 2005 Share Posted May 5, 2005 Before I ask.. I want you to know that I am very new to AutoIt3. :"> Q: I am trying to make a resizable GUI window. How do I do that? For example. Your internet browser, you can use the mouse pointer to shrink or expand the size of it by clicking either the corner or the edge and drag.Here is my noob script. What can I add to make that possible?#include <GUIConstants.au3> $Title_01 = "My Project" $Width_01 = "500" $Height_01 = "250" $Xcoord_01 = "150" $YCoord_01 = "150" GuiCreate( $Title_01, $Width_01, $Height_01, $Xcoord_01, $Ycoord_01) GUISetState () While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WendThanks in advance.<{POST_SNAPBACK}>look at the GUICreate docBy default the dialog box is non sizable and non maximizable. So WS_SIZEBOX or WS_MAXIMIZEBOX can be used in the style parameter. remember the first defined size is the minimum size Link to comment Share on other sites More sharing options...
layer Posted May 5, 2005 Share Posted May 5, 2005 (edited) Add this yo your optinal style paremeter or it might be exstyle paremeter $WS_SIZEBOX I think thats it Edited May 5, 2005 by layer FootbaG Link to comment Share on other sites More sharing options...
Pasukun Posted May 6, 2005 Author Share Posted May 6, 2005 Perfect! Thanks alot guys. Link to comment Share on other sites More sharing options...
Pasukun Posted May 6, 2005 Author Share Posted May 6, 2005 Didn't want to create another noob thread, so I decide to ask here instead. :"> Here is my updated script. (still practicing)#include <GUIConstants.au3>$Title_01 = "My Project"$Title_02 = "My Project2"$Width_01 = "500"$Height_01 = "250"$Xcoord_01 = "150"$YCoord_01 = "150"$Create_01 = GuiCreate( $Title_01, $Width_01, $Height_01, $Xcoord_01, $Ycoord_01, $WS_MINIMIZEBOX+$WS_SIZEBOX)GUISetState ()$Create_02 = GuiCreate( $Title_02, $Width_01, $Height_01, $Xcoord_01, $Ycoord_01, $WS_MINIMIZEBOX+$WS_SIZEBOX)GUISetState ()While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoopWendAs you can see. It will generate two GUI windows.Now here is my question..If I click on the either window's "X" box(located at the top right corner) to close the window.. it closes both..How can I make them independently close?Thanks in advance. Link to comment Share on other sites More sharing options...
steveR Posted May 6, 2005 Share Posted May 6, 2005 (edited) Here's one way using GuiGetMsg(1) ; advanced option The first gui is the parent and if closed, both windows will close. #include <GUIConstants.au3> $Title_01 = "My Project" $Title_02 = "My Project2" $Width_01 = "500" $Height_01 = "250" $Xcoord_01 = "150" $YCoord_01 = "150" $Create_01 = GuiCreate( $Title_01, $Width_01, $Height_01, $Xcoord_01, $Ycoord_01, $WS_MINIMIZEBOX+$WS_SIZEBOX) GUISetState () $Create_02 = GuiCreate( $Title_02, $Width_01, $Height_01, $Xcoord_01 + 50, $Ycoord_01 + 50, $WS_MINIMIZEBOX+$WS_SIZEBOX) GUISetState () While 1 $msg = GUIGetMsg(1) If $msg[0] = $GUI_EVENT_CLOSE and $msg[1] = $Create_01 Then exit If $msg[0] = $GUI_EVENT_CLOSE and $msg[1] = $Create_02 Then GUIDelete($Create_02) WEnd If you want them independant, then just check to see if both not exists: #include <GUIConstants.au3> $Title_01 = "My Project" $Title_02 = "My Project2" $Width_01 = "500" $Height_01 = "250" $Xcoord_01 = "150" $YCoord_01 = "150" $Create_01 = GuiCreate( $Title_01, $Width_01, $Height_01, $Xcoord_01, $Ycoord_01, $WS_MINIMIZEBOX+$WS_SIZEBOX) GUISetState () $Create_02 = GuiCreate( $Title_02, $Width_01, $Height_01, $Xcoord_01 + 50, $Ycoord_01 + 50, $WS_MINIMIZEBOX+$WS_SIZEBOX) GUISetState () While 1 $msg = GUIGetMsg(1) If $msg[0] = $GUI_EVENT_CLOSE and $msg[1] = $Create_01 Then GUIDelete($Create_01) If $msg[0] = $GUI_EVENT_CLOSE and $msg[1] = $Create_02 Then GUIDelete($Create_02) if (not WinExists("My Project")) and (not WinExists("My Project2")) then Exit WEnd edit:typos Edited May 6, 2005 by steveR AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. Link to comment Share on other sites More sharing options...
Pasukun Posted May 9, 2005 Author Share Posted May 9, 2005 Great! Much 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