#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Local $Form1 = GUICreate("Form1", 623, 442, 192, 150,BitOR($WS_POPUP,$WS_CLIPSIBLINGS,$WS_SYSMENU))
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
Local $Button1 = GUICtrlCreateButton('最小化', 623-75*3, 0, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
Local $Button2 = GUICtrlCreateButton('最大化', 623-75*2, 0, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
Local $Button3 = GUICtrlCreateButton('关闭', 623-75, 0, 75, 25)
GUICtrlSetOnEvent(-1, "Button1Click")
GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
Func Button1Click()
Switch @GUI_CtrlId
Case $Button1
WinSetState($Form1,'',@SW_MINIMIZE)
Case $Button2
$State=WinGetState($Form1)
If $State=15 Then
WinSetState($Form1,'',@SW_MAXIMIZE)
Else
WinSetState($Form1,'',@SW_RESTORE)
EndIf
Case $Button3
Exit
EndSwitch
EndFunc
Func Form1Close()
Exit
EndFunc
|