1,183
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.Button1Click(Sender: TObject);
var
hwd:HWND;
bmp:TBitmap;
wnd:cardinal;
rec:TRect;
begin
wnd:=FindWindow(nil,'游戏名称');
GetWindowRect(wnd,rec);
bmp:=TBitmap.Create;
bmp.Width:=rec.Right-rec.Left;
bmp.Height:=rec.Bottom-rec.Top;
bmp.PixelFormat := pf24bit;
PrintWindow(wnd, bmp.Canvas.Handle, 0);
Image1.Picture.Bitmap:=bmp;
bmp.Free;
//句柄
if hwd>0 then
begin
end;
end;