Click here to Skip to main content
15,920,383 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
As you can see from the code snippet below I can set the color of any row of a clistctrl using custom draw without any problem but I cannot get the current color of a row. It just returns rubbish. Also for some reason none of the other members of CMFCListCtrl seem to be there. Can anybody please tell me what I am doing wrong.

C#
void CDDListCtrl::OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult)
{
NMLVCUSTOMDRAW* cd = reinterpret_cast<nmlvcustomdraw*>(pNMHDR);

*pResult = CDRF_DODEFAULT;

if ( CDDS_PREPAINT == cd->nmcd.dwDrawStage )

  *pResult = CDRF_NOTIFYITEMDRAW;
  }
else if ( CDDS_ITEMPREPAINT == cd->nmcd.dwDrawStage )
    {
  *pResult = CDRF_NOTIFYSUBITEMDRAW;
  }
else if ( (CDDS_ITEMPREPAINT | CDDS_SUBITEM) == cd->nmcd.dwDrawStage )
  {
    if (cd->nmcd.hdr.idFrom == IDC_PLAYLIST)
        {
        if (PlaylistInfo.m_AddDataType == ADD_TYPE_NORMAL)
            {
            if ((RegValue == SINGLE_MANUAL) || (RegValue == SINGLE_RANDOM) || (RegValue == SINGLE_FORMAT))
                {
                cd->clrTextBk = RED;
                }
            else
                {
                cd->clrTextBk = GREEN;
                }
            }
        }
    if (PlaylistInfo.m_AddDataType == ADD_TYPE_SEGUE)
        {
        if ( 1 == cd->iSubItem )
            {
        cd->clrTextBk = GetTextBkColor();
        SetTextBkColor(cd->clrTextBk);
Posted
Comments
Jochen Arndt 19-Jul-12 3:16am    
See my answer to your previous question.

1 solution

Don't you just want to NOT return CDRF_SKIPDEFAULT when it's ADD_TYPE_SEGUE?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900