mira lo facil que es...
Código vb:
Ver originalOption Explicit
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private vTiempoActual As String
Private Sub Form_Load()
vTiempoActual = TiempoEncendidaPC
With Timer1
.Enabled = True
.Interval = 1000
End With
End Sub
Private Function TiempoEncendidaPC() As String
Dim vHoras As Long, vMinutos As Long, vSegundos As Long
vHoras = Int(GetTickCount / 1000 / 60 / 60)
vMinutos = Int((GetTickCount / 1000 / 60)) - vHoras * 60
vSegundos = Int((GetTickCount / 1000)) - vMinutos * 60 - vHoras * 3600
TiempoEncendidaPC = Format(vHoras, "00") & ":" & Format(vMinutos, "00") & ":" & Format(vSegundos, "00")
End Function
Private Sub Timer1_Timer()
Me.Caption = Format(CDate(vTiempoActual) + CDate("00:00:01"), "Hh:mm:ss")
vTiempoActual = Me.Caption
End Sub
sin llamar a la funcion con el
Timer...
saludos.