ChangeLog Fix custom draw for item 0. Index: dlls/comctl32/listview.c =================================================================== RCS file: /var/cvs/wine/dlls/comctl32/listview.c,v retrieving revision 1.348 diff -u -r1.348 listview.c --- dlls/comctl32/listview.c 2 May 2003 20:14:33 -0000 1.348 +++ dlls/comctl32/listview.c 8 May 2003 13:01:49 -0000 @@ -858,7 +858,7 @@ lpnmlvcd->clrTextBk = infoPtr->clrTextBk; lpnmlvcd->clrText = infoPtr->clrText; if (!lplvItem) return; - lpnmlvcd->nmcd.dwItemSpec = lplvItem->iItem; + lpnmlvcd->nmcd.dwItemSpec = lplvItem->iItem + 1; lpnmlvcd->iSubItem = lplvItem->iSubItem; if (lplvItem->state & LVIS_SELECTED) lpnmlvcd->nmcd.uItemState |= CDIS_SELECTED; if (lplvItem->state & LVIS_FOCUSED) lpnmlvcd->nmcd.uItemState |= CDIS_FOCUS; @@ -868,9 +868,16 @@ static inline DWORD notify_customdraw (LISTVIEW_INFO *infoPtr, DWORD dwDrawStage, NMLVCUSTOMDRAW *lpnmlvcd) { + BOOL isForItem = (lpnmlvcd->nmcd.dwItemSpec != 0); + DWORD result; + lpnmlvcd->nmcd.dwDrawStage = dwDrawStage; - if (lpnmlvcd->nmcd.dwItemSpec) lpnmlvcd->nmcd.dwDrawStage |= CDDS_ITEM; - return notify_hdr(infoPtr, NM_CUSTOMDRAW, &lpnmlvcd->nmcd.hdr); + if (isForItem) lpnmlvcd->nmcd.dwDrawStage |= CDDS_ITEM; + if (lpnmlvcd->iSubItem) lpnmlvcd->nmcd.dwDrawStage |= CDDS_SUBITEM; + if (isForItem) lpnmlvcd->nmcd.dwItemSpec--; + result = notify_hdr(infoPtr, NM_CUSTOMDRAW, &lpnmlvcd->nmcd.hdr); + if (isForItem) lpnmlvcd->nmcd.dwItemSpec++; + return result; } static DWORD notify_prepaint (LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpnmlvcd) -- Dimi.