GetConsoleScreenBufferInfo (kernel32)
Last changed: -87.74.96.9

.
Summary
TODO - a short description

C# Signature:

    [DllImport("kernel32.dll", SetLastError = true)]
    static extern bool GetConsoleScreenBufferInfoEx(
        IntPtr hConsoleOutput,
        ref CONSOLE_SCREEN_BUFFER_INFO_EX ConsoleScreenBufferInfo
        );

VB Signature:

Declare Function GetConsoleScreenBufferInfoEx Lib "kernel32.dll" (TODO) As TODO

User-Defined Types:

    [StructLayout(LayoutKind.Sequential)]
    public struct CONSOLE_SCREEN_BUFFER_INFO_EX
    {
        public uint cbSize;
        public COORD dwSize;
        public COORD dwCursorPosition;
        public short wAttributes;
        public SMALL_RECT srWindow;
        public COORD dwMaximumWindowSize;

        public ushort wPopupAttributes;
        public bool bFullscreenSupported;

        internal COLORREF black;
        internal COLORREF darkBlue;
        internal COLORREF darkGreen;
        internal COLORREF darkCyan;
        internal COLORREF darkRed;
        internal COLORREF darkMagenta;
        internal COLORREF darkYellow;
        internal COLORREF gray;
        internal COLORREF darkGray;
        internal COLORREF blue;
        internal COLORREF green;
        internal COLORREF cyan;
        internal COLORREF red;
        internal COLORREF magenta;
        internal COLORREF yellow;
        internal COLORREF white;

        // has been a while since I did this, test before use
        // but should be something like:
        //
        // [MarshalAs(UnmanagedType.ByValArray, SizeConst=16)]
        // public COLORREF[] ColorTable;
    }

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

cbSize must be initialized - ConsoleScreenBufferInfo.cbSize = (uint)sizeof(CONSOLE_SCREEN_BUFFER_INFO_EX);

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation