>i think the above posts explain it pretty well...
>hDC = GetDC(hwnd);
I tried all that.
I also searched for example code written by other people, but nothing worked. What I ever I did, it would fail one in 20 times or so.
I do read the manuals. Whatever was wrong with my code, it was something subtle that I couldn't figure out.