Search code examples
c++winapiwtl

Simplest way to change listview and treeview colours


I'm trying to find a simple way to change the colour of the text and background in listview and treeview controls in WTL or plain Win32 code.

I really don't want to have to implement full owner drawing for these controls, simply change the colours used.

I want to make sure that the images are still drawn with proper transparency.

Any suggestions?


Solution

  • Have a look at the following macros:

    ListView_SetBkColor
    ListView_SetTextColor

    TreeView_SetBkColor
    TreeView_SetTextColor