Member Avatar for stevee1984

A win32 listview with the view style set to LV_VIEW_DETAILS will not draw onto a window with its exstyle WS_EX_COMPOSITED set? Why?

Heres my code for changing my dialogbox to composite if anyone is interested:

case WM_INITDIALOG:
     {
          unsigned long styles = GetWindowLong(hwndDlg, GWL_EXSTYLE);
          SetWindowLong(hwndDlg, GWL_EXSTYLE, styles | WS_EX_COMPOSITED);
          return (INT_PTR)TRUE;
     }

The listview's view flag is set in the visual studios resource editor rather than by code.

Anyone have any ideas why this is happening, and I really want this composited cos it solves all flicker.

Member Avatar for stevee1984

I found out the hard why, listviews are not compatible with a composited window.

The answer is to use the WM_ERASEBKGND:

case WM_ERASEBKGND:
     {
          return (INT_PTR)TRUE;
     }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.