Bengi
March 18th, 2003, 04:46 AM
what the heck is wrong with it??!!??! it drives me crazy!
case WM_NOTIFY:
{
switch(LOWORD(wParam))
{
case IDC_LIST:
{
if(((LPNMHDR)lParam)->code == NM_CUSTOMDRAW)
{
NMLVCUSTOMDRAW *cdraw = (NMLVCUSTOMDRAW*)lParam;
if (cdraw->nmcd.dwDrawStage == CDDS_PREPAINT)
return CDRF_NOTIFYITEMDRAW;
if (cdraw->nmcd.dwDrawStage == CDDS_ITEMPREPAINT || cdraw->nmcd.dwDrawStage == CDDS_SUBITEM)
{
COLORREF crText;
if ( cdraw->iSubItem==2 )
crText = RGB(255,0,0);
else if ( cdraw->iSubItem==1 )
crText = RGB(0,255,0);
else
crText = RGB(128,128,255);
cdraw->clrText = crText;
return CDRF_DODEFAULT;
}
}
}
}
}
the message never arrives if (cdraw->nmcd.dwDrawStage == CDDS_ITEMPREPAINT || cdraw->nmcd.dwDrawStage == CDDS_SUBITEM)
i have seen other src codes and it all works well there (MFC apps !@!@#!@)
do i need to set my listView to have some style or something?
case WM_NOTIFY:
{
switch(LOWORD(wParam))
{
case IDC_LIST:
{
if(((LPNMHDR)lParam)->code == NM_CUSTOMDRAW)
{
NMLVCUSTOMDRAW *cdraw = (NMLVCUSTOMDRAW*)lParam;
if (cdraw->nmcd.dwDrawStage == CDDS_PREPAINT)
return CDRF_NOTIFYITEMDRAW;
if (cdraw->nmcd.dwDrawStage == CDDS_ITEMPREPAINT || cdraw->nmcd.dwDrawStage == CDDS_SUBITEM)
{
COLORREF crText;
if ( cdraw->iSubItem==2 )
crText = RGB(255,0,0);
else if ( cdraw->iSubItem==1 )
crText = RGB(0,255,0);
else
crText = RGB(128,128,255);
cdraw->clrText = crText;
return CDRF_DODEFAULT;
}
}
}
}
}
the message never arrives if (cdraw->nmcd.dwDrawStage == CDDS_ITEMPREPAINT || cdraw->nmcd.dwDrawStage == CDDS_SUBITEM)
i have seen other src codes and it all works well there (MFC apps !@!@#!@)
do i need to set my listView to have some style or something?