BExplorer.Shell.ShellView.ProcessCustomDrawPostPaint C# (CSharp) Method

ProcessCustomDrawPostPaint() private method

private ProcessCustomDrawPostPaint ( Message &m, User32 nmlvcd, Int32 index, IntPtr hdc, IListItemEx sho, Color textColor ) : void
m Message
nmlvcd User32
index Int32
hdc IntPtr
sho IListItemEx
textColor Color
return void
    private void ProcessCustomDrawPostPaint(ref Message m, User32.NMLVCUSTOMDRAW nmlvcd, Int32 index, IntPtr hdc, IListItemEx sho, Color? textColor) {
      if (nmlvcd.clrTextBk != 0 && nmlvcd.dwItemType == 0 && this._CurrentDrawIndex == -1) {
        //var perceivedType = (PerceivedType)sho.GetPropertyValue(SystemProperties.PerceivedType, typeof(PerceivedType)).Value;
        this._CurrentDrawIndex = index;
        var itemBounds = nmlvcd.nmcd.rc;
        var lvi = new LVITEMINDEX();
        lvi.iItem = index;
        lvi.iGroup = this.GetGroupIndex(index);
        var iconBounds = new User32.RECT() { Left = 1 };
        User32.SendMessage(this.LVHandle, MSG.LVM_GETITEMINDEXRECT, ref lvi, ref iconBounds);
        var lvItem = new LVITEM() {
          iItem = index,
          iGroupId = lvi.iGroup,
          iGroup = lvi.iGroup,
          mask = LVIF.LVIF_STATE,
          stateMask = LVIS.LVIS_SELECTED
        };
        var lvItemImageMask = new LVITEM() {
          iItem = index,
          iGroupId = lvi.iGroup,
          iGroup = lvi.iGroup,
          mask = LVIF.LVIF_STATE,
          stateMask = LVIS.LVIS_STATEIMAGEMASK
        };

        if (sho != null) {
          var cutFlag = (User32.SendMessage(this.LVHandle, MSG.LVM_GETITEMSTATE, index, LVIS.LVIS_CUT) & LVIS.LVIS_CUT) ==
                                                                  LVIS.LVIS_CUT;
          if (this.IconSize == 16) {
            this.SmallImageList.DrawIcon(hdc, index, sho, iconBounds,
                    sho.IsHidden || cutFlag || this._CuttedIndexes.Contains(index), (nmlvcd.nmcd.uItemState & CDIS.HOT) == CDIS.HOT);
          } else {
            this.LargeImageList.DrawIcon(hdc, index, sho, iconBounds,
                    sho.IsHidden || cutFlag || this._CuttedIndexes.Contains(index), (nmlvcd.nmcd.uItemState & CDIS.HOT) == CDIS.HOT);
          }

          if (!sho.IsInitialised) sho.IsInitialised = true;
        }
        m.Result = (IntPtr)CustomDraw.CDRF_SKIPDEFAULT;
      } else {
        m.Result = IntPtr.Zero;
      }

      this._CurrentDrawIndex = -1;
    }
ShellView