利用Api函数计算Windows从启动后所运行的总时间

2008-02-23 06:58:14来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

Private Declare Function GetTickCount Lib "kernel32" () As Long

Private Sub Timer1_Timer()
Dim hour As Integer
Dim minute As Integer
Dim second As Integer
hour = GetTickCount \ 1000 \ 60 \ 60
Label1.Caption = Str(hour) "小时"

minute = (GetTickCount - hour * 60 * 60 * 1000) \ 1000 \ 60
Label2.Caption = Str(minute) "分钟"

second = (GetTickCount - Val(Label1.Caption) * 60 * 60 * 1000 - Val(Label2.Caption) * 60 * 1000) \ 1000
Label3.Caption = Str(second) "秒钟"
End Sub

上一篇: 功能强大的SendMessage函数
下一篇: VB的显示/隐藏Start按钮

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:关于Visual Basic 6.0类开发

下一篇:用VB编写Windows CGI应用程序