Get my system’s boot mode, or is my system booted in safe mode?

Use GetSystemMetrics( SM_CLEANBOOT ), here are some inline functions, you can understand what they do from their names… [sourcecode language=’cpp’]__inline BOOL IsNormalBoot() {     return ::GetSystemMetrics(SM_CLEANBOOT) == 0; } __inline BOOL IsSafeMode() {     return ::GetSystemMetrics(SM_CLEANBOOT) == 1; } __inline BOOL IsSafeModeWithNetworkBoot() {     return ::GetSystemMetrics(SM_CLEANBOOT) == 2; }[/sourcecode]
Continue reading…