// WM_CREATE
hdc=GetDC(hwnd);
GetWindowRect(hwnd, &pRect);
scrwidth = pRect.right - pRect.left;
scrheight = pRect.bottom - pRect.top;
phdc = CreateCompatibleDC(GetDC(hwnd));
pBmp = CreateCompatibleBitmap(hdc, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
SelectObject(phdc, pBmp);
//WM_PAINT
draw(pHdc);
//draw:
void Draw(const HDC destDC)
{
BeginPaint(hwnd, &ps);
myrectangle(destDC, 0,0,scrwidth, scrheight, GetSysColorBrush(COLOR_BTNFACE));//типа очищаем экран //рисуем
BitBlt(hdc, 0, 0, scrwidth, scrheight, pHdc, 0, 0, SRCCOPY);
EndPaint(hwnd, &ps);
}
|