community.borland.com

Article #15574: Hiding your application from the Windows Taskbar.

 Question and Answer Database

FAQ574D.txt   Hiding your application from the Windows Taskbar.
Category   :VCL
Platform    :All
Product    :All 32 bit  

Question:
How do I hide my application from the Windows Taskbar?


Answer:
To do this you will need to:
?
    ?
  1. Select the View -> Project Source, from Delphi's main menu. ?
  2. Add the Windows unit to the uses clause. ?
  3. Add Application.ShowMainForm := False; to the line after "Application.Initialize;". ?
  4. Add: ShowWindow(Application.Handle, SW_HIDE); to the line before "Application.Run;" Your main project source file should now look something like this: program Project1; uses Windows, Forms, Unit1 in 'Unit1.pas' {Form1}, Unit2 in 'Unit2.pas' {Form2}; {$R *.RES} begin Application.Initialize; Application.ShowMainForm := False; Application.CreateForm(TForm1, Form1); Application.CreateForm(TForm2, Form2); ShowWindow(Application.Handle, SW_HIDE); Application.Run; end. ?
  5. In the "initialization" section (at the very bottom) of each unit that uses a form, add: begin ShowWindow(Application.Handle, SW_HIDE); end. ?
7/16/98 4:31:28 PM

Last Modified: 01-SEP-99