RECT rto, rfrom; POINT startpoint; HRESULT hres; DDSURFACEDESC2 ddsd; ddsd.dwSize = sizeof(ddsd); directdraw.back->Lock(0, &ddsd, DDLOCK_WAIT, NULL); unsigned int *buffer = (unsigned int *)ddsd.lpSurface; for (int i=0; iUnlock((LPRECT)ddsd.lpSurface); startpoint.x = 0; startpoint.y = 0;//29; ClientToScreen(hwnd, &startpoint); GetClientRect(hwnd, &rto); rto.left = startpoint.x; rto.right = startpoint.x + width; rto.top = startpoint.y; rto.bottom = startpoint.y + height;//+GetSystemMetrics(SM_CYCAPTION); SetRect(&rfrom,0,0,width,height); hres = directdraw.primary->Blt(&rto, directdraw.back, &rfrom, DDBLT_WAIT, NULL);