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 Declare a SafeArray in the type library editor?

0 Answers  


How to install programatically a printer?

0 Answers  


I'm using Delphi 4/5 and have am trying to fill a RichEdit control with both European characters and Thai characters - while I can change character colours the font stays with what was selected for the control:- reLangB.SelAttributes.Color :=dCol; reLangB.SelAttributes.Name :=FontName[dLang]; reLangB.SelAttributes.Charset :=FontChar[dLang]; reLangB.SelAttributes.Style :=[]; reLangB.Lines.Add(dText); The FontName and FontChar arrays contain the font info, and using a similar method for Captions and EditBoexes works! Anybody any ideas? Thanx in advance!

0 Answers  


How to Disable close button of a window ?

0 Answers  


How to debug an Apache Shared Module?

0 Answers   CBS,






How to Make the drop-down list appear faster?

0 Answers  


How to display an application associated icons?

0 Answers  


How to use the InterBase API security functions to add, modify and delete users?

0 Answers  


How to Access HKEY_LOCAL_MACHINE under NT without Admin?

0 Answers  


How to Print a TStringGrid / TDBGrid?

0 Answers  


How to Register a file extension and context menu operations?

0 Answers  


How to get serial number of my drive ?

0 Answers  


Categories