DelphiFAQ Home Search:

Hide a process in the 'kill task menu'

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

Q: How can I hide my application in the Ctrl+Alt+Del menu?

A: You need to use RegisterServiceProcess, which has to be imported from the kernel.
See the following example:

unit Unit1;

Interface

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

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

var
  Form1 : TForm1;

implementation

{$R *.DFM}

const
  RSPSIMPLESERVICE     = 1;
  RSPUNREGISTERSERVICE = 0;

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

procedure TForm1.FormDestroy (Sender: TObject); 
begin 
  RegisterServiceProcess (GetCurrentProcessID, RSPUNREGISTERSERVICE)
end; 


procedure TForm1.FormCreate (Sender: TObject); 
begin 
  RegisterServiceProcess (GetCurrentProcessID, RSPSIMPLESERVICE)
end; 


end.

Comments:

2007-02-14, 05:42:01
anonymous from United Kingdom  
What legitimate reason do you have for wanting to do this? Are you trying to hide a trojan?
2007-03-01, 10:18:46
anonymous from United Kingdom  
I need to do this to stop another process from detecting my one and killing it with this, that will not be a problem

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: