Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 7 taskbar progress works in one app but not another

I have two different applications, both native applications written in C++Builder 2009, both MDI, and both using the same progress bar utility code. One of them properly updates the Windows 7 taskbar with its progress. The other one doesn't.

I can't find any obvious differences between the two applications. No errors are reported in the failing application: the calls to ITaskbarList3::SetProgressValue and ITaskbarList3::SetProgressState return S_OK, but nothing happens in the Windows 7 taskbar.

Are there any gotchas in getting the Windows 7 taskbar progress bar to work? Any requirements that I might be missing?

like image 959
Josh Kelley Avatar asked Jan 17 '11 19:01

Josh Kelley


1 Answers

My problem was likely specific to Delphi/C++Builder and was the result of a difference in how the VCL handles its top-level window.

If Application.MainFormOnTaskBar is true, then ITaskbarList3 only works if Application.MainFormHandle is used as the HWND parameter.

If Application.MainFormOnTaskBar is false, then ITaskbarList3 only works if Application.Handle is used as the HWND parameter.

In my case, one project had MainFormOnTaskBar true, and one had it false.

like image 54
Josh Kelley Avatar answered Oct 12 '22 04:10

Josh Kelley