How Do I Remove The Application Icon From The Taskbar?

To remove the icon from the taskbar, you need to call a Windows API call:

BOOL ShowWindow(HWND hwnd,int nCmdShow);

makes it very easy to use this command. All you need to do is supply
the Application.handle and SW_HIDE to remove the icon from the taskbar.

To display the icon on the taskbar use SW_SHOW in your ShowWindow parameter.

Both examples are shown in the source below.

procedure TForm1.Button1Click(Sender: TObject);
  ShowWindow (Application.Handle, SW_HIDE);

procedure TForm1.Button2Click(Sender: TObject);
  ShowWindow (Application.Handle, SW_SHOW);

Leave a Reply

Your email address will not be published. Required fields are marked *