Author: William Gerbert Answer: This canvas allows you to access the desktop: 1 type 2 TDesktopCanvas = class(TCanvas) 3 private 4 DC: hDC; 5 function GetWidth: Integer; 6 function GetHeight: Integer; 7 public 8 constructor Create; 9 destructor Destroy; override; 10 published 11 property Width: Integer read GetWidth; 12 property Height: Integer read GetHeight; 13 end; 14 15 { TDesktopCanvas object } 16 17 function TDesktopCanvas.GetWidth: Integer; 18 begin 19 Result := GetDeviceCaps(Handle, HORZRES); 20 end; 21 22 function TDesktopCanvas.GetHeight: Integer; 23 begin 24 Result := GetDeviceCaps(Handle, VERTRES); 25 end; 26 27 constructor TDesktopCanvas.Create; 28 begin 29 inherited Create; 30 DC := GetDC(0); 31 Handle := DC; 32 end; 33 34 destructor TDesktopCanvas.Destroy; 35 begin 36 Handle := 0; 37 ReleaseDC(0, DC); 38 inherited Destroy; 39 end;