Use GetConsoleScreenBufferInfoEx
to retrieve the current colour attributes, and change the foreground only.
The following, albeit untested, should work no matter what background colour you start off with:
HANDLE outputHandle = GetStdHandle (STD_OUTPUT_HANDLE); //used twice
CONSOLE_SCREEN_BUFFER_INFOEX cbie; //hold info
//article didn't say this was necessary, but to be on the safe side...
cbie.cbSize = sizeof (CONSOLE_SCREEN_BUFFER_INFOEX);
GetConsoleScreenBufferInfoEx (outputHandle, &cbie); //get info
//first, cancel out all foreground attributes
//then, set the ones you want (I use bright red)
cbie.wAttributes &=
~(FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY);
cbie.wAttributes |= (FOREGROUND_RED | FOREGROUND_INTENSITY);
SetConsoleScreenBufferInfoEx (outputHandle, &cbie); //pass updated info back