unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Borland.Vcl.StdCtrls, Borland.Vcl.ExtCtrls, System.ComponentModel;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Edit1: TEdit;
    ColorBox1: TColorBox;
    ColorBox2: TColorBox;
    procedure Edit1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.nfm}

procedure TForm1.Edit1Change(Sender: TObject);
var
  plotnoPulpitu :TCanvas;
  x,y :Integer;
begin
plotnoPulpitu:=TCanvas.Create;
plotnoPulpitu.Handle:=GetWindowDC(GetDesktopWindow);

//Rysowanie pulpitu
//plotnoPulpitu.Rectangle(Screen.WorkAreaWidth div 4,Screen.WorkAreaHeight div 4,3*Screen.WorkAreaWidth div 4,3*Screen.WorkAreaHeight div 4);

plotnoPulpitu.Font.Size:=72;
plotnoPulpitu.Font.Name:='Times';
plotnoPulpitu.Font.Color:=ColorBox1.Selected;
plotnoPulpitu.Brush.Color:=ColorBox2.Selected;

x:=(Screen.Width-plotnoPulpitu.TextWidth(Edit1.Text)) div 2;
y:=(Screen.Height-plotnoPulpitu.TextHeight(Edit1.Text)) div 2;
plotnoPulpitu.TextOut(x,y,Edit1.Text);

ReleaseDC(GetDesktopWindow,plotnoPulpitu.Handle);
end;

end.
