|
-
Feb 12th, 2000, 09:49 PM
#1
Thread Starter
Addicted Member
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.
------------------
-
Feb 12th, 2000, 10:48 PM
#2
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|