Minimize console application
[System.Runtime.InteropServices.DllImport("user32.dll")]
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
private const int SW_MINIMIZE = 6;
private const int SW_MAXIMIZE = 3;
private const int SW_RESTORE = 9;
[STAThread]
static void Main(string[] args)
{
IntPtr winHandle =
System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;
ShowWindow( winHandle, SW_MINIMIZE);
Console.WriteLine("I am testing the minimize console windows");
Console.Read();
//System.Threading.Thread.Sleep(2000);
//ShowWindow( winHandle, SW_RESTORE);
}
private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
private const int SW_MINIMIZE = 6;
private const int SW_MAXIMIZE = 3;
private const int SW_RESTORE = 9;
[STAThread]
static void Main(string[] args)
{
IntPtr winHandle =
System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle;
ShowWindow( winHandle, SW_MINIMIZE);
Console.WriteLine("I am testing the minimize console windows");
Console.Read();
//System.Threading.Thread.Sleep(2000);
//ShowWindow( winHandle, SW_RESTORE);
}