Set Color Explanation

Mar 31, 2011 at 11:00pm
Can you explain this code:

1
2
3
4
5
void setcolor(unsigned short color)                 
{                                                   
    HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(hcon,color);
}


This function is use to change the color of texts (ex. setcolor (10) ). I want to memorize this but before doing that, I need first to understand the dissection of that code. Can you help me?
Last edited on Mar 31, 2011 at 11:01pm
Mar 31, 2011 at 11:19pm
Apr 4, 2011 at 3:37am
Right, it belongs to Windows programming. Sorry for the wrong category...but thanks for the links Athar.
Topic archived. No new replies allowed.