lunaroverlord
January 10th, 2009, 08:09 PM
I'm custom-drawing a listview control, but while I can receive the CDDS_PREPAINT message, the CDDS_ITEMPREPAINT never comes. I've searched around and tried various things, but to no avail.
Here is the WM_NOTIFY message:
DWORD result; //global variable
...
case WM_NOTIFY:
if(((LPNMHDR)lp)->code==NM_CUSTOMDRAW && ((LPNMHDR)lp)->idFrom == 5467)
{
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)lp;
switch(lplvcd->nmcd.dwDrawStage)
{
case CDDS_PREPAINT: //this message is processed fine
result = CDRF_NOTIFYITEMDRAW;
break;
case CDDS_ITEMPREPAINT: //I never receive this one
{
int iRow = lplvcd->nmcd.dwItemSpec;
if(iRow & 1)
{
lplvcd->clrTextBk = RGB(255, 34, 100);
lplvcd->clrText = RGB(255, 22, 2);
result = CDRF_NEWFONT;
}
result = CDRF_DODEFAULT;
}
break;
default:
result = CDRF_DODEFAULT;
}
return result;
}
What could be the reason for this? Thanks for any help.
Here is the WM_NOTIFY message:
DWORD result; //global variable
...
case WM_NOTIFY:
if(((LPNMHDR)lp)->code==NM_CUSTOMDRAW && ((LPNMHDR)lp)->idFrom == 5467)
{
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)lp;
switch(lplvcd->nmcd.dwDrawStage)
{
case CDDS_PREPAINT: //this message is processed fine
result = CDRF_NOTIFYITEMDRAW;
break;
case CDDS_ITEMPREPAINT: //I never receive this one
{
int iRow = lplvcd->nmcd.dwItemSpec;
if(iRow & 1)
{
lplvcd->clrTextBk = RGB(255, 34, 100);
lplvcd->clrText = RGB(255, 22, 2);
result = CDRF_NEWFONT;
}
result = CDRF_DODEFAULT;
}
break;
default:
result = CDRF_DODEFAULT;
}
return result;
}
What could be the reason for this? Thanks for any help.