Articles

Use GetDesktopWindow and GetWindowDC functions to find attributes of desktop for further using. And set background mode by using GetBKMode function.

procedure TForm1.Button1Click(Sender: TObject);
var
  Desktop: THandle;
  MyCanvas: TCanvas;
  DesktopDC: HDC;
begin
  Desktop:=GetDesktopWindow;
  DesktopDC:=GetWindowDC(Desktop);

  MyCanvas:=TCanvas.Create;
  MyCanvas.Handle:=DesktopDC;

  SetBkMode(MyCanvas.Handle, TRANSPARENT);
  MyCanvas.TextOut(10,10, 'Hello');
end;