How to hide C# application from taskmanager proces

2019-01-15 11:41发布

问题:

This question already has an answer here:

  • How do I hide a process in Task Manager in C#? 16 answers

I need to hide my C# application from process tab of Taskmanager

using

this.ShowInTaskbar = false; 

I have hide it from application tab. Now I need to hide it from process tab.

Is this possible?.

回答1:

You could inject a DLL into the svchost process, that would camouflage it from Task Manager but not from ProcessExplorer. Here's how:

How To Inject a Managed .NET Assembly (DLL) Into Another Process

Here's some more background info on this technique: Three Ways to Inject Your Code into Another Process

Similar to @Dark Slipstreams link it points unmanaged code info.

Let us know if you have any problems with the code running on Win7?

Edit:

how can i restrict a user while closing my process from taskmanager? - what exactly are you making here?

I dont care to guess but if you really want to know, you hook into the WinLogon, @Jeff Atwood explains it here: How to Clean Up a Windows Spyware Infestation or you could have 2 processes that both watch each other...



回答2:

Short answer: no.

Long answer: yes.

There is no simple way to hide a program from the Task Manager. This is seen as malicious by most up-to-date Anti-Virus software. You need to hook into the Task Manager, override the process list, remove your entry and display the process list.

If this is a must, then have a look at this link. This example works in XP. I am not sure if it works in Windows Vista and I'm positive it does not work in Windows 7. There is no way to hide a process in Windows 7 because of how it is designed. I am not sure why, but I know it cannot be done.



回答3:

If you are trying to prevent your 'standard' users from killing your process you may install your program as Windows Service, run it under special credentials (with non-expiring password in production), setup Automatic startup and allow only 'admins' to kill it.



回答4:

Depending on why you want to hide it and who you are hiding it from, you may get away with hiding it in plain sight by naming the application something like AdobeUpdater.exe