CustomDrawing a ListView with Theme API on Vista
Hi!
I'm trying to use custom draw to customize the listview (report style) on vista a bit.
What works:
- ListView in explorer style
- Painting the selection state ( with this nice blue glow )
What doesn't work:
- Painting the background of a row correctly.
How do i paint the fine lines between each column?
How do I paint the background of a row correctly?
I get a funny frame around each row right now.
This is how I paint the subitems right now:
int iStateID=LIS_NORMAL;
if(nState & LVIS_SELECTED)
iStateID=LIS_SELECTED;
if(IsThemeBackgroundPartiallyTransparent(hTheme, LVP_LISTITEM, iStateID))
{
DrawThemeParentBackground(GetSafeHwnd(), pDC->GetSafeHdc(),&subitemrect);
}
DrawThemeBackground(hTheme,
pDC->GetSafeHdc(),
LVP_LISTITEM,
iStateID,
&rowrect,
&subitemrect);
DrawThemeText(hTheme,pDC->GetSafeHdc(),LVP_LISTITEM,iStateID,sText,sText.GetLength(),DT_NOPREFIX,NULL,&textrect);
Thanks in advance!

