unit knopshi;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  H: Integer;
begin
 H := FindWindow('Shell_TrayWnd', nil);
  if (H = 0) then
    Application.MessageBox('Window not found', nil, IDOK)
  else
    ShowWindow(H, SW_HIDE);
 // ShowDesktop(false);


end;



procedure TForm1.Button2Click(Sender: TObject);
var
  H: Integer;
begin
 H := FindWindow('Shell_TrayWnd',  nil);
  if (H = 0) then
    Application.MessageBox('Window not found', nil, IDOK)
  else
    ShowWindow(H,
      SW_SHOW);
  //  ShowDesktop(true);

end;

procedure TForm1.FormCreate(Sender: TObject);
begin
 Left := (Screen.Width  -  Width)div 2;
 Top  := (Screen.Height - Height)div 2;

end;

end.
