본문 바로가기

카테고리 없음

[시스템] 화면보호기가 설치되어 있는지 검사하기

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
Dummy: integer;
begin
  SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, @Dummy, 0);
  if Dummy = 1 then
    Showmessage('화면보호기가 설치되어 있습니다')
  else
    Showmessage('화면보호기가 설치되어있지 않습니다');
end;

end.