Hide / show all icons on desktop

Another “one-line code trick” and probably completely useless. 🙂

procedure TForm1.Button1Click(Sender: TObject);
//hide desktop icons
begin
  ShowWindow(FindWindow(nil, 'Program Manager'),SW_HIDE);
end;

procedure TForm1.Button2Click(Sender: TObject);
//show desktop icons
begin
  ShowWindow(FindWindow(nil, 'Program Manager'),SW_SHOW);
end;

Leave a Reply