Can anyone suggest an indepth book about how to implement user designed UI
with C++ or VC++.

Topics I am interested include how to draw different shapes, coordinate windows,
handling graphics of different formats and and determining screen metrics.
I wish to avoid reinventing the wheel in implementing these common tasks
but also have a good understanding of the underline working. For example,
I spent several days on a routine to calculate the area of a polygram, I
am sure somebody has already done it and probably more elegantly than what
I did.

Thanks for your advice.