본문 바로가기

카테고리 없음

[윈도우즈 API] CTRL+ALT+DEL 에 나타나지 않는 프로그램

// Task List (CTRL+ALT+DEL 를 눌렀을때 나타나는 리스트) 에 나타나지
// 않는 프로그램 만들기

unit Unit1;

interface

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

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

const
  RSP_SIMPLE_SERVICE     = 1;
  RSP_UNREGISTER_SERVICE = 0;

var
  Form1: TForm1;

implementation
{$R *.DFM}

function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer;
           stdcall; external 'KERNEL32.DLL';

procedure TForm1.Button1Click(Sender: TObject);
begin
  RegisterServiceProcess(GetCurrentProcessID, RSP_SIMPLE_SERVICE); // 감추기
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  RegisterServiceProcess(GetCurrentProcessID, RSP_UNREGISTER_SERVICE); // 보이기
end;

end.