I have seen sample code like the following in handling a WM_PAINT message:
I assume that, although it works, it is not really correct, since BeginPaint gets the DC anyway, and EndPaint releases it. Am I correct?Code:BeginPaint(hwnd,&ps);
hdc = GetDC(hwnd);
....draw stuff...
ReleaseDC(hwnd,hdc);
EndPaint(hwnd,&ps);