Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi everyone,How to protect a process not be kill?
The application can only be close oneself, not through the task manager, etc.
Thank you all.
Posted
Comments
Sandeep Mewara 7-Oct-12 4:39am    
I doubt if we can do anything like this. But will wait for others to reply.

As per me, it would be a security issue if we have such thing. Think of a maleware/apps that can gather data from your system and cannot even be closed for taskmanager even if you found and try to.
Another example: Antivirus programs that run too can be closed via Task manager. They are the best candidates to be marked as not closeable from anywhere but program itself.
[no name] 7-Oct-12 6:57am    
There is absolutely no legitimate reason to do this.

This is certainly possible somehow. I suggest reading through these answers here:
http://stackoverflow.com/questions/187983/how-do-i-hide-a-process-in-task-manager-in-c[^]
I would suggest you to not implement this feature though - since this is not user friendly. One option that may be easy to implement is to have a windows service in the background that checks if your app is running and restarts it if required. Either way - please don't do this since it is an almost virus like behavior.
 
Share this answer
 
Comments
Prasad_Kulkarni 8-Oct-12 2:10am    
5'ed!
I agree completely with Sandeep.
In one word, you cannot provided the user has the privilege to terminate process.

Check the following link, you will find it interesting
http://blogs.msdn.com/b/oldnewthing/archive/2004/02/16/73780.aspx[^]

cheers
 
Share this answer
 
Comments
Prasad_Kulkarni 8-Oct-12 2:10am    
5'ed!
C#
Thanks for your help, in fact, I am achieving a management program that need to prevent unauthorized users to close the program, really not virus program. I don't like virus maker
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900