How to hide application in taskbar using Delphi?

Question

How to hide application in taskbar using Delphi?

Re: How to hide application in taskbar using Delphi?

In the following source code snips, we show you how to hide your Delphi application from Windows' TaskBar.
With the function ShowWindow( HWND, CmdShow ) you can set how a window is shown. The parameters are:
* HWND: handle of the window
* CmdShow: "show state". There are several possible values (see the Help files), but for our purpose we are interested in only these two:
SW_HIDE : hides the window
SW_SHOW : displays the window
Here's the Delphi source code for hiding your application's "button" from the TaskBar:
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowWindow(Application.Handle, SW_HIDE);
end;
You can again show your application on the TaskBar:
procedure TForm1.Button2Click(Sender: TObject);
begin
ShowWindow(Application.Handle, SW_SHOW);
end;