Article

From:
To:
All
Subject:
Re: Application shown twice in taskbar Delphi 2010
Newsgroup:
embarcadero.public.delphi.language.delphi.general
 

Re: Application shown twice in taskbar Delphi 2010

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.

http://delphi.about.com/od/delphitips2008/qt/hide_taskbutton.htm
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.
FYI: Phrase searches are enclosed in either single or double quotes
 
 
Originally created by
Tamarack Associates
Mon, 13 May 2024 17:19:12 UTC
Copyright © 2009-2024
HREF Tools Corp.