怎樣知道你的程式是執行在安全模式呢? (轉)

worldblog發表於2007-12-09
怎樣知道你的程式是執行在安全模式呢? (轉)[@more@]Use 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.Tenate;
  end;
 2: begin
  ShowMessage('Running in Safe Mode: Fail-safe withwork boot');
  Application.Terminate;
  end;
 end;

  Application.Run;
end.


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752043/viewspace-990361/,如需轉載,請註明出處,否則將追究法律責任。

相關文章