唉,真是不如信自己,解决了!
#NoTrayIcon
#Include <Constants.au3>
Opt("TrayMenuMode", 1)
Opt("trayOnEventMode", 1)
$g_szVersion = "Filler"
If WinExists($g_szVersion) Then Exit
AutoItWinSetTitle($g_szVersion)
$aboutitem = TrayCreateItem("关于")
TrayItemSetOnEvent($aboutitem, "TrayMsg")
TrayCreateItem("")
$exititem = TrayCreateItem("退出")
TrayItemSetOnEvent($exititem, "TrayMsg")
TraySetState()
While 1
If WinExists("请输入资料") And ProcessExists("Fill.exe") = 0 Then
RunWait(@ScriptDir&"\Fill.exe")
EndIf
Sleep(2000)
WEnd
Func TrayMsg()
Switch @TRAY_ID
Case $aboutitem
MsgBox(64, "关于程序", "我填!")
Case $exititem
Exit
EndSwitch
EndFunc
|