Home

CONSOLESCREENBUFFERINFO

CONSOLE_SCREEN_BUFFER_INFO is a structure used in the Windows Console API to describe the state and geometry of a console screen buffer. It is filled by the operating system when querying a console handle and is commonly used by console-based applications to inspect or adjust the display state, cursor position, and window dimensions.

Fields include: dwSize, a COORD indicating the size of the screen buffer in character columns (X) and

Typical usage involves calling GetConsoleScreenBufferInfo with a handle to the console screen buffer (for example, obtained

Relation to other types: The structure uses COORD and SMALL_RECT, while the visible characters are stored in

The structure is defined in Wincon.h and Windows.h as part of the Win32 console API and is

rows
(Y).
dwCursorPosition,
a
COORD
that
identifies
the
current
cursor
location
within
the
buffer.
wAttributes,
a
WORD
representing
the
current
text
attributes
(foreground
and
background
colors,
intensity,
etc.).
srWindow,
a
SMALL_RECT
that
defines
the
portion
of
the
buffer
currently
visible
in
the
console
window.
dwMaximumWindowSize,
a
COORD
indicating
the
maximum
allowable
window
size
for
the
current
buffer.
via
GetStdHandle).
The
function
fills
a
CONSOLE_SCREEN_BUFFER_INFO
structure
with
the
current
buffer
size,
cursor
position,
attributes,
window
rectangle,
and
maximum
window
size.
Applications
can
use
this
information
to
render
custom
UI,
reposition
the
cursor,
or
compute
safe
regions
for
drawing.
a
separate
screen
buffer
as
an
array
of
CHAR_INFO
that
can
be
read
with
ReadConsoleOutput
or
written
with
WriteConsoleOutput.
The
CONSOLE_SCREEN_BUFFER_INFO
itself
provides
metadata
about
that
data
buffer
and
the
viewport.
Windows-specific.