[C++] 纯文本查看 复制代码
;~ #include <bug.au3>
#include <Date.au3>
Global $Sec, $Min, $Hour, $Time1, $Time2, $Time
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:\users\倪沁东\desktop\form1.kxf
$Form1_1 = GUICreate("计算秒差", 344, 194, 192, 124)
$Input1 = GUICtrlCreateInput("18", 112, 48, 41, 21)
$Input2 = GUICtrlCreateInput("53", 184, 48, 41, 21)
$Input3 = GUICtrlCreateInput("20", 248, 48, 41, 21)
$Input4 = GUICtrlCreateInput("18", 112, 96, 41, 21)
$Input5 = GUICtrlCreateInput("54", 184, 96, 41, 21)
$Input6 = GUICtrlCreateInput("00", 248, 96, 41, 21)
$Input7 = GUICtrlCreateInput("", 112, 136, 89, 21)
$Label1 = GUICtrlCreateLabel("秒", 224, 138, 16, 17)
$Label2 = GUICtrlCreateLabel("时", 159, 51, 16, 17)
$Label3 = GUICtrlCreateLabel("分", 230, 52, 16, 17)
$Label4 = GUICtrlCreateLabel("秒", 296, 51, 16, 17)
$Label5 = GUICtrlCreateLabel("秒", 296, 100, 16, 17)
$Label6 = GUICtrlCreateLabel("分", 230, 98, 16, 17)
$Label7 = GUICtrlCreateLabel("时", 159, 100, 16, 17)
$Label8 = GUICtrlCreateLabel("开始时间:", 27, 51, 64, 17)
$Label9 = GUICtrlCreateLabel("结束时间:", 27, 96, 64, 17)
$Label10 = GUICtrlCreateLabel("历时:", 50, 136, 40, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case Else
main()
EndSwitch
WEnd
Func main()
$Hour = GUICtrlRead($Input1)
$Min = GUICtrlRead($Input2)
$Sec = GUICtrlRead($Input3)
$Time1 = _TimeToTicks($Hour, $Min, $Sec)
$Hour = GUICtrlRead($Input4)
$Min = GUICtrlRead($Input5)
$Sec = GUICtrlRead($Input6)
$Time2 = _TimeToTicks($Hour, $Min, $Sec)
$Time = ($Time2 - $Time1) / 1000
GUICtrlSetData($Input7, $Time)
EndFunc ;==>main