public static ConsolePos GetWindowSize() { Native.CONSOLE_SCREEN_BUFFER_INFO info = new Native.CONSOLE_SCREEN_BUFFER_INFO(); Native.GetConsoleScreenBufferInfo(outputHandle, ref info); ConsolePos size = new ConsolePos() { x = (short)(info.visibleSegment.Right - info.visibleSegment.Left), y = (short)(info.visibleSegment.Bottom - info.visibleSegment.Top) }; return(size); }
public static ConsolePos GetBufferSize() { Native.CONSOLE_SCREEN_BUFFER_INFO info = new Native.CONSOLE_SCREEN_BUFFER_INFO(); Native.GetConsoleScreenBufferInfo(outputHandle, ref info); ConsolePos size = new ConsolePos() { x = info.bufferSize.x, y = info.bufferSize.y }; return(size); }
public static ConsolePos GetWindowPosition() { Native.CONSOLE_SCREEN_BUFFER_INFO info = new Native.CONSOLE_SCREEN_BUFFER_INFO(); Native.GetConsoleScreenBufferInfo(outputHandle, ref info); ConsolePos pos = new ConsolePos() { x = info.visibleSegment.Left, y = info.visibleSegment.Top }; return(pos); }