|
HBITMAP Get(HWND hWnd)
{
HBITMAP hbm;
BITMAP bm;
RECT rect;
HDC memdc;
GetClientRect(hWnd, &rect);
hbm = CreateCompatibleBitmap(GetDC(hWnd), rect.right-rect.left, rect.bottom-rect.top);
memdc = CreateCompatibleDC(GetDC(hWnd));
HBITMAP h = (HBITMAP)SelectObject(memdc, hbm);
GetObject(hbm, sizeof(bm), &bm);
BitBlt(memdc, 0, 0, bm.bmWidth, bm.bmHeight, GetDC(hWnd), 0, 0, SRCCOPY);
SelectObject(memdc, h);
DelectDC(memdc);
} |
|