What Windows API call do I need in order to check whether the system booted in safe mode or normal mode?
While it's booting up, hold down the F8 key before the Windows logo appears. A menu will appear. You can then release the F8 key. Use the arrow keys to highlight Safe Mode (or Safe Mode with Networking if you need to use the Internet to solve your problem), then press Enter.
At the sign-in screen, hold the Shift key down while selecting Power > Restart. After the PC restarts to the Choose an option screen, select Troubleshoot > Advanced options > Startup Settings > Restart. After the PC restarts, a list of options is shown. Select 4 or F4 to start your PC in Safe Mode.
Press Windows + R button and type the word 'msconfig,' into the dialog box on the screen. Then, proceed with the Enter tab. Then, you need to select 'Secure Boot' under the Download section and go for one of the Safe Boot options as given below. Confirm with Apply> OK to restart the Windows in safe mode.
Call GetSystemMetrics( SM_CLEANBOOT )
and look for a nonzero value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With