예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }