public static extern bool SetConsoleMode(IntPtr hConsoleHandle, CONSOLE_MODE dwMode);
public static extern bool GetConsoleMode(IntPtr hConsoleHandle, ref CONSOLE_MODE lpMode);
static bool ConsoleDisplayMode(CONSOLE_MODE mode) { IntPtr handle = GetStdHandle((int)STD_HANDLE.STD_OUTPUT_HANDLE); return(SetConsoleDisplayMode(handle, (int)mode, IntPtr.Zero)); }