OS.SetRect (rect, nmcd.left, rect.bottom, nmcd.right, nmcd.bottom); RECT headerRect = new RECT (); OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, headerRect); rect.left = headerRect.left; rect.right = headerRect.right; drawBackground (nmcd.hdc, rect, getSortColumnPixel ());
if (nmcd.bottom > rect.bottom) { OS.SetRect (rect, nmcd.left, rect.bottom, nmcd.right, nmcd.bottom); RECT headerRect = new RECT (); OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, headerRect); rect.left = headerRect.left; rect.right = headerRect.right; drawBackground (nmcd.hdc, rect, getSortColumnPixel ()); }
LRESULT CDDS_POSTPAINT (int wParam, int lParam) {		if (OS.IsWindowVisible (handle)) {		if (OS.COMCTL32_MAJOR >= 6 && OS.IsAppThemed ()) {			if (sortColumn != null && sortDirection != SWT.NONE) {				if (findImageControl () == null) {					int index = indexOf (sortColumn);					if (index != -1) {						int hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_LASTVISIBLE, 0);						if (hItem != 0) {							RECT rect = new RECT ();							rect.left = hItem;							if (OS.SendMessage (handle, OS.TVM_GETITEMRECT, 0, rect) != 0) {								NMTVCUSTOMDRAW nmcd = new NMTVCUSTOMDRAW ();								OS.MoveMemory (nmcd, lParam, NMTVCUSTOMDRAW.sizeof);								OS.SetRect (rect, nmcd.left, rect.bottom, nmcd.right, nmcd.bottom);								RECT headerRect = new RECT ();								OS.SendMessage (hwndHeader, OS.HDM_GETITEMRECT, index, headerRect);								rect.left = headerRect.left;								rect.right = headerRect.right;								drawBackground (nmcd.hdc, rect, getSortColumnPixel ());							}						}					}				}			}		}		if (linesVisible) {			NMTVCUSTOMDRAW nmcd = new NMTVCUSTOMDRAW ();			OS.MoveMemory (nmcd, lParam, NMTVCUSTOMDRAW.sizeof);				int hDC = nmcd.hdc;			if (hwndHeader != 0) {				int x = 0;				RECT rect = new RECT ();				HDITEM hdItem = new HDITEM ();				hdItem.mask = OS.HDI_WIDTH;				int count = OS.SendMessage (hwndHeader, OS.HDM_GETITEMCOUNT, 0, 0);				for (int i=0; i<count; i++) {					int index = OS.SendMessage (hwndHeader, OS.HDM_ORDERTOINDEX, i, 0);					OS.SendMessage (hwndHeader, OS.HDM_GETITEM, index, hdItem);					OS.SetRect (rect, x, nmcd.top, x + hdItem.cxy, nmcd.bottom);					OS.DrawEdge (hDC, rect, OS.BDR_SUNKENINNER, OS.BF_RIGHT);					x += hdItem.cxy;				}			}			int height = 0;			RECT rect = new RECT ();			int hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_LASTVISIBLE, 0);			if (hItem != 0) {				rect.left = hItem;				if (OS.SendMessage (handle, OS.TVM_GETITEMRECT, 0, rect) != 0) {					height = rect.bottom - rect.top;				}			}			if (height == 0) {				height = OS.SendMessage (handle, OS.TVM_GETITEMHEIGHT, 0, 0);				OS.GetClientRect (handle, rect);				OS.SetRect (rect, rect.left, rect.top, rect.right, rect.top + height);				OS.DrawEdge (hDC, rect, OS.BDR_SUNKENINNER, OS.BF_BOTTOM);			}			while (rect.bottom < nmcd.bottom) {				int top = rect.top + height;				OS.SetRect (rect, rect.left, top, rect.right, top + height);				OS.DrawEdge (hDC, rect, OS.BDR_SUNKENINNER, OS.BF_BOTTOM);			}		}	}	return new LRESULT (OS.CDRF_DODEFAULT);}