The following screenshots are from the Internet.
Function dlgetdesktoprect (nleft, ntop, nwidth, nheight: integer; pixel: tpixelformat): tbitmap;
VaR
Dcdesk: HDC;
BMP: tbitmap;
Begin
BMP: = tbitmap. Create;
BMP. pixelformat: = pixel;
BMP. Width: = nwidth;
BMP. Height: = nheigth;
Dcdesk: = getdc (getdesktopwindow );
Bitblt (BMP. Canvas. Handle, 0, 0, nwidth, nheigth, dcdesk, nleft, ntop, srccopy );
Result: = BMP;
Deletedc (deskdc );
End;
Capture full screen
BMP: = dlgetasktoprect (, screen. Width, screen. Height, pixel );
capture the game window
getwindowrect (hgame, rect);
BMP: = dlgetasktoprect (rect. left, rect. top, rect. right-rect.Left, rect. bottom-rect.Top (pixel);
Capture the game client window
Clienttoscreen (hgame, rect );
BMP: = dlgetasktoprect (rect. Left, rect. Top, rect. Right-rect.Left, rect. Bottom-rect.Top, pixel );
In this way, we capture the window images that are active at the front-end, whether they are common or DX-based.