Consider a plain Win32 dialog with listview control (in report mode) written in C++. Upon a certain event all items and all columns are deleted and new columns and items are created. Basically, as content changes, columns are automatically generated based on content.
When old items/columns are removed and new ones added, listview flickers like hell. I have tried WM_SETREDRAW
and LockWindowUpdate()
with no change to visual experience.
I have even set extended listview style LVS_EX_DOUBLEBUFFER
and that didn't help at all.
The parent dialog has WS_CLIPCHILDREN
set.
Any suggestions how to make this work with as little flicker as possible? I am thinking of using two listviews, alternating visibility, using the hidden one as a back buffer but this sounds like an overkill. There must be an easy way.