回复 6# caocaofff #NoTrayIcon
#Region
#EndRegion
#include <Constants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <IE.au3>
#include <Debug.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 300, 125, -1, -1)
Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode", 3)
TrayCreateItem("关于")
TraySetOnEvent (-1, "_about" )
TrayCreateItem("退出")
TraySetOnEvent (-1, "_Exit" )
TraySetState()
TraySetClick(8)
Global $trayMsg
GUISetState(@SW_SHOW)
TraySetOnEvent ($TRAY_EVENT_PRIMARYUP, "_show_win" )
While 1
$nMsg = GUIGetMsg()
$trayMsg = TrayGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $GUI_EVENT_MINIMIZE
GUISetState(@SW_HIDE, $Form1)
EndSwitch
WEnd
Exit
Func _show_win()
GUISetState(@SW_SHOW,$Form1) ;显示窗口
EndFunc
Func _about()
MsgBox(64, "关于", "about")
EndFunc
Func _Exit()
Exit
EndFunc
这样就OK了 |