Is it possible to launch a windows desktop application written in .net to run impersonated to SYSTEM account on windows user logon?
Main purpose in this question is to prevent user from killing my desktop application and I could not find a certain solution for this on web.
I wonder how anti-virus applications are doing this because currently I am working on an open source data leak prevention tool MyDLP for windows end-points.
Any idea will be greatly appreciated.
No, there is no way to prevent an user from stopping an application running in his session. And no serious, legitimate, application would ever even remotely consider overriding the user actions and refusing to shut down.
Since what you describe as an ‘application running as SYSTEM on user logon’ does not exists, the nearest equivalent is a service. There is no way for an application running as a service to interact with the session (there used to be a way, but Vista has very explicitly forbid this).
Applications that need to run continuously must deploy two components, a service part that performs the work, and an interactive, separate, application that runs in the user session and interacts with the service via IPC.