As I’ve just checked Andreas Hausladen’s QC report #58939 which deals with the fact that Applications created by Delphi 2007 have no Taskbar Button when started minimized using the ShellLink, I’ve discovered that the same applies for anything below D2007 using the above mentioned Vista tweaks of InstallationExcellence:
You’ll receive a minimized TApplication Window on the desktop with no Taskbar Button assigned to it.
After stepping through the VCL sources of D2006 I saw that the problematic part is in TApplication.Run where CmdShow = SW_SHOWMINNOACTIVE is checked and a few lines below “Minimize;” is called.
Together with Nathanial’s fix this won’t do. To circumvent it you will have to make a small addition to his fix in order to have a correct behaviour together with minimized ShellLinks:
ShowWindow(Application.Handle, SW_HIDE); SetWindowLong(Application.Handle, GWL_EXSTYLE, GetWindowLong(Application.Handle, GWL_EXSTYLE) and not WS_EX_APPWINDOW or WS_EX_TOOLWINDOW); ShowWindow(Application.Handle, SW_SHOW); // add the following lines: if (CmdShow = SW_SHOWMINNOACTIVE) then Application.ShowMainForm := False;
Assuming you are using Nathanial’s fix correctly in the MainForm’s OnCreate the given lines ensure that the MainForm is already hidden before Application.Run has been called.