Search code examples
c#wpfwindowstaskmanagertask-management

How do we prevent closing the application from the Task Manager?


for Windows Application, How do we prevent closing the application from the Task Manager? How do we do this to the application we wrote, as the Nod32 Antivirus application does?

enter image description here


Solution

  • Anti-Virus software that is signed and have special contact with Microsoft are allowed to be part of ELAM/Protected processes.

    You can try to do the same by writing a kernel driver and deny everyone the right to open a handle with terminate rights on your process. This is however a bit ugly and should be avoided if possible.

    The sane solution is to write your "important" application as a Windows service, this will prevent normal users from stopping it.

    It will not stop administrator users but that is OK because untrusted users should not be administrators.