SetConsoleFont (kernel32)
Last changed: -85.115.224.14

.
Summary
Changes the font size of console. Undocumented function.

C# Signature:

[DllImport("kernel32.dll", SetLastError=true)]
static extern int SetConsoleFont(IntPtr hOut, uint dwFontSize);

VB Signature:

Declare Function SetConsoleFont Lib "kernel32.dll" (hOut As IntPtr, dwFontSize As UInt32) As Integer

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

Changes the font size of console. Undocumented function.

Tips & Tricks:

Please add some!

Sample Code:

    const int STD_OUT_HANDLE = -11;

    [DllImport("kernel32.dll", SetLastError = true)]
    static extern int SetConsoleFont(
        IntPtr hOut,
        uint dwFontNum
        );

    [DllImport("kernel32.dll", SetLastError = true)]
    static extern IntPtr GetStdHandle(int dwType);

    Console.WriteLine("This is an error!");
    Console.ReadLine();
    SetConsoleFont(GetStdHandle(STD_OUT_HANDLE), 9);
    Console.ReadLine();

Documentation