state = .stateMask And Not TVIS_CUT
           End If
           lR = SendMessage(tvwOpt.hwnd, TVM_SETITEM, 0&amp;, tVI)
       End With
       hItem = SendMessageLong(tvwOpt.hwnd, TVM_GETNEXTITEM, TVGN_NEXTVISIBLE,
        hItem)
   Loop
   If (bState) Then
      ' Set the colour in the TreeView:
      lColor = TranslateColor(vbButtonShadow)
      SendMessageLong tvwOpt.hwnd, TVM_SETTEXTCOLOR, 0, lColor
    
      ' Request a redraw:
      InvalidateRectAsNull tvwOpt.hwnd, 0, 1
      UpdateWindow tvwOpt.hw