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