unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Hide: TButton;
Show: TButton;
procedure HideClick(Sender: TObject);
procedure ShowClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function RegisterServiceProcess(dwProcessID,dwType : DWORD) :
DWORD;
stdcall;
external 'KERNEL32.DLL';
implementation
{$R *.DFM}
procedure TForm1.HideClick(Sender: TObject);
begin
RegisterServiceProcess(GetCurrentProcessID, 1);
end;
procedure TForm1.ShowClick(Sender: TObject);
begin
RegisterServiceProcess(GetCurrentProcessID, 0);
end;
end.