#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 784, 452, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP))
GUISetOnEvent($GUI_EVENT_CLOSE, "_MainSwitch")
$Group1 = GUICtrlCreateGroup("Test", 10, 10, 520, 150)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT)
$Input1 = GUICtrlCreateInput("Input1", 96, 49, 330, 21)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKTOP + $GUI_DOCKHEIGHT)
$Label1 = GUICtrlCreateLabel("Label1", 48, 49, 36, 17)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
$Button1 = GUICtrlCreateButton("Button1", 438, 49, 75, 25)
GUICtrlSetResizing(-1, $GUI_DOCKRIGHT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("Group2", 540, 10, 235, 150)
GUICtrlSetResizing(-1, $GUI_DOCKRIGHT + $GUI_DOCKTOP + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
GUIRegisterMsg(0x24, "WM_GETMINMAXINFO") ; 限制窗口的大小
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func _MainSwitch()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
GUIDelete($Form1)
Exit
EndSwitch
EndFunc ;==>_MainSwitch
; 限制窗口的大小
Func WM_GETMINMAXINFO($MsgBox, $Msg, $wParam, $lparam)
Local $tBuffer = DllStructCreate("int;int;int;int;int;int;int;int;int;int", $lparam)
DllStructSetData($tBuffer, 7, 600);限制窗口的最小宽度
DllStructSetData($tBuffer, 8, 250);限制窗口的最小高度
;DllStructSetData($tBuffer, 9, 1024);限制窗口的最大宽度
;DllStructSetData($tBuffer, 10, 768);限制窗口的最大宽度
Return "GUI_RUNDEFMSG"
EndFunc ;==>WM_GETMINMAXINFO