billthecreator Posted August 6, 2009 Share Posted August 6, 2009 (edited) Just like the topic title, how would i go about setting the resize ( i already got all the buttons and listview, and everything set to resize) of the gui not to get smaller than the original size i set it to? Cause all the buttons get meshed up. Thank you IA. Edited August 6, 2009 by billthecreator [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 6, 2009 Moderators Share Posted August 6, 2009 billthecreator, This code resizes the GUI to its original size if it is reduced below those values in either axis: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $iOrgWidth = 500, $iOriginalHeight = 500 $hGUI = GUICreate("Test", $iOrgWidth, $iOriginalHeight, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX)) GUISetState() ; When window is resized, run this function GUIRegisterMsg($WM_SIZE, "MY_WM_SIZE") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func MY_WM_SIZE($hWnd, $Msg, $wParam, $lParam) $iGUIWidth = BitAND($lParam, 0xFFFF) $iGUIHeight = BitShift($lParam, 16) If $iGUIWidth < $iOrgWidth Or $iGUIHeight < $iOriginalHeight Then $aPos = WinGetPos($hGUI) WinMove($hGUI, "", $aPos[0], $aPos[1], $iOrgWidth, $iOriginalHeight) EndIf Return $GUI_RUNDEFMSG EndFunc ;==>MY_WM_SIZE 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...
billthecreator Posted August 6, 2009 Author Share Posted August 6, 2009 that does help (a little) the only problem is that when it resizes, all the controls dont move. it actully makes the gui look horrible. ill work a little on this, maybe there is a better solution. but thank you anyway, you've helped a lot. [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
martin Posted August 6, 2009 Share Posted August 6, 2009 that does help (a little) the only problem is that when it resizes, all the controls dont move. it actully makes the gui look horrible. ill work a little on this, maybe there is a better solution. but thank you anyway, you've helped a lot. Another way I would recommend restricting your window size is with Global GUIMINWID = 300, GUIMINHT = 400;set your restrictions here Global GUIMAXWID = DesktopWidth, GUIMAXHT = DesktopHeight ; GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") .. . . Func WM_GETMINMAXINFO($hwnd, $Msg, $wParam, $lParam) $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, $GUIMINWID) ; min X DllStructSetData($tagMaxinfo, 8, $GUIMINHT) ; min Y DllStructSetData($tagMaxinfo, 9, GUIMAXWID ); max X DllStructSetData($tagMaxinfo, 10, GUIMAXHT ) ; max Y Return 0 EndFunc ;==>WM_GETMINMAXINFO If you want your controls to move as the window is resized then you need to look up GuiCtrlSetResizing. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
billthecreator Posted August 6, 2009 Author Share Posted August 6, 2009 AMAZING! Thank you so very much, that is exactly what i wanted. [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap Link to comment Share on other sites More sharing options...
smashly Posted September 17, 2009 Share Posted September 17, 2009 Another way I would recommend restricting your window size is with Global GUIMINWID = 300, GUIMINHT = 400;set your restrictions here Global GUIMAXWID = DesktopWidth, GUIMAXHT = DesktopHeight ; GUIRegisterMsg($WM_GETMINMAXINFO, "WM_GETMINMAXINFO") .. . . Func WM_GETMINMAXINFO($hwnd, $Msg, $wParam, $lParam) $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, $GUIMINWID) ; min X DllStructSetData($tagMaxinfo, 8, $GUIMINHT) ; min Y DllStructSetData($tagMaxinfo, 9, GUIMAXWID ); max X DllStructSetData($tagMaxinfo, 10, GUIMAXHT ) ; max Y Return 0 EndFunc ;==>WM_GETMINMAXINFO If you want your controls to move as the window is resized then you need to look up GuiCtrlSetResizing. Hi, thank you for the heads up Martin. Just found your post while searching the forum for a function to do exactly this Cheers 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