Frequently Asked Questions
Hiding your application from the Windows Taskbar.
Question:
How do I hide my application from the Windows Taskbar?
Answer:
To do this you will need to:
- Select the View -> Project Source, from Delphi's main menu.
- Add the Windows unit to the uses clause.
- Add Application.ShowMainForm := False; to the line after
"Application.Initialize;".
- 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.
- In the "initialization" section (at the very bottom)
of each unit that uses a form, add:
begin
ShowWindow(Application.Handle, SW_HIDE);
end.