Results 1 to 4 of 4

Thread: Find out how long windows has been running

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    9

    Question

    I found that:
    Declare Function GetTickCount& Lib "kernel32" ()

    Private Sub cmdWinRun_Click()
    MsgBox GetTickCount
    End Sub

    But what i want to do,is 3 textbox.

    1 testbox for the hours
    1 for min
    and 1 for sec.

    it is possible????


  2. #2
    Guest
    Just divide the result:

    Code:
    Private Declare Function GetTickCount Lib "kernel32" () As Long
    
    Private Sub Command1_Click()
    
        'Seconds
        Text1 = GetTickCount / 1000
        'Minutes
        Text2 = (GetTickCount / 1000) / 60
        'Hours
        Text3 = (GetTickCount / 10000 / 60) / 60
    
    End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2000
    Posts
    9
    thanks alot, i searching and trying so many thing..but i see your code and it was easy..good i suck sometime..

  4. #4
    Guest
    Sorry, I just found a mistake. Change this line:
    Text3 = (GetTickCount / 10000 / 60) / 60

    To this line:
    Text3 = (GetTickCount / 1000 / 60) / 60

    [Edited by Megatron on 08-08-2000 at 06:08 PM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width