找回密码
 加入
搜索
查看: 1902|回复: 0

[原创] 已开机时间显示

[复制链接]
发表于 2020-6-8 00:46:40 | 显示全部楼层 |阅读模式
本帖最后由 yohoboy 于 2020-6-8 00:48 编辑

写来这边存档,参考参考看看吧采用两种方式显示,看哪个适合用
#include <Date.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <WinAPIEx.au3>

Global $g_idMemo

Example()

Func Example()
    ; 创建 GUI
    GUICreate("已開機日期/时间示例", 400, 300)
    $g_idMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL)
    GUISetState(@SW_SHOW)

    ; 获取滴答计数
        $time_run = _Date_Time_GetTickCount()
        $time_run1 = int($time_run/1000/60/60/24)
        $time_run2 = int($time_run/1000/60/60)
        $time_run3 = $time_run/1000/60/60
        $time_run4 = int(($time_run3 - $time_run2)*60)
        $run_time = _WinAPI_StrFromTimeInterval(_WinAPI_GetTickCount())
    MemoWrite("原始毫秒數:" & $time_run & @CRLF & _
                                $time_run1 & "D" & _
                                $time_run2 & "H" & _
                                $time_run4 & "M" & @CRLF & _
                                $run_time)
    ; 循环到用户退出.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example

; 写脚本运行信息到备忘录
Func MemoWrite($sMessage)
    GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-4-27 23:08 , Processed in 0.068337 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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