1) Create the Console application in C# dotnet
2) Now in the static void Main(string[] args) function put the below line
//give the title of running application
Console.Title = “TestHideApplication”;
//put your console window caption here
IntPtr hWnd = FindWindow(null, ” TestHideApplication “);
if (hWnd != IntPtr.Zero)
{
//Hide the window
ShowWindow(hWnd, 0); // 0 = SW_HIDE
}
3) in the global declation put the below code
//add namespace using System.Runtime.InteropServices;
[DllImport(“user32.dll”)]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
[DllImport(“user32.dll”)]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
Thanks
Leave a Reply