找回密码
 加入
搜索
查看: 1810|回复: 2

[AU3基础] 系统托盘菜单无效

[复制链接]
发表于 2013-10-31 11:44:06 | 显示全部楼层 |阅读模式
#NoTrayIcon
;~ #include <Process.au3> 
#include <Constants.au3> ; 默认菜单项目 (脚本暂停中/退出)(Script Paused/Exit) 将不会显示,并且所选项目不能被选中(checkbox不会打勾) . 请参考TrayMenuMode选项1和2(3=1+2).
Opt("TrayMenuMode", 3)
dim $Serverip 
$Serverip = iniread(@ScriptDir & "\intools.ini","配置文件","服务器IP","56.16.26.240") 

_Main()
Exit

Func _main()
        Local $st_time = IniRead(@ScriptDir & "\intools.ini","配置时间","启动等待时间","60000")
        Local $re_time = IniRead(@ScriptDir & "\intools.ini","配置时间","重启时间","20000")
        Local $t = ($st_time/1000)
        TrayCreateItem("关于")
        TrayItemSetOnEvent(-1, "about")
        TrayCreateItem("") ; 创建一个分割条.
        TrayCreateItem("退出")
        TrayItemSetOnEvent(-1, "_exit")
        TraySetState(1) ; 显示托盘菜单.
        TrayTip("", $t & "秒后检测网络连接",3)
        Sleep($st_time)
If Ping($Serverip) Then 
     TrayTip("","网络已正常连接",2)
         Sleep(2000)
Else
        TrayTip("","网络连接不正常",2)
        Sleep($re_time)
                                                                 
EndIf
EndFunc

Func About()
        MsgBox(4096, "", "版本: V 1.0.0.7"& @CRLF & _
                                                "作者: 大蒜")
EndFunc

Func _exit()
        Exit
EndFunc
        
发表于 2013-10-31 15:45:24 | 显示全部楼层
前面插一行
Opt('TrayOnEventMode', 1)
 楼主| 发表于 2013-11-4 16:42:36 | 显示全部楼层
回复 2# afan


    谢谢,没看到
还以为写了呢
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-17 17:44 , Processed in 0.077036 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表