获取托盘菜单或项目的当前状态.
TrayItemGetState ( [控件ID] )
控件ID | [可选参数] 由 TrayCreateItem 或 TrayCreateMenu 函数返回的控件标识符. |
#NoTrayIcon
Opt("TrayMenuMode", 1) ;
不显示默认菜单(脚本暂停/退出).
Local $getitem
= TrayCreateItem("获取状态")
TrayCreateItem("")
Local $aboutitem
= TrayCreateItem("关于...")
TrayCreateItem("")
Local $exititem
= TrayCreateItem("退出")
TraySetState()
While 1
Local
$msg = TrayGetMsg()
Select
Case $msg = 0
ContinueLoop
Case $msg = $getitem
MsgBox(64, "状态", TrayItemGetState($aboutitem))
Case $msg = $aboutitem
MsgBox(64, "关于:","AutoIt3-托盘菜单示例")
Case $msg = $exititem
ExitLoop
EndSelect
WEnd
Exit
provider with jb51.net (unicode) |