获取托盘菜单或项目的文本.
TrayItemGetText ( 控件ID )
控件ID | 由 a TrayCreateItem 或 TrayCreateMenu 函数返回的控件标识符. |
成功: | 返回 1. |
失败: | 返回 0. |
#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, "状态", TrayItemGetText($aboutitem))
Case $msg = $aboutitem
MsgBox(64, "关于:","AutoIt3-托盘菜单示例")
Case $msg = $exititem
ExitLoop
EndSelect
WEnd
Exit
provider with jb51.net (unicode) |