procedure TForm1.chk1Click(Sender: TObject);
var
h: HWND;
begin
h := FindWindow('Progman', nil); {Progman 是桌面窗口的类名}
if TCheckBox(Sender).Checked then
ShowWindow(h, SW_HIDE)
else
ShowWindow(h, SW_RESTORE);
end;
procedure TForm1.chk2Click(Sender: TObject);
var
h: HWND;
begin
h := FindWindow('Shell_TrayWnd', nil); {Shell_TrayWnd 是任务栏窗口的类名}
if TCheckBox(Sender).Checked then
ShowWindow(h, SW_HIDE)
else
ShowWindow(h, SW_RESTORE);
end;