How to draw directly on the Windows Desktop?



How to draw directly on the Windows Desktop?..

Answer / srinivas

Through some API functions like

To draw a text

Handle := GetDesktopWindow;
Dc := GetWindowDC(Handle) ;
ACanvas := TCanvas.Create;
try
ACanvas.Handle := DC;
BeginPath(ACanvas.Handle) ;
ACanvas.Font.Color := clRed;
ACanvas.Font.Name := 'Tahoma';
ACanvas.Font.Size := 30;
SetBkMode(ACanvas.Handle, TRANSPARENT) ;
EndPath(ACanvas.Handle) ;
ACanvas.TextOut(0, 0, TextToDraw) ;
finally
ReleaseDC(Handle, ACanvas.Handle) ;
ACanvas.Free;
end;

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More Delphi Interview Questions

How to do Sorting on Calculated fields ?

0 Answers  


Does Kylix support Postgres?

0 Answers  


How to Use the LzExpand functions in your applications?

0 Answers  


How to Determine the last access time of a given file ?

0 Answers   IBM,


How to Use the WinApi GetObject to get a bitmap?

0 Answers  






How to Broadcast a message?

1 Answers  


How to Simulate a mouse move in code?

0 Answers  


How to Retrieve the line number that a memo's cursor is on?

0 Answers  


What are the different types of inheritances present in delphi?

0 Answers  


How to create Interbase stored procedures that return parameters with TIBQuery?

0 Answers  


How to Customize TTrackBar?

0 Answers  


How to use the TUpdateSQLProvider.OnUpdateRecord method ?

0 Answers  


Categories