Solved

Hiding a Proccess

Posted on 2004-03-26
6
208 Views
Last Modified: 2010-04-05
Dear Masters

I want to know that how i can hide a proccess in Windows XP in "Windows Task Manager" Window, also when the user terminates a proccess our program can detect it if or not.in other words is there an event when a proccess is being terminated, i have tested WM_DESTROY and WM_NCDESTROY, none of them work!!!

thank you in advance for your information
Sincirely Yours
Milad
0
Comment
Question by:miladyyy
  • 2
6 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 25 total points
ID: 10693906
It should hide it
procedure TForm1.FormCreate(Sender: TObject);
var
  h: HWND;
begin
  h := Application.Handle;
  SetWindowLong(h, GWL_EXSTYLE,GetWindowLong(h, GWL_EXSTYLE) or            WS_EX_TOOLWINDOW);
end;
0
 
LVL 17

Expert Comment

by:mokule
ID: 10693927
May be this helps something, but it is not fired when terminating from task manager.

In the main application Form
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  CanClose := (Application.MessageBox(PChar('Terminate?'),PChar('Decide'),MB_YESNO) = IDYES);
end;

0
 
LVL 14

Assisted Solution

by:DragonSlayer
DragonSlayer earned 25 total points
ID: 10697717
goto www.madshi.net and check out madshi's example on API hooking... it will show how to make it so that your process can't be terminated via TerminateProcess
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now