void color()
{
if (3 == argc) {
WORD color;
CONSOLE_SCREEN_BUFFER_INFO csbi;
HANDLE hOut;
hOut = GetStdHandle(STD_OUTPUT_HANDLE);
GetConsoleScreenBufferInfo(hOut, &csbi);
color = (WORD) wcstoul(argv[2], (wchar_t **) NULL, 16);
SetConsoleTextAttribute(hOut, color);
}
}
Looks like it sets up variables (2 numbers and a STRUCT?), grabs a handle (for the current console?), makes an API call (to fill a variable with screen buffer info?), gets the new settings from the commandline (as 1 or 2 single digit hex numbers), and makes another API call with the new settings (again to the current console?). Simple, right? ^_^