unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, 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;
//声明windows标准动态链接调用。
function RegisterServiceProcess(dwProcessID,dwType
Word)
Word;stdcall;external 'KERNEL32.DLL';
var
Form1: TForm1;
implementation
{$R *.dfm}
//按Ctrl+Alt+Del时不出现
procedure TForm1.Button1Click(Sender: TObject);
begin
RegisterServiceProcess(GetCurrentProcessID,RSP_SIMPLE_SERVICE);
end;
//按Ctrl+Alt+Del时出现
procedure TForm1.Button2Click(Sender: TObject);
begin
RegisterServiceProcess(GetCurrentProcessID,RSP_UNERGISTER_SERVICE);
end;
end.