procedure TForm1.ScreenShot2(wnd: HWND; x : integer; y : integer; Width : integer; Height : integer; bm : TBitMap); var dc: HDC; begin {test width and height} if ((Width = 0) OR (Height = 0)) then exit; bm.Width := Width; bm.Height := Height; {get the screen dc} dc := GetDc(wnd); if (dc = 0) then exit; {copy from the screen to the bitmap} BitBlt(bm.Canvas.Handle,0,0,Width,Height,Dc,x,y,SRCCOPY); {release the screen dc} ReleaseDc(wnd, dc); end; (* ScreenShot *)