|
发表于 2010-2-7 12:04:02
|
显示全部楼层
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Global $Flg=1
HotKeySet("{F10}","ChangeFlg") ;F10 改变标志位。达到控制窗体显示还是隐藏的效果
HotKeySet("{F11}","FORM1CLOSE") ; F11退出。
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 254, 295, 192, 114)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
#EndRegion ### END Koda GUI section ###
While 1
If $Flg=1 Then
GUISetState(@SW_SHOW) ;窗体显示
ToolTip("The windows is showing now.",254,295)
Else
GUISetState(@SW_HIDE) ;窗体隐藏
ToolTip("The windows is hiding now.",254,295)
EndIf
Sleep(100)
WEnd
Func Form1Close() ;
Exit
EndFunc
Func ChangeFlg() ;关键函数。控制显示还是隐藏
$Flg= Not $Flg
EndFunc |
|