#include <GUIConstantsEx.au3>
#include <Constants.au3>
Opt("TrayOnEventMode", 1)
Opt("GUIOnEventMode", 1)
Opt("TrayMenuMode", 1)
$hgui = GUICreate("将程序在托盘中显示、隐藏托盘", 300, 200, -1, -1)
GUISetState(@SW_SHOW)
GUISetOnEvent($GUI_EVENT_CLOSE, "gui")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "gui")
TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE, "TrayEvent")
While 1
Sleep(100)
WEnd
Func TrayEvent()
Switch @TRAY_ID
Case $TRAY_EVENT_PRIMARYDOUBLE
GUISetState(@SW_SHOWNORMAL)
EndSwitch
EndFunc ;==>TrayEvent
Func gui()
Switch @GUI_CtrlId
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_MINIMIZE
GUISetState(@SW_HIDE)
EndSwitch
EndFunc ;==>gui
damoo 发表于 2014-4-12 09:47 http://www.autoitx.com/images/common/back.gif
谢谢,学习了。。。 学习中,谢谢 学习中,谢谢
页:
1
[2]