Is it possible to detect whether Windows is running in "Normal" mode or Safe Mode from within your VB app? Thanks.
Printable View
Is it possible to detect whether Windows is running in "Normal" mode or Safe Mode from within your VB app? Thanks.
Sure is. Try this:
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Private Const SM_CLEANBOOT = 67
Select Case GetSystemMetrics(SM_CLEANBOOT)
Case 0: MsgBox "Normal boot"
Case 1: MsgBox "Safe Mode"
Case 2: MsgBox "Safe Mode with network boot"
End Select
Great stuff! Thanks!
Does that work for all OS's? I can only try it on Windows 98 and Me.
As far as I know it does. If you run into something in which it doesn't work, let me know.
Okay, thanks!