Drawing on the desktop wall paper

From: Pat_C (pat_ccc_at_hotmail.com)
Date: 03/25/05


Date: Sat, 26 Mar 2005 04:11:22 +0800

hi all,

Well someone suggested this code but it does not work for me I may be
doing something wrong.

Procedure TForm1.WriteOnWallpaper;
Var
   DCanvas:TCanvas;

Begin
   DCanvas := Tcanvas.Create;
   DCanvas.Handle := GetDC(GetDeskTopWindow);
   // now use Dcanvas as you would any other canvas.
   DCanvas.Pen.Color := clBlack;
   DCanvas.Polyline([Point(40, 10), Point(20, 60), Point(70, 30),
     Point(10, 30), Point(60, 60), Point(40, 10)]);
   //when done with major updates to the screen one should free the handle.
   Dcanvas.Refresh;
   ReleaseDC(GetDeskTopWindow, DCanvas.Handle);
   DCanvas.Free;
End;

I am just trying to draw a face of a clock on the Desktop wallpaper.
I am not getting much luck.

Can someone point me in the right direction or code to do this.

Regards
Patrick



Relevant Pages

  • Drawing on the Desktop wallpaper
    ... // now use Dcanvas as you would any other canvas. ... I am just trying to draw a face of a clock on the Desktop wallpaper. ... I am not getting much luck. ... Regards ...
    (alt.comp.lang.borland-delphi)
  • Re: drawing graphics directly on the desktop wallpaper
    ... > I want to draw graphics on the wallpaper directly using Delphi5. ... > not in a window but directly on the Desktop wallpaper. ... // now use Dcanvas as you would any other canvas. ...
    (alt.comp.lang.borland-delphi)