How do you know your program is running in security mode?

zhaozj2021-02-11  215

Use Windows API GetSystemMetrics with sm_cleanboot parameter, this specifies how the system was started, in Your Project's code Use:

PROGRAM Project1;

Uses

Forms,

Windows,

Dialogs,

Unit1 in 'unit1.pas' {form1};

{$ R * .res}

Begin

Application.INITIALIZE;

Application.createform (TFORM1, FORM1);

Case getSystemMetrics (sm_cleanboot) of

1: Begin

ShowMessage ('Running in Safe Mode: Fail-Safe Boot');

Application.Terminate;

END;

2: Begin

ShowMessage ('Running in Safe Mode: Fail-Safe With Network Boot');

Application.Terminate;

END;

END;

Application.run;

End.

转载请注明原文地址:https://www.9cbs.com/read-5824.html

New Post(0)