# CHAR_INFO

The CHAR_INFO structure specifies the Unicode or ANSI character and the colour attributes of the screen character cell. This structure is used by console functions to read from and write to a console screen buffer.

    typedef struct _CHAR_INFO {
      // Unicode or ANSI character
      union {
          WCHAR UnicodeChar;
          CHAR AsciiChar;
      } Char;

      // Text and background colors
      WORD Attributes;
    } CHAR_INFO, *PCHAR_INFO;

### Members

Char
Unicode (wide-character) or ANSI character of a screen buffer character cell, depending on whether it is used with the Unicode or ANSI version of a function.
Attributes
Character attributes. There are two classes of the attributes - colour and DBCS. This member can be zero or any combination of the following attributes: (all of them are defined in `Wincon.h`).

Attribute | Description
--- | ---
FOREGROUND_BLUE | Text color contains blue.
FOREGROUND_GREEN | Text color contains green.
FOREGROUND_RED | Text color contains red.
FOREGROUND_INTENSITY | Text color is intensified.
BACKGROUND_BLUE | Background color contains blue.
BACKGROUND_GREEN | Background color contains green.
BACKGROUND_RED | Background color contains red.
BACKGROUND_INTENSITY | Background color is intensified.
COMMON_LVB_LEADING_BYTE | DBCS: Leading byte.
COMMON_LVB_TRAILING_BYTE | DBCS: Trailing byte.
COMMON_LVB_GRID_HORIZONTAL | DBCS: Grid attribute: top horizontal.
COMMON_LVB_GRID_LVERTICAL | DBCS: Grid attribute: left vertical.
COMMON_LVB_GRID_RVERTICAL | DBCS: Grid attribute: right vertical.
COMMON_LVB_REVERSE_VIDEO | DBCS: Reverse foreground and background attributes.
COMMON_LVB_UNDERSCORE | DBCS: Underscore.

The foreground attributes (FOREGROUND_*) define the colour of the text symbols. The background attributes (BACKGROUND_*) define the colour of the background of the text cell. Other attributes (COMMON_LVB_*) are used with DBCS.

### Remarks

See also:
ReadConsoleOutput, ScrollConsoleScreenBuffer, WriteConsoleOutput