Results 1 to 2 of 2

Thread: Checking For Windows Startup

  1. #1

    Thread Starter
    Addicted Member Ramandeep's Avatar
    Join Date
    Feb 2000
    Posts
    158

    Post

    Can any one help me, I need to know if there is a way to check if windows (all versions) has just been started, I am working on a personal project and need a way to detect if windows has just been restarted or started.

    ------------------

  2. #2
    Addicted Member
    Join Date
    Feb 2000
    Posts
    224

    Post

    Use the API GetTickCount.This returns
    the number of milliseconds after the OS
    win95,98,NT started. Divide it by 1000 and you get in seconds. Make your judgement based
    on this. For example...

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


    Private Sub Form_Load()
    Dim lmiliSec As Long
    lmiliSec = GetTickCount()

    If (lmiliSec\60000) < 3 Then 'less than 3 minutes
    MsgBox "Just Started"
    Else
    MsgBox "started " & (lmiliSec\60000)& " minutes ago"
    End If
    End sub




    [This message has been edited by G.Kumaraguru (edited 02-13-2000).]

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