unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type 
  TForm1 =class (TForm)
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    procedure FormCreate (Sender: TObject);
    procedure CheckBox1Click (Sender: TObject);
    procedure CheckBox2Click (Sender: TObject);
  end ;

var
  Form1: TForm1;

implementation

{$ R * .dfm}

{initialization}
procedure TForm1.FormCreate (Sender: TObject);
begin 
  CheckBox1.Caption: ='Hide desktop icon';
  CheckBox2.Caption: = 'Hide taskbar';
end ;

{Hide or show desktop icons}
procedure TForm1.CheckBox1Click (Sender: TObject);
var
  h: HWND;
begin 
  h: = FindWindow ('Progman', nil );    {Progman is the class name of the desktop window}
  if TCheckBox (Sender) .Checkedthen
    ShowWindow (h, SW_HIDE)
  else
    ShowWindow (h, SW_RESTORE);
end ;

{Hide or show the taskbar}
procedure TForm1.CheckBox2Click (Sender: TObject);
var
  h: HWND;
begin 
  h: = FindWindow ('Shell_TrayWnd', nil ); {Shell_TrayWnd is the class name of the taskbar window}
  if TCheckBox (Sender) .Checkedthen
    ShowWindow (h, SW_HIDE)
  else
    ShowWindow (h, SW_RESTORE);
end ;

end .