CustomDraw分阶段,就是pLVCD->nmcd.dwDrawStage这个状态,在每个阶段的返回值决定了下个阶段的走向;响应CDDS_PREPAINT时返回CDRF_NOTIFYITEMDRAW才会在后续发送绘制列表项目的消息;具体参见MSDN说明:
Return code Description
CDRF_DODEFAULT The control will draw itself. It will not send any additional NM_CUSTOMDRAW notification codes for this paint cycle. This occurs when dwDrawStage equals CDDS_PREPAINT.
CDRF_DOERASE Windows Vista. The control will not draw the focus rectangle around an item.
CDRF_NOTIFYITEMDRAW The control will notify the parent of any item-related drawing operations. It will send NM_CUSTOMDRAW notification codes before and after drawing items. This occurs when dwDrawStage equals CDDS_PREPAINT.
CDRF_NOTIFYPOSTERASE The control will notify the parent after erasing an item. This occurs when dwDrawStage equals CDDS_PREPAINT.
CDRF_NOTIFYPOSTPAINT The control will notify the parent after painting an item. This occurs when dwDrawStage equals CDDS_PREPAINT.
CDRF_NEWFONT The application specified a new font for the item; the control will use the new font. For more information about changing fonts, see Changing fonts and colors. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT.
CDRF_NOTIFYSUBITEMDRAW Version 4.71. Your application will receive an NM_CUSTOMDRAW control code with dwDrawStage set to CDDS_ITEMPREPAINT | CDDS_SUBITEM before each list-view subitem is drawn. You can then specify font and color for each subitem separately or return CDRF_DODEFAULT for default processing. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT.
CDRF_SKIPDEFAULT The application drew the item manually. The control will not draw the item. This occurs when dwDrawStage equals CDDS_ITEMPREPAINT.
CDRF_SKIPPOSTPAINT Windows Vista. The control will only paint the background.