Beispiel #1
0
        internal static System.Drawing.Size GetCurrentFontSize()
        {
            IntPtr hConsoleOutput = (IntPtr)typeof(Console).InvokeMember("ConsoleOutputHandle", BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.GetProperty, (Binder)null, (object)null, (object[])null);

            Native.CONSOLE_FONT_INFO lpConsoleCurrentFont;
            Native.GetCurrentConsoleFont(hConsoleOutput, false, out lpConsoleCurrentFont);
            Native.Coord consoleFontSize = Native.GetConsoleFontSize(hConsoleOutput, lpConsoleCurrentFont.nFont);
            return(new System.Drawing.Size((int)consoleFontSize.X, (int)consoleFontSize.Y));
        }
Beispiel #2
0
 internal static extern bool SetConsoleScreenBufferSize(IntPtr consoleOutput, Native.Coord size);
Beispiel #3
0
 internal static extern bool WriteConsoleOutput(IntPtr consoleOutput, Native.CHAR_INFO[] buffer, Native.Coord bufferSize, Native.Coord bufferCoord, ref Native.SMALL_RECT writeRegion);
Beispiel #4
0
 internal static extern bool SetConsoleCursorPosition(IntPtr consoleOutput, Native.Coord cursorPosition);
Beispiel #5
0
 internal static extern bool ScrollConsoleScreenBuffer(IntPtr consoleOutput, ref Native.SMALL_RECT scrollRectangle, ref Native.SMALL_RECT clipRectangle, Native.Coord destinationOrigin, ref Native.CHAR_INFO fill);
Beispiel #6
0
 internal static extern bool ReadConsoleOutput(IntPtr consoleOutput, [Out] Native.CHAR_INFO[] buffer, Native.Coord bufferSize, Native.Coord bufferCoord, ref Native.SMALL_RECT readRegion);
Beispiel #7
0
 internal static extern bool FillConsoleOutputCharacter(IntPtr consoleOutput, char character, uint length, Native.Coord writeCoord, out uint numberOfCharsWritten);
Beispiel #8
0
 internal static extern bool FillConsoleOutputAttribute(IntPtr consoleOutput, ushort attribute, uint length, Native.Coord writeCoord, out uint numberOfAttrsWritten);