Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detecting Safemode ??

Status
Not open for further replies.

QwertGold

Programmer
Jun 25, 2001
17
DK
Hi All
I'm writing an new shell for windows98 (a launcher for a computer cafe), does anyone know how I can detect if windows started in safemode using C/C++.

thanks in advance
Klaus Grønbæk
 
The GetSystemMetrics API Should provide this information. This is VB code, but translating to C/C++ should be straightforward

Public Declare Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long

Public Const SM_CLEANBOOT = 67

Select Case GetSystemMetrics(SM_CLEANBOOT)
Case 0 - Normal Boot
Case 1 - Fail-safe boot
Case 2 - Fail-safe with network boot
End Select
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top