Using TTaskBar before creating the application's main form

166 Views Asked by At

My application displays a "download form" with a progress bar while downloading updates and after finishing it destroys the "download form" and creates the application's main form.

picture of a download form with a progressbar

The "download form" is not set as the application's main form (its created as MyDownloadForm := TMyDownloadForm.Create(nil)) and is displayed in the Windows task bar thank to the CreateParams overrided as follows:

procedure TMyDownloadForm.CreateParams(var Params: TCreateParams);
begin
  inherited;
  Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW;
end;

I'm trying to display the download progress on the Windows task bar using a TTaskBar component, placed on the download form, but it seems to have no effect on the Windows task bar (no progress, no color, nothing...).

If I create the "download form" as application's main form (Application.CreateForm(TMyDownloadForm, MyDownloadForm)) it works good instead.

I honestly don't remember if there was a pratical reason for avoiding to temporarily set the "download form" as application's main form, probably it was seeming cleaner to have only one main form in the program's life-time.

Anyhow, I would like to know if there is any way to use the TTaskBar component (or any other solution for displaying a progress on the task bar) with a "common form" (not application main form).

0

There are 0 best solutions below