C++ – Setting a column style? (Unmanaged c++)


I'm currently able to set a listview style VIA the ListView_SetExtendedListViewStyle method, however this makes all columns have the same style. My goal is to only modify one column (to basically have the LVS_EX_UNDERLINEHOT|LVS_EX_UNDERLINECOLD|LVS_EX_TWOCLICKACTIVATE style).

Is there a way to modify the style of only one column and not the entire table?

Edit: Or even a way to custom draw the cell?

Best Solution

If you use the WTL framework then there is a very useful CCustomDraw class that you can use to easily intercept NM_CUSTOMDRAW messages and draw your own listview content.

There is a good CodeProject article on custom draw using WTL here.