找回密码
 加入
搜索
查看: 1675|回复: 1

[AU3基础] 如何让任务栏图标变化的更快一些呢

[复制链接]
发表于 2012-2-5 14:16:35 | 显示全部楼层 |阅读模式
#NoTrayIcon

Opt("TrayMenuMode",1)   ; 默认菜单项目 (脚本暂停中/退出)(Script Paused/Exit) 将不会显示.

$exititem       = TrayCreateItem("Exit")

TraySetState()

$start = 0
While 1
    $msg = TrayGetMsg()
    If $msg = $exititem Then ExitLoop
    $diff = TimerDiff($start)
    If $diff > 1000 Then
        $num = -Random(0,100,1) ; 负的随机数
        ToolTip("#icon=" & $num)
        TraySetIcon("Shell32.dll",$num)
        $start = TimerInit()
    EndIF
WEnd

Exit

变的太慢了,怎么才能变化的快一些呢?
发表于 2012-2-5 14:18:48 | 显示全部楼层
本帖最后由 半芯竹 于 2012-2-5 14:31 编辑

回复 1# sex123


    你又重开一贴来问这问题了。。哎。。。我无语了,行了吧。。
#NoTrayIcon
Local $i
HotKeySet("{esc}","_Exit")
Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode",1)        ; 默认菜单项目 (脚本暂停中/退出)(Script Paused/Exit) 将不会显示. 
Local $exititem = TrayCreateItem("退出")
TrayItemSetOnEvent($exititem, "_Exit" ) 
TraySetIcon("Shell32.dll", 10)
TraySetToolTip("SOS")
TraySetState()        ; 显示托盘图标
TraySetState (4);让托盘图标闪烁
While 1
       Sleep(500)
           $i+=1
If  $i > 10 Then 
TraySetIcon();还原默认图标
TraySetState (8);让托盘图标停止闪烁
EndIf
WEnd
Func _Exit()
        Exit
        EndFunc
把循环部份sleep 减小一点,就可以更快了。。。哎。。什么人嘛
#NoTrayIcon
Local $i
HotKeySet("{esc}","_Exit")
Opt("TrayOnEventMode", 1)
Opt("TrayMenuMode",1)        ; 默认菜单项目 (脚本暂停中/退出)(Script Paused/Exit) 将不会显示. 
Local $exititem = TrayCreateItem("退出")
TrayItemSetOnEvent($exititem, "_Exit" ) 
TraySetIcon("Shell32.dll", 10)
TraySetToolTip("SOS")
TraySetState()        ; 显示托盘图标
TraySetState (4);让托盘图标闪烁
For $i=1 To 20
        TraySetIcon("Shell32.dll", $i)
        Sleep(100)
Next
While 1
Sleep(1000)
WEnd
Func _Exit()
        Exit
 EndFunc
像FOR循环里那么快,行了么??
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-20 19:49 , Processed in 0.075102 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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