P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Oct 10th, 2003 08:09 AM Post subject: Determine Windows Startup Mode |
|
|
Add a label (Label1) to your form and add the following code :
| Code: | Option Explicit
Private Declare Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long
Private Const SM_CLEANBOOT = 67
Private Sub Form_Load()
Select Case GetSystemMetrics(SM_CLEANBOOT)
Case 1: Label1.Caption = "System started in Safe Mode."
Case 2: Label1.Caption = "System started in Safe Mode with network support."
Case Else: Label1.Caption = "Windows is running normally."
End Select
End Sub |
_________________ No one is completely useless. They can at least be an example of what to avoid. |
|