1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
LRESULT CALLBACK CustomDrawProc(LPARAM lParam)
{
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)lParam;
switch(lplvcd->nmcd.dwDrawStage)
{
case CDDS_PREPAINT : //Before the paint cycle begins
//request notifications for individual listview items
return CDRF_NOTIFYITEMDRAW;
case CDDS_ITEMPREPAINT: //Before an item is drawn
if (((int)lplvcd->nmcd.dwItemSpec%2)==0)
{
//customize item appearance
lplvcd->clrText = RGB(255,0,0);
lplvcd->clrTextBk = RGB(200,200,200);
return CDRF_NEWFONT;
}
else{
lplvcd->clrText = RGB(0,0,255);
lplvcd->clrTextBk = RGB(255,255,255);
return CDRF_NEWFONT;
}
break;
}
return CDRF_DO_DEFAULT;
} |