// EDIT: Komplett neuer Post.
Habe gerade bei delphi-fundgrube.de einen Source gefunden und getestet. Macht genau das was Du möchtest.
Delphi-Quellcode:
procedure ScreenCapture(Bmp: TBitmap);
var
DeskWnd: HWnd;
DeskDC: HDC;
DeskCv: TCanvas;
R: TRect;
W, H: Integer;
begin
if Bmp = nil then Exit;
DeskWnd := GetDesktopWindow;
DeskDC := GetWindowDC(DeskWnd);
DeskCv := TCanvas.Create;
DeskCv.Handle := DeskDC;
W := Screen.Width;
H := Screen.Height;
R := Bounds(0, 0, W, H);
try
Bmp.HandleType := bmDIB;
Bmp.PixelFormat := pf24Bit;
Bmp.Width := W;
Bmp.Height := H;
Bmp.Canvas.CopyMode := cmSrcCopy;
Bmp.Canvas.CopyRect(R, DeskCv, R);
finally
DeskCv.Free;
ReleaseDC(DeskWnd, DeskDC);
end;
end; {Marco Lange}
SCRaT