customdraw

How to change item size and gap between them in Custom Drown CListCtrl

As far as I know ON_WM_MEASUREITEM does not get called in Custom Draw list control. It is only used if control is Owner Drawn. I have found a way to do that, but it is somewhat a HACK and I still can not control gaps between items they are set up somehow automatically. The trick is that you can create CImageList with the unused images of...

CListCtrl: how to get column width when use different fonts on same column?

I derived a class from CListCtrl called CListCtrlCustomDraw, and use NM_CUSTOMDRAW handler to draw the list. The problem is I have different fonts for selected item and unselected item, they are member variables of the list control, but when I use m_list.SetColumnWidth(iCol, LVSCW_AUTOSIZE); int nTextWidth = m_list.GetColumnWidth(iCo...

SetWindowLong in CustomDraw causes unhandled exception

Hello, I am making some changes to a CSliderCtrl using the Custom Draw, the control is to be used in a dialog. Here is the structure: In my MessageMap I have : ON_NOTIFY_REFLECT_EX(NM_CUSTOMDRAW, OnNMCustomdraw) The OnNMCustomdraw method looks like the following: BOOL CCustomSliderCtrl::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult) ...