Mega Code Archive

 
Categories / Delphi / System
 

How can I draw directly on the Windows Desktop

Title: How can I draw directly on the Windows Desktop Question: How can I draw directly on the Windows Desktop Answer: The following example uses the dc returned from GetDc(0) with the Windows API drawing functions to draw on the Windows Desktop. procedure TForm1.Button1Click(Sender: TObject); var dc : hdc; begin dc := GetDc(0); MoveToEx(Dc, 0, 0, nil); LineTo(Dc, 300, 300); end;