title: Delphi hide the form, not hide the application icon on taskbar
body: <p>I use the following code :</p>
  
  <pre><code>procedure TForm1.Button1Click(Sender: TObject);
  begin
    Form1.visible := false;
    Form2.show;
  end;
  </code></pre>
  
  <p>Yes, the form1 got hidden and the form2 show up. But why the application icon in the taskbar also got hidden....</p>
  
  <p>I use the following codes and still can not show the icon on the taskbar, while hide the form1.</p>
  
  <pre><code>      visible := false;
  {
        enable := false;
        Application.MainFormOnTaskbar := True;
        ShowWindow(Application.Handle, SW_SHOW);
        SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW);
  }
  </code></pre>
  
  <p>How to keep the application icon on the taskbar while I want to hide the form ? </p>
  
  <p>I want to do it in the unit files , not the DPR file.</p>
  
  <p>The Files that I want to do keep the system taskbar are at : <a href="http://sidhiciang.com/myfiles/ShowHideForms.rar" rel="nofollow">http://sidhiciang.com/myfiles/ShowHideForms.rar</a></p>
  
  <pre><code>Unit1.pas
    If Form1.btShowForm2Click() , then 
      Hide Form1 and Show Form2 ( actHideForm1execute(self)).
    If Form1.btCloseForm1Click(), then 
      Close the application
  
  Unit2.pas
    If  Form2.btShowForm3Click(), then 
      Hide Form2 and Show Form3 ( actHideForm2execute(self)).
    If Form2.btCloseForm2Click(), then 
      Show the Form1 and Form2.close (actShowForm1execute(self))
  
  Unit3.pas
    If btCloseFrom3Click(), then
      Show Form2 and Close Form3
  </code></pre>
  
  <p>In all of the Unit1 / Unit2 / Unit3, Keep the application icon on taskbar available. Because if I use .visible := false, the system taskbar also become hidden.</p>
  
  <p>PS: I use Delphi 2010 and running on Windows XP and 7 Enviorment.</p>