Código Delphi [-] procedure TForm1.ListBox1Click(Sender: TObject); var hWnd, hCanvas: Cardinal; Rect: TRect; begin with ListBox1 do hWnd := Cardinal(Items.Objects[ItemIndex]); hCanvas := GetWindowDC(hWnd); if hCanvas <> 0 then with Image1 do begin Windows.GetWindowRect(hWnd, Rect); Picture.Assign(nil); StretchBlt(Canvas.Handle, 0, 0, Width, Height, hCanvas, 0, 0, Rect.Right - Rect.Left, Rect.Bottom - Rect.Top, SRCCOPY); ReleaseDC(hWnd, hCanvas); end; end;
procedure TForm1.ListBox1Click(Sender: TObject); var hWnd, hCanvas: Cardinal; Rect: TRect; begin with ListBox1 do hWnd := Cardinal(Items.Objects[ItemIndex]); hCanvas := GetWindowDC(hWnd); if hCanvas <> 0 then with Image1 do begin Windows.GetWindowRect(hWnd, Rect); Picture.Assign(nil); StretchBlt(Canvas.Handle, 0, 0, Width, Height, hCanvas, 0, 0, Rect.Right - Rect.Left, Rect.Bottom - Rect.Top, SRCCOPY); ReleaseDC(hWnd, hCanvas); end; end;
Código Delphi [-] StretchBlt(Canvas.Handle, 0, 0, Width, Height, hCanvas, 0, 0, Rect.Right - Rect.Left, Rect.Bottom - Rect.Top, SRCCOPY); por BitBlt(Canvas.Handle, 0, 0, Rect.Right - Rect.Left, Rect.Bottom - Rect.Top, hCanvas, 0, 0, SRCCOPY);
StretchBlt(Canvas.Handle, 0, 0, Width, Height, hCanvas, 0, 0, Rect.Right - Rect.Left, Rect.Bottom - Rect.Top, SRCCOPY); por BitBlt(Canvas.Handle, 0, 0, Rect.Right - Rect.Left, Rect.Bottom - Rect.Top, hCanvas, 0, 0, SRCCOPY);
Código Delphi [-] ... StretchBlt( ... Picture.Bitmap.SaveToFile('c:\ClubDelphi.cHackAll.bmp'); // Esta! ReleaseDC( ... ...
... StretchBlt( ... Picture.Bitmap.SaveToFile('c:\ClubDelphi.cHackAll.bmp'); // Esta! ReleaseDC( ... ...