The SetConsoleTextAttribute function sets the foreground (text) and background color attributes of characters written to the screen buffer by the WriteFile or WriteConsole function, or echoed by the ReadFile or ReadConsole function. This function affects only text written after the function call.
BOOL SetConsoleTextAttribute(
HANDLE hConsoleOutput, |
// handle of console screen buffer |
WORD wAttributes |
// text and background colors |
); |
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.
To determine the current color attributes of a screen buffer, call the GetConsoleScreenBufferInfo function.
GetConsoleScreenBufferInfo, ReadConsole, ReadFile, WriteConsole, WriteFile
file: /Techref/os/win/api/win32/func/src/f77_14.htm, 2KB, , updated: 2000/4/7 11:19, local time: 2024/11/17 09:23,
18.117.78.145:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/Techref/os/win/api/win32/func/src/f77_14.htm"> SetConsoleTextAttribute</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.