What does this code mean and do?

I am in a intro to C ++ class this semester and our final project is to write the game Master Mind. I have that done and it works but for extra credit we can add color to the game. Our teacher gave us some code to use but I'm not sure what it means:

[HANDLE hConsole;
hConsole = GETStdHandle(STD_OUTPUT_HANDLE);
SETConsoleTextAttribute(hConsole, ORANGE); //declared the colors as constants]

Thanks!
HANDLE is a handle to an object. This type is declared in WinNT.h as follows:
typedef PVOID HANDLE;

GETStdHandle() retrieves a handle to the specified standard device here: STD_OUTPUT_HANDLE The standard output device. Initially, this is the active console screen buffer

SetConsoleTextAttribute Sets the foreground (text) and background color attributes of characters written to the console screen buffer.


http://msdn.microsoft.com/en-us/library/windows/desktop/ms682073%28v=vs.85%29.aspx

http://msdn.microsoft.com/en-us/library/aa383751%28v=vs.85%29.aspx

Topic archived. No new replies allowed.