Question

Is it possible to stop / suppress the "pulsing" animation of the progress bar? (That was introduced with the vista themes IIRC)

We have a process that can be paused by the user (to inspect hardware or intermediate results). While there's the usual "Pause button pressed" feedback to convey the state, the progress bar animation makes it look like the process is still running.

(The easy way out - to hide the progress bar - would be suboptimal, as even in paused state the progress is somewhat relevant.)

Was it helpful?

Solution

Since you're using the progress bar introduced with the Vista version of the common controls library, you can do even better than simply suppressing the animation.

The progress bar has three states:

  • Normal Normal progress bars are green
  • Paused Paused progress bars are yellow
  • Error Error progress bars are red

You switch between the states by sending the progress bar control window a PBM_SETSTATE message. The wParam parameter should be either PBST_NORMAL, PBST_PAUSED, or PBST_ERROR. The lParam parameter should be 0.

The pulsing animation is suppressed for both the paused and error states.

To retrieve the current state of the progress bar, send a PBM_GETSTATE message.

OTHER TIPS

It isn't very clear from the question, but it sounds like you display the progress bar in marquee mode. The "I'm not dead, don't know how long it will take but working on it" mode. Enabled by turning on the PBS_MARQUEE style flag.

You have control over the animation with the PBM_SETMARQUEE message. Allowing you to turn it off completely or by significantly increasing the animation time so it starts to just crawl. Somewhat appropriate perhaps for a "paused" mode. The default is 30 msec, it will look pretty crawly at 1000 msec. Completely freezing it is not an option, but no user will stare at it for INT_MAX msec.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top