namespace ConsoleApplication1 { using System; using System.Diagnostics; using System.Runtime.InteropServices; using System.Threading; internal class Class1 { private const int SW_MAXIMIZE = 3; private const int SW_MINIMIZE = 6; private const int SW_RESTORE = 9; [STAThread] private static void Maiin(string[] args) { IntPtr winHandle = Process.GetCurrentProcess().MainWindowHandle; ShowWindow(winHandle, 6); Thread.Sleep(0x7d0); ShowWindow(winHandle, 9); } [DllImport("user32.d ll")] private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); } }