[已解决]怎么实现双击托盘图标显示窗体
本帖最后由 xyyie 于 2010-11-11 11:38 编辑$traymsg = TrayGetMsg()
Switch $traymsg
Case $TRAY_EVENT_PRIMARYDOUBLE
MsgBox(0,"","111")
EndSwitch
这一句
Case $TRAY_EVENT_PRIMARYDOUBLE
MsgBox(0,"","111")
老报错啊。好像不行啊。 $traymsg = TrayGetMsg()
Switch $traymsg
Case -13
MsgBox(0,"","111")
EndSwitch
点
#include <Constants.au3>#NoTrayIcon
Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1) ;默认菜单项目 (脚本暂停中/退出) 将不会显示.
TraySetOnEvent($TRAY_EVENT_PRIMARYDOUBLE,"SpecialEvent")
TraySetOnEvent($TRAY_EVENT_SECONDARYUP,"SpecialEvent")
TraySetState()
While 1
Sleep(10) ; 空闲循环
WEnd
Exit
; Functions
Func SpecialEvent()
Select
Case @TRAY_ID = $TRAY_EVENT_PRIMARYDOUBLE
Msgbox(64,"SpecialEvent-Info","主鼠标键双击.")
ExitEvent()
Case @TRAY_ID = $TRAY_EVENT_SECONDARYUP
Msgbox(64,"SpecialEvent-Info","次鼠标键双击.")
ExitEvent()
EndSelect
EndFunc
; Functions
Func ExitEvent()
Exit
EndFunc
从AU3的帮助中复制出来的,希望对楼主有点帮助。 谢谢 超级版主
6678720 回复 4# xyyie
请修改标题错别字“以”,不然都会移到无意义区
页:
[1]