벤자민의 블로그 2기 시작
2023년 6월 13일 갑작스러운 부친상을 격고나서 무언가를 한다라는 것에서 거의 손을 대지 않고 있었네요. 슬프다거나 그런 감정보다는 그냥 무언가 빠져버린
윈도우즈의 세이프모드 상황을 어떻게 감지합니까?
Windows API GetSystemMetrics 의 SM_CLEANBOOT 값을 사용
How to know if your application is running in SafeMode
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('안전모드에서 실행중입니다.');
Application.Terminate;
end;
2: begin
ShowMessage('네트워크 안전모드에서 실행중입니다.');
Application.Terminate;
end;
end;
Application.Run;
end.
https://support.corel.com/hc/en-us/articles/216416497-How-to-perform-an-installation-in-Safe-Mode