Platform SDK: Files and I/O |
The FillConsoleOutputAttribute function sets the text and background color attributes for a specified number of character cells, beginning at the specified coordinates in a screen buffer.
BOOL FillConsoleOutputAttribute( HANDLE hConsoleOutput, // handle to screen buffer WORD wAttribute, // color attribute DWORD nLength, // number of cells COORD dwWriteCoord, // first coordinates LPDWORD lpNumberOfAttrsWritten // number of cells written );
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
If the number of character cells whose attributes are to be set extends beyond the end of the specified row in the screen buffer, the cells of the next row are set. If the number of cells to write to extends beyond the end of the screen buffer, the cells are written up to the end of the screen buffer.
The character values at the positions written to are not changed.
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Wincon.h; include Windows.h.
Library: Use Kernel32.lib.
Consoles and Character-Mode Support Overview, Console Functions, COORD, FillConsoleOutputCharacter, SetConsoleTextAttribute, WriteConsoleOutputAttribute