1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
void nt_getBitmap(int *iwin)
{
HDC hDC,tmpDC;
HWND hWnd;
HBITMAP tmpbmap;
RECT rect;
int height,width,i,j;
hWnd =(HWND)(*iwin);
hDC = GetDC(hWnd);
SetFocus(hWnd);
SetWindowPos(hWnd,HWND_TOP,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
GetClientRect (hWnd, &rect);
height = abs(rect.top-rect.bottom);
width = abs(rect.right-rect.left);
tmpDC = CreateCompatibleDC(hDC);
hBITMAPTMP = CreateCompatibleBitmap(hDC,height,width);
SelectObject(tmpDC,hBITMAPTMP);
BitBlt(tmpDC,0,0,height,width,hDC,0,0,SRCCOPY);
} |
Partager