Huseyin Ciftci wrote:
> How can i hide my application's taskbar icon? i tried this > application.Initialize; > application.MainFormOnTaskbar := false; > but it didn't work.
With Delphi 2007, a new property of the Application object, the MainFormOnTaskbar property controls how Windows taskbar buttons are handled by VCL.
If MainFormOnTaskbar is true, a taskbar button represents the application's main form and displays its caption. If false, a taskbar button represents the application's (hidden) main window and bears the application's Title.
By design, the MainFormOnTaskbar property is set to true for any new Delphi 2007 application. You can change this value by editing the projects (DPR) source code. MainFormOnTaskBar should be set after Application.Initialize and before main form creation.
With Delphi versions up to Delphi 2007 a simple tweak to the application's window style using the SetWindowLong API call allowed you to hide the taskbar button (Delphi <= 2006).
This code no longer works with Delphi 2007! Hide the Taskbar button for Delphi 2007 With Delphi 2007, to hide the taskbar button you'll need a few code lines: Set MainFormOnTaskBar to FALSE Call ShowWindow(Application.Handle, SW_HIDE); inside the main form's OnShow event handler. Call ShowWindow(Application.Handle, SW_HIDE); inside the main form's OnActivate event handler.