Don't call BeginPaint/EndPaint while processing a WM_DRAWITEM message

svn path=/trunk/; revision=23873
This commit is contained in:
Thomas Bluemel 2006-09-01 21:53:31 +00:00
parent c474673ac7
commit 00c354405e

View file

@ -414,17 +414,17 @@ TimeZonePageProc(HWND hwndDlg,
lpDrawItem = (LPDRAWITEMSTRUCT) lParam;
if(lpDrawItem->CtlID == IDC_WORLD_BACKGROUND)
{
PAINTSTRUCT ps;
HDC hdc, hdcMem;
hdc = BeginPaint(hwndDlg, &ps);
hdcMem = CreateCompatibleDC(hdc);
SelectObject(hdcMem, hBitmap);
StretchBlt(lpDrawItem->hDC, lpDrawItem->rcItem.left, lpDrawItem->rcItem.top,
lpDrawItem->rcItem.right - lpDrawItem->rcItem.left,
lpDrawItem->rcItem.bottom - lpDrawItem->rcItem.top,
hdcMem, 0, 0, cxSource, cySource, SRCCOPY);
DeleteDC(hdcMem);
EndPaint(hwndDlg, &ps);
HDC hdcMem;
hdcMem = CreateCompatibleDC(lpDrawItem->hDC);
if (hdcMem != NULL)
{
SelectObject(hdcMem, hBitmap);
StretchBlt(lpDrawItem->hDC, lpDrawItem->rcItem.left, lpDrawItem->rcItem.top,
lpDrawItem->rcItem.right - lpDrawItem->rcItem.left,
lpDrawItem->rcItem.bottom - lpDrawItem->rcItem.top,
hdcMem, 0, 0, cxSource, cySource, SRCCOPY);
DeleteDC(hdcMem);
}
}
}
break;