I have a console App, I want to hide it from Task Manager while running.
Asked
Active
Viewed 3,686 times
1 Answers
1
If you want to hide the Console App from App(s) list in Task Manager
Try this :
using System;
using System.Runtime.InteropServices;
namespace SampleConsoleTest
{
class Program
{
[DllImport("kernel32.dll")]
static extern IntPtr GetConsoleWindow();
[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
const int SW_HIDE = 0;
const int SW_SHOW = 5;
static void Main(string[] args)
{
var handle = GetConsoleWindow();
// Hide
ShowWindow(handle, SW_HIDE);
// Show
//ShowWindow(handle, SW_SHOW);
Console.ReadKey();
}
}
}
This does not show the app in App List, but is visible in process(s) list.
It's about hiding a process from Task Manager.
One of the common approach is injecting process into another : How to hide C# application from taskmanager processtab?
Here is a detailed answer on how you can achieve it : How do I hide a process in Task Manager in C#?

Community
- 1
- 1

Parimal Raj
- 20,189
- 9
- 73
- 110
-
it is not a process ! – Amir Hamdy Apr 09 '16 at 13:06
-
Every running program is a process... – jleach Apr 09 '16 at 13:08
-
@Amirdo u mean to hide the console application from App(s) list in task manager ? – Parimal Raj Apr 09 '16 at 13:20
-
@PaRiMaLRaJ : Yes, Thank you. – Amir Hamdy Apr 09 '16 at 15:21
-
@downvoter, pls chk updated answer! – Parimal Raj Apr 09 '16 at 17:07