10

I've noticed that my application title as shown on the task bar duplicates that displayed in the main form caption and has nothing to do with Application.Title. My main form caption is set programmatically with Caption := 'xxxx' and is something like:

My Fantastic Application V1.2.3.4 [Power User]

and this is faithfully reproduced (truncated) on the Taskbar. I'd really like to see only "My Fantastic Application" on the taskbar. Is this possible? I've tried setting Application.Title etc to no effect.

gabr
  • 26,580
  • 9
  • 75
  • 141
Brian Frost
  • 13,334
  • 11
  • 80
  • 154

1 Answers1

11

I think you are using Delphi 2007 or above.

In your project file, make sure there is a line

Application.MainFormOnTaskbar := False;

Then your task bar caption will use Application.Title

Justmade
  • 1,496
  • 11
  • 16
  • Note that this is generally better to have set to true: [it affects form Z-order and is required for Vista and 7 Aero effects, such as the form preview](http://docwiki.embarcadero.com/VCL/en/Forms.TApplication.MainFormOnTaskBar). Do you want the caption more than you want Aero task bar support? – David Mar 13 '12 at 10:31
  • 2
    David M: Some patch last year made taskbar much smarter. Now it is safe to use "Application.MainFormOnTaskbar := False;" – Torbins Mar 13 '12 at 11:50
  • 1
    I was going to make the same comment as @DavidM but when I checked it out I found that it was no longer the case. A change in XE or XE2 perhaps. – David Heffernan Mar 13 '12 at 13:53
  • Huh. Well, there you go, you learn something every day :) I guess they should update the documentation then! – David Mar 13 '12 at 14:00
  • @Justmade: So I presume that the Delphi Xe2 help doc "If the property 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. MainFormOnTaskBar must be True to use Windows Vista or Windows 7 Aero effects. These include live taskbar thumbnails, Dynamic Windows, Windows Flip, and Windows Flip 3D." is not correct now then? – Brian Frost Mar 13 '12 at 17:26
  • 1
    @BrianFrost I read from Marco Cantù Delphi Handbook and my own application (D2010) in Windows 7 do not have any Aero task bar thumbnails problem. With D2010, I just test shaking the title bar and it does not work. I am not sure if such feature fixed in XE2 or not. Frankly, when I answer, I only know there is no longer Thumbnail issue and I do not aware of the Dynamic Windows, Windows Flip, etc issues. – Justmade Mar 13 '12 at 17:42
  • Shaking title bar irrelevant. Aero thumbs, flip 3d etc. are possible problems. Make sure you test on Vista as well as 7 because perhaps the change is 7 rather than Delphi. – David Heffernan Mar 13 '12 at 19:54