Determinate Progress Bar Lifecycle
An application first calls SetProgressValue to begin the display of a determinate progress bar, and then calls it again as needed to update the bar as the progress changes. When progress is complete, the application must call SetProgressState with the TBPF_NOPROGRESS flag to dismiss the progress bar.
How the Taskbar Button Chooses the Progress Indicator for a Group
The taskbar button can show a progress indicator for only one window at a time. When the taskbar button represents a group and more than one of the windows in that group are broadcasting progress information, the taskbar button chooses its progress display based on the following state priority.
| Priority | State |
|---|
| 1 | TBPF_ERROR |
| 2 | TBPF_PAUSED |
| 3 | TBPF_NORMAL |
| 4 | TBPF_INDETERMINATE |
Unless SetProgressState has set a blocking state (TBPF_ERROR or TBPF_PAUSED) for the window, a call to SetProgressValue assumes the TBPF_NORMAL state even if it is not explicitly set. A call to SetProgressValue overrides and clears the TBPF_INDETERMINATE state.
In the case of a priority collision where two windows are broadcasting determinate progress, the window with the least progress is used.
Based on that priority, this determinate (specific percentage) progress indicator can be displayed in these cases:
- The taskbar button does not represent a group and the single window that it represents is broadcasting determinate progress information through this method.
- The taskbar button represents a group, only one window in that group is broadcasting progress information, and that window is broadcasting determinate progress information through this method.
- The taskbar button represents a group, multiple windows in that group are broadcasting progress information, at least one of those windows is broadcasting progress information through this method, and none of those windows has set the TBPF_ERROR or TBPF_PAUSED state.
If a window in the group has set TBPF_ERROR or TBPF_PAUSED, that state will be used for the button display. However, you can still make calls to SetProgressValue on other, unblocked windows in the group to update their progress in the background.