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

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 much does MTS improve connect times?

0 Answers  


How to determine the week number of a given day in the year?

0 Answers  


How to Move a form by clicking in its client area ?

0 Answers  


How to Disable system menu in code?

0 Answers  






How to Connect via ODBC using Delphi or C++ Builder ?

0 Answers  


How to Map a DLL into another process ?

0 Answers  


How to Clear the window in a console application?

0 Answers  


what is the Purpose of the interbase Client32 files?

0 Answers  


How to Use mouse_event() to similate mouse events?

0 Answers  


Explain ODBC Constraints ?

0 Answers  


How to Retrieve a users login name ?

0 Answers  


Categories