// Take the default processing unless we set this to something else below. *pResult = CDRF_DODEFAULT;
// First thing - check the draw stage. If it"s the control"s prepaint // stage, then tell Windows we want messages for every item.
if (pNMLVCustomDraw->nmcd.dwDrawStage == CDDS_PREPAINT) { *pResult = CDRF_NOTIFYITEMDRAW; } else if (pNMLVCustomDraw->nmcd.dwDrawStage == CDDS_ITEMPREPAINT) { // This is the notification message for an item. We"ll request // notifications before each subitem"s prepaint stage. *pResult = CDRF_NOTIFYSUBITEMDRAW; } else if (pNMLVCustomDraw->nmcd.dwDrawStage == (CDDS_ITEMPREPAINT | CDDS_SUBITEM)) { //当前要绘制的主项标识符和子项标识符 int iItem = (int)pNMLVCustomDraw->nmcd.dwItemSpec; int iSubItem = pNMLVCustomDraw->iSubItem;