设置托盘图标状态.
TraySetState ( [标志] )
标志 | [可选参数] 由以下值组合: 1 = 显示托盘图标 (默认) 2 = 销毁/隐藏托盘图标 4 = 闪烁托盘图标 8 = 停止托盘图标闪烁 16 = 重置图标为默认值 (不闪烁, 默认提示文本) |
#NoTrayIcon
Opt("TrayMenuMode", 1) ;
不显示默认托盘菜单(脚本暂停/退出).
Local $exititem
= TrayCreateItem("退出")
TraySetIcon("warning")
TraySetToolTip("SOS")
TraySetState()
; 显示托盘图标
Local $toggle
= 0
While 1
Local
$msg = TrayGetMsg()
Select
Case $msg = 0
Sleep(1000)
If $toggle
= 0 Then
TraySetState() ; 显示托盘图标
$toggle = 1
Else
TraySetState(2)
; 隐藏托盘图标
$toggle = 0
EndIf
Case $msg = $exititem
ExitLoop
EndSelect
WEnd
Exit
provider with jb51.net (unicode) |