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 30 31 32
| LRESULT ProcessCustomDraw (LPARAM lParam)
{
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)lParam;
switch(lplvcd->nmcd.dwDrawStage)
{
case CDDS_PREPAINT :
{
return CDRF_NOTIFYITEMDRAW;
}
case CDDS_ITEMPREPAINT: //Before an item is drawn
{
return CDRF_NOTIFYSUBITEMDRAW;
}
break;
case CDDS_SUBITEM | CDDS_ITEMPREPAINT: //Before a subitem is drawn
{
switch(lplvcd->iSubItem)
{
case 0 :
{
int irow = lplvcd ->nmcd.dwItemSpec; // Detects row number in the listcontrol
if (irow == 0)
lplvcd->clrText = RGB(0,0,255); // Blue characters for the first line : current video mode
else
lplvcd->clrText = RGB(0,0,0); // Black characters for the other ones
return CDRF_NEWFONT;
}
}
}
}
return CDRF_DODEFAULT;
} |
Partager