I want to change the background color of a specific column to a color of the dialog (grey). How can I achive it?
void CUcsOpTerminalDlg::OnCustomdrawFeatureList(
The custom draw API does not work exactly as advertised. Anyway, the following code will paint the second column green:
LPNMLVCUSTOMDRAW pNMLVCD = reinterpret_cast(pNMHDR);
*pResult = CDRF_DODEFAULT;
switch( pNMLVCD->nmcd.dwDrawStage )
{
case CDDS_PREPAINT:
*pResult = CDRF_NOTIFYITEMDRAW;
break;
case CDDS_ITEMPREPAINT:
*pResult = CDRF_NOTIFYSUBITEMDRAW;
break;
case CDDS_ITEMPREPAINT | CDDS_SUBITEM:
if( pNMLVCD->iSubItem == 1 )
pNMLVCD->clrTextBk = RGB(0,255,0);
break;
}