找回密码
 加入
搜索
查看: 2733|回复: 5

[AU3基础] 想写个计算时间的工具[已解决]

  [复制链接]
发表于 2011-8-13 19:10:34 | 显示全部楼层 |阅读模式
本帖最后由 872777825 于 2011-8-13 22:24 编辑

小弟想写个小工具

就是一运行该工具就出现计算工具运行的时间 从0秒开始算  00:00这样

背景要透明

不知道哪位老师可以百忙中抽点时间指点下

谢谢
发表于 2011-8-13 20:34:40 | 显示全部楼层
看看帮助里的_TicksToTime 函数
发表于 2011-8-13 20:37:59 | 显示全部楼层
所以照猫画虎
#include <Date.au3>
GUICreate('', 300, 100)
GUICtrlCreateLabel('已运行:', 90, 70, 100, 15)
Dim $tl = GUICtrlCreateLabel('00:00', 140, 70, 150, 15)
GUISetState()
Dim $timer = TimerInit()
AdlibRegister('Timer', 500)
While 1
        Switch GUIGetMsg()
                Case -3
                        Exit
        EndSwitch
WEnd
Func Timer()
        Local $Secs, $Mins, $Hour, $Time, $ticks, $sTime
        $ticks = Int(TimerDiff($timer))
        _TicksToTime($ticks, $Hour, $Mins, $Secs)
        $Time = StringFormat('%02s分:%02s秒', $Mins, $Secs)
        If $sTime <> $Time Then GUICtrlSetData($tl, $Time)
        $sTime = $Time
EndFunc   ;==>Timer
 楼主| 发表于 2011-8-13 22:24:18 | 显示全部楼层
所以照猫画虎
lpxx 发表于 2011-8-13 20:37



    谢谢lpxx 老师   问题解决 了    谢谢
发表于 2011-8-14 12:51:13 | 显示全部楼层
很不错的例子
发表于 2015-1-22 22:53:48 | 显示全部楼层
很不错的例子,收藏了.
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-28 14:14 , Processed in 0.081871 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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