Solved

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

Posted on 2001-06-02
7
1,139 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks 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…

776 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