public static void Free() { IntPtr console = SafeNativeMethods.GetConsoleWindow(); if (console != IntPtr.Zero) { SafeNativeMethods.FreeConsole(); } }