Solved

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

Posted on 2001-06-02
7
1,143 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
[X]
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
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

690 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