Hi everyone ![:)]()
I have a gui than can be expanded/collapsed (not sure if are the proper words) by the click of a button, the problem is lock the height when collapsed, and unlock it to be resized by winmove function and letting the GUI unlocked to be resized
(sorry, I cannot paste the code tidy up, even I use autoit code inputbox it stays like this, although in the inputbox is tidy)
I have no ideia how can it be done
(Felling dumb)
EDIT: Updated the if inside _WM_GETMINMAXINFO()
![:)](http://aut1.autoit-cdn.com/forum/public/style_emoticons/default/smile.png)
I have a gui than can be expanded/collapsed (not sure if are the proper words) by the click of a button, the problem is lock the height when collapsed, and unlock it to be resized by winmove function and letting the GUI unlocked to be resized
(sorry, I cannot paste the code tidy up, even I use autoit code inputbox it stays like this, although in the inputbox is tidy)
[ autoit ]
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 304, 63,-1,-1,BitOR($GUI_SS_DEFAULT_GUI,$WS_SIZEBOX)) Global $flag = 0, $expand = 1 GUIRegisterMsg($WM_GETMINMAXINFO, "_WM_GETMINMAXINFO") ; Monitors resizing of the GUI $Button1 = GUICtrlCreateButton("Toggle", 110, 16, 83, 25) GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Local $pos = WinGetPos($Form1) If $expand = 1 Then WinMove($Form1,'',$pos[0],$pos[1], $pos[2], 300,1) $expand = 0 Else WinMove($Form1,"",$pos[0],$pos[1], $pos[2], 63+35,1) $expand = 1 EndIf EndSwitch WEnd Func _WM_GETMINMAXINFO($hWnd, $msg, $wParam, $lParam) ; used to limit the minimum size of the GUI #forceref $hWnd, $Msg, $wParam, $lParam Local $iWidth = 304 + 16 ; minimum width setting Local $iHeight = 63 + 38 ; minimum height setting ;ConsoleWrite($lParam&@LF) If $hWnd = $Form1 Then Local $tagMaxinfo = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lParam) DllStructSetData($tagMaxinfo, 7, $iWidth) ; min width DllStructSetData($tagMaxinfo, 8, $iHeight) ; min height DllStructSetData($tagMaxinfo, 9, 99999) ; max width If $expand Then DllStructSetData($tagMaxinfo, 10, $iHeight) ; max height Else DllStructSetData($tagMaxinfo, 10, 99999) ; max height EndIf Return $GUI_RUNDEFMSG EndIf EndFunc ;==>_WM_GETMINMAXINFO
I have no ideia how can it be done
![:](http://aut1.autoit-cdn.com/forum/public/style_emoticons/default/crying.gif)
EDIT: Updated the if inside _WM_GETMINMAXINFO()