Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB4/32,VB5,VB6
Expertise: Intermediate
Mar 4, 2000

How did Windows start?

If you need to know how Windows was started you have just to call an API function: GetSystemMetrics. Passing the SM_CLEANBOOT constant as parameter, the function returns a Long value with this meaning:

0 = Normal boot
1 = Fail-safe boot
2 = Fail-safe with network boot

Here ia an example that shows how to call the function:


Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) _
    As Long
Public Const SM_CLEANBOOT = 67

Private Sub Command1_Click()
    Select Case GetSystemMetrics(SM_CLEANBOOT)
        Case 0: MsgBox "Normal boot"
        Case 1: MsgBox "Fail-safe boot"
        Case 2: MsgBox "Fail-safe with network boot"
    End Select
End Sub  

Marco Bellinaso
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date