本帖最后由 tryhi 于 2011-4-27 20:08 编辑
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 623, 442, 192, 124)
GUISetState(@SW_SHOW)
Opt("TrayIconHide", 1)
Opt("TrayMenuMode",1)
Opt("TrayOnEventMode",1)
TraySetOnEvent($TRAY_EVENT_PRIMARYUP,"tray")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_MINIMIZE
GUISetState(@SW_HIDE, $Form1)
Opt("TrayIconHide", 0)
EndSwitch
WEnd
Func tray()
Opt("TrayIconHide", 1)
GUISetState(@SW_SHOW, $Form1)
WinActivate($Form1)
EndFunc
善用搜索 |