本帖最后由 forestchi 于 2011-7-6 11:22 编辑 #NoTrayIcon
Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.
Global $nMsg ;全局变量
TraySetClick(16) ; Only secondary mouse button will show the tray menu.
$infoitem = TrayCreateItem("Info")
$nMsg="新值"
TrayItemSetOnEvent(-1,"ShowInfo")
TrayCreateItem("")
$exititem = TrayCreateItem("Exit")
TrayItemSetOnEvent(-1,"ExitScript")
TraySetState()
While 1
Sleep(10) ; Idle loop
WEnd
Exit
; Functions
Func ShowInfo()
;Msgbox(0,"Info","Tray OnEvent Demo")
MsgBox(0,"",$nMsg)
EndFunc
Func ExitScript()
Exit
EndFunc
|