本帖最后由 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
|