public static void MinimizeWindow(IntPtr handle) { if (handle != IntPtr.Zero) { User32Interop.ShowWindow(handle.ToInt32(), ShowWindowFlags.SW_MINIMIZE); } }