HWND hWnd=getDlgItem(...);
if(hWnd)
{
 HDC dc=GetDc(hWnd);
............
 画图
 releaseDC(dc);
}