I know how to set them (SetConsoleTextAttribute) but there isn\'t a GetConsoleTextAttribute to retrieve this information. On a unaffected console it should be int 7.
Here is code snippet.
HANDLE m_hConsole;
WORD m_currentConsoleAttr;
CONSOLE_SCREEN_BUFFER_INFO csbi;
//retrieve and save the current attributes
m_hConsole=GetStdHandle(STD_OUTPUT_HANDLE);
if(GetConsoleScreenBufferInfo(m_hConsole, &csbi))
m_currentConsoleAttr = csbi.wAttributes;
//change the attribute to what you like
SetConsoleTextAttribute (
m_hConsole,
FOREGROUND_RED |
FOREGROUND_GREEN);
//set the ttribute to the original one
SetConsoleTextAttribute (
m_hConsole,
m_currentConsoleAttr);