public static IntPtr Alloc() { IntPtr console = SafeNativeMethods.GetConsoleWindow(); if (console == IntPtr.Zero) { SafeNativeMethods.AllocConsole(); DisbleQuickEditMode(); console = SafeNativeMethods.GetConsoleWindow(); SafeNativeMethods.ShowWindow(console, 0); } return(console); }