找回密码
 加入
搜索
查看: 2389|回复: 3

[系统综合] AdlibRegister注册的函数为什么被阻断。。。。

[复制链接]
发表于 2014-2-9 16:18:56 | 显示全部楼层 |阅读模式
本帖最后由 dreamscd 于 2014-2-9 16:20 编辑

这个要显示时间,直接用F2调用没有问题,但是用F1调用就有问题,AdlibRegister("Status_time", 1000)的调用被阻断了,要关闭记事本才能更新时间,而且用F3调用去掉第58行代码也没有问题,这是为什么?????
#RequireAdmin
#include <StaticConstants.au3>

Opt("TrayIconDebug", 1)

HotKeySet("{F1}", "f1")
HotKeySet("{F2}", "txt")
HotKeySet("{F3}", "f3")



Local $time = 10;时间多少秒
Local $step = 100 / $time;步进
Local $scd = 0;显示时间多少秒
Local $wait = 0;进度条。。。。

$Form1 = GUICreate("欢迎使用", @DesktopWidth / 2, @DesktopHeight / 2, -1, -1)
$Label1 = GUICtrlCreateLabel("Loading........", 0, 50, @DesktopWidth / 2, 44, $SS_SUNKEN + $SS_CENTER + $SS_CENTERIMAGE)
GUICtrlSetFont(-1, 30)
GUICtrlCreateGroup("", 0, @DesktopHeight * 0.93 - 9, @DesktopWidth, 25)
$Progress1 = GUICtrlCreateProgress(0, 120, @DesktopWidth / 2, 40)
GUISetState(@SW_SHOW)
AdlibRegister("Status_time", 1000)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case -3
                        ExitLoop
        EndSwitch
WEnd

Func f1()
        djs_new("3")
EndFunc   ;==>f1


Func f3()
        djs_new("3")
        While 1
                If $wait = 101 Then
                        txt()
                        ExitLoop
                EndIf
        WEnd
EndFunc   ;==>f3


Func djs()
        If Mod($wait, $step) = 0 Then
                $scd -= 1
        EndIf
        $wait = $wait + 1
        GUICtrlSetData($Progress1, $wait)
        ToolTip($scd & $wait, 0, 1, "", 1, 1)
        If $wait = 101 Then
                AdlibUnRegister("djs")
                txt()
        EndIf
EndFunc   ;==>djs


Func djs_new($a)
        $time = $a
        $step = 100 / $a
        $wait = 0
        $scd = $time
        AdlibRegister("djs", $time * 10)
EndFunc   ;==>djs_new


Func txt()
        $not = RunWait("Notepad.exe")
EndFunc   ;==>txt


Func Status_time()

        ToolTip($scd & $wait & "]" & @HOUR & ':' & @MIN & ':' & @SEC & @CRLF & @YEAR & '/' & @MON & '/' & @MDAY, 0, 1, "", 1, 1)
        GUICtrlSetData($Label1, @HOUR & ':' & @MIN & ':' & @SEC & @CRLF & @YEAR & '/' & @MON & '/' & @MDAY)

EndFunc   ;==>Status_time
发表于 2014-2-9 17:58:11 | 显示全部楼层
73行
RUNWAIT...
 楼主| 发表于 2014-2-9 21:31:35 | 显示全部楼层
runwait是没有影响的,这个在F2的调用中可以看到,而且我也换过RUN命令,但结果一个,F2,F3都OK,F1不行。。。。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-6 02:21 , Processed in 0.079186 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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