Set Color Explanation

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
Right, it belongs to Windows programming. Sorry for the wrong category...but thanks for the links Athar.
Topic archived. No new replies allowed.