Wednesday, January 5, 2011

Capturing the Desktop to a form

Try this:

procedure TScrnFrm.GrabScreen;
var

DeskTopDC: HDc;
DeskTopCanvas: TCanvas;
DeskTopRect: TRect;

begin
DeskTopDC := GetWindowDC(GetDeskTopWindow);
DeskTopCanvas := TCanvas.Create;
DeskTopCanvas.Handle := DeskTopDC;

DeskTopRect := Rect(0,0,Screen.Width,Screen.Height);

ScrnForm.Canvas.CopyRect(DeskTopRect,DeskTopCanvas,DeskTopRect);

ReleaseDC(GetDeskTopWindow,DeskTopDC);end;

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Kang Iwan K-sev | Thank's for your visit To My Site - Ridwan Mulyana | Cibeureum