0

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).

2
  • 1
    It might be better to use the Win32 interface directly. Commented Feb 22, 2022 at 8:53
  • I would have to check its source code to verify, but it sounds like TTaskBar is not designed to handle Taskbar buttons added "manually" via CreateParams(), but only Taskbar buttons controlled by TApplication(.MainForm). That would be a serious limitation of the component if that is true. So, I agree with Andreas, you should just use the Win32 ITaskbarList3 interface directly. Commented Feb 22, 2022 at 9:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.