Why should the host window not have CS_HREDRAW and CS_VREDRAW window styles?

832 views Asked by At

I was reading the SimpleRibbon sample application and I noticed a curious line in the source:

wcex.style          = 0;    // Don't use CS_HREDRAW or CS_VREDRAW with a Ribbon

I can't find any reference on MSDN or elsewhere that explains why these window classes shouldn't be used in a window that contains a ribbon. Does anyone know what this is all about?

Cheers.

Sample code: GitHub Windows-classic-samples - SimpleRibbon.cpp

1

There are 1 answers

3
user13947194 On

check this link http://www.catch22.net/tuts/win32/flicker-free-drawing .

I was having terrible flickering when resizing my custom text view widget. Then this tutorial told me to remove CS_HREDRAW and CSVREDRAW. I immediately saw that flickering was gone! Now my question is, what the heck is the purpose of these styles. Since they only do bad.

Note that Windows 7 fixed flickering. So even if your app flickers crazy on Windows Xp, it will won't flicker on Windows 7.