Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to prevent a Process from being killed in task list?

Posted on 2001-06-02
7
1,140 Views
Last Modified: 2012-05-04
in 98 I can  hide the process
be in NT/2000,it seemed not so easy

how can I prevent my soft to be closed in NT/2000?
0
Comment
Question by:keron
7 Comments
 
LVL 2

Accepted Solution

by:
danysz earned 100 total points
ID: 6149963
u can make it as a service and give authorization just to a specific user to kill it ....

daniel
0
 
LVL 1

Expert Comment

by:edsteele
ID: 6161455
Did you try using the OnClose event in your main form?  You should be able to write something like:

procedure TForm1.Form1Close(Sender: TObject, var Action: TCloseAction);
begin
  Action := caNone;
end;

You may want to put some logic around that, so when you really do want the program to close, it will. :)
0
 

Expert Comment

by:Micke_Holm
ID: 6163079
I'd have to go with danysz idea...

OnClose will not even be called if you choose your apps-process in the processlist in the Task Manager and click End Process.

This way of shutting down the process is using the Windows API TerminateProcess and it just pull the plug on your process. The process that are beeing killed doesn't have a chance to do any cleaning up or even to respond.

The only way to stop some one from killing your process is to make it a service and give authorization to a specific user to end it... Perhaps you could authorize only the SYSTEM accout to kill the service...

//Mikael
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 2

Expert Comment

by:danysz
ID: 6163405
hi mikael

thanks

yes u can do it..
but the best think is to make it available just for specific user even not for SYSTEM if u want t have it real protected. in this case u just have to add him a function to catch shut down of windows to shut down yourself...
also to be sure that the message is not faked ( send from somebody just to your application ) u shall make your service to wake before some critical services and also check that other critical services are depending on you and they are going down too...

also u can take for example service like browser that is looking for server and to put your service between ....
browser is looking for you and your are starting only after server ....

daniel
0
 
LVL 1

Expert Comment

by:edsteele
ID: 6165129
I wasn't sure if that would work from a Task Manager kill or not.  Thanks for the info!
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 8891045
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Please accept danysz's comment as answer.

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Robert Marquardt
EE Cleanup Volunteer
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

829 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