Главная страница | назад





Article #17818: How can I draw directly on the Windows Desktop?

 Question and Answer Database

FAQ2818D.txt   How can I draw directly on the Windows Desktop?
Category   :Windows API
Platform    :All
Product    :All 32 bit  

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.

Example:

procedure TForm1.Button1Click(Sender: TObject);
var
  dc : hdc;
begin
  dc := GetDc(0);
  MoveToEx(Dc, 0, 0, nil);
  LineTo(Dc, 300, 300);
  ReleaseDc(0, Dc);
end;

7/16/98 4:31:28 PM
 

Last Modified: 01-SEP-99