views:

211

answers:

2
+1  Q: 

Scrollbar flicker

I have a problem with the way my scrollbars are drawn. Because of external limitations (my application being a plugin running in an external window that insists on painting over any regular child window), I have to use SCROLLBAR-class windows (as opposed to using WS_CHILD | WS_VSCROLL)

For almost every message received, the scrollbar is shown animating smoothly and consistently. However, when I receive the SB_LINEDOWN message(i.e. when I click on the bottom/right arrow), the scroll bar flickers horribly (Low-framerate example). Again, all other messages work perfectly.

I have tested removing the scrollbar position update (Still broken) and removing the actual scrolling code (Still broken). I am already double-buffering the area to prevent an even worse flickering..

What might cause this and how could I fix it?

A: 

Try intercepting and ignoring the WM_ERASEBKGND this has helped me a lot with flicker in controls. Dunno if its your problem though :(

Goz
+1  A: 

in addition to what Goz mentioned, which i bet you're already doing, it may be worth experimenting with combinations of WS_CLIPCHILDREN and WS_CLIPSIBLINGS on the scrollbar window itself and its container or any overlapping windows.

~jewels

Jewel S
I still need to test a bit further, but it seems adding the WS_CLIPCHILDREN to the parent works.
Alex Brault
And that's a definitive yay!
Alex Brault