Dim lLeft As Long
Dim lTop As Long

   
   CopyMemory tDis, ByVal lParam, Len(tDis)
   
   ' Evaluate enabled/selected state of item:
   bSelected = ((tDis.ItemState And ODS_SELECTED) = ODS_SELECTED)

   ' Choose the background colour:
   If (bSelected) Then
      hBrBack = GetSysColorBrush(vbHighlight And &amp;H1F&amp;)
   Else
      hBrBack = GetSysColorBrush(vbWindowBackground And &amp;H1F&amp;)
   End If
   ' Fill the background:
   FillRect tDis.hdc, tDis.rcItem, hBrBack
   DeleteObject hBrBack
   
   