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; You can also completely hide your program from view: In our example below, we show both windows again after 5 seconds. Think about what would happen otherwise... procedure TForm1.Button3Click(Sender: TObject); begin ShowWindow(Application.Handle, SW_HIDE); Hide; // hide Form1 Sleep(5000); // wait 5 seconds Show; // show Form1 ShowWindow(Application.Handle, SW_SHOW); end; Finally, it's also possible to hide your application from the TaskBar immediately after the start of the program. Just create an OnActivate event handler for the application's main form and complete the code as follows: procedure TForm1.FormActivate(Sender: TObject); begin ShowWindow(Application.Handle, SW_HIDE); end; |
Source
Code and Tutorials :: Crash Course Delphi
:: FAQ
DelphiLand Club :: DC Library :: Tips ::
Downloads :: Links
© Copyright 1999-2018
DelphiLand