static Console2() { defaultHandle = NativeConsole.GetStdHandle(NativeConsole.STD_OUTPUT_HANDLE); currentHandle = defaultHandle; NativeConsole.CONSOLE_SCREEN_BUFFER_INFO info; NativeConsole.GetConsoleScreenBufferInfo(currentHandle, out info); foregroundColor = (ConsoleColor)(info.wAttributes & 0x0F); backgroundColor = (ConsoleColor)((info.wAttributes & 0xF0) >> 4); bufferSize = new NativeConsole.COORD(80, 35); }