class
NativeMethods


{

public const int SW_ERASE = 4;


public const int SW_HIDE = 0;


public const int SW_INVALIDATE = 2;


public const int SW_MAX = 10;


public const int SW_MAXIMIZE = 3;


public const int SW_MINIMIZE = 6;


public const int SW_NORMAL = 1;


public const int SW_RESTORE = 9;


public const int SW_SCROLLCHILDREN = 1;


public const int SW_SHOW = 5;


public const int SW_SHOWMAXIMIZED = 3;


public const int SW_SHOWMINIMIZED = 2;


public const int SW_SHOWMINNOACTIVE = 7;


public const int SW_SHOWNA = 8;


public const int SW_SHOWNOACTIVATE = 4;


public const int SW_SMOOTHSCROLL = 0x10;

}

classProgram


{

[

DllImport("user32.dll")]


private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);


[
DllImport("user32.dll")]


private static extern IntPtr FindWindow(string className, string text);


static void Main(string[] args)


{

Thread.Sleep(1000);

ShowWindow(FindWindow(
null, Console.Title), NativeMethods.SW_HIDE);


Thread.Sleep(5000);


ShowWindow(FindWindow(
null, Console.Title), NativeMethods.SW_SHOW);


Console.ReadKey();


}
}