Board index » delphi » Hide my app from the windows nt Task Manager

Hide my app from the windows nt Task Manager

I have a program that needs to run all the time, uploading data, getting
updates and such...  One of the users keeps shutting it down.  I have asked
him not to do this as the update end up getting downloaded from the server
in a group and then my program crashed, but he pays not attention.

I tried to make it so it couldn't be closed and he went into the Task
Manager and closed it.

What I want to do, is make it so if he clicks the close button the software
goes into stealth and hide from the Task Manager.  Is the a way to do this?
Could someone please give me the code...

 

Re:Hide my app from the windows nt Task Manager


"Caroline Clark" <news-replies-o...@please.com> schreef in bericht
news:SA%Y8.135$7p1.6313@news1.telusplanet.net...
Quote
> I tried to make it so it couldn't be closed and he went into the Task
> Manager and closed it.

> What I want to do, is make it so if he clicks the close button the
software
> goes into stealth and hide from the Task Manager.  Is the a way to do

this?

You have 3 options (maybe more):

1) Dont display in the ctrl-alt-del box: Projects source code (View->Project
manager->rightclick the exe program->view source:

Application.Initialize;
Application.Title := ''; // <- add this line
Application.CreateForm(TForm1, Form1);

3) If that doesn't work, run your app as a service:

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

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

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

2) Disable ctrl+alt+del alltogether (if you are desparate)

procedure TForm1.FormActivate(Sender: TObject);
var OldVal : longint;
begin
SystemParametersInfo(97, Word (True), @OldVal, 0);
end;
// on again:
// SystemParametersInfo (97, Word (False), @OldVal, 0);

Good luck,
Louis

Other Threads