I can change the background color of the console, but not the foreground?

When I try changing the foreground and background color of a piece of text, the foreground is always black?

1
2
3
4
HANDLE hConsole;
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hConsole, FOREGROUND_GREEN);
SetConsoleTextAttribute(hConsole, BACKGROUND_BLUE);


It seems to only change the background color, and not the foreground.
You didn't read the documentation
http://msdn.microsoft.com/en-us/library/ms682088%28v=vs.85%29.aspx#_win32_character_attributes

SetConsoleTextAttribute(hConsole, FOREGROUND_GREEN|BACKGROUND_BLUE);
Yeah, I was using a tut on colors. I'll check out MSDN first from now one, to try and avoid asking stupid questions. Thanks though.
Topic archived. No new replies allowed.