int oldBits = OS.GetWindowLong (handle, OS.GWL_STYLE), newBits = oldBits; newBits |= OS.TVS_NOHSCROLL | OS.TVS_NOTOOLTIPS; if (EXPLORER_THEME) { if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) { newBits &= ~OS.TVS_TRACKSELECT; } }
int bits = OS.GetWindowLong (handle, OS.GWL_STYLE); bits |= OS.TVS_NOHSCROLL | OS.TVS_NOTOOLTIPS;
void _addListener (int eventType, Listener listener) {	super._addListener (eventType, listener);	switch (eventType) {		case SWT.DragDetect: {			if ((state & DRAG_DETECT) != 0) {				int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);				bits &= ~OS.TVS_DISABLEDRAGDROP;				OS.SetWindowLong (handle, OS.GWL_STYLE, bits);			}			break;		}		case SWT.MeasureItem:		case SWT.EraseItem:		case SWT.PaintItem: {			customDraw = true;			style |= SWT.DOUBLE_BUFFERED;			OS.SendMessage (handle, OS.TVM_SETSCROLLTIME, 0, 0);			int oldBits = OS.GetWindowLong (handle, OS.GWL_STYLE), newBits = oldBits;			newBits |= OS.TVS_NOHSCROLL | OS.TVS_NOTOOLTIPS;			if (EXPLORER_THEME) {				if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {					newBits &= ~OS.TVS_TRACKSELECT;				}			}			/*			* Feature in Windows.  When the tree has the style			* TVS_FULLROWSELECT, the background color for the			* entire row is filled when an item is painted,			* drawing on top of any custom drawing.  The fix			* is to clear TVS_FULLROWSELECT.			*/			if ((style & SWT.FULL_SELECTION) != 0) {				if (eventType != SWT.MeasureItem) newBits &= ~OS.TVS_FULLROWSELECT;			} else {				if (EXPLORER_THEME) {					if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {						newBits |= OS.TVS_HASLINES;					}				}			}			if (newBits != oldBits) {				OS.SetWindowLong (handle, OS.GWL_STYLE, newBits);				OS.InvalidateRect (handle, null, true);				/*				* Bug in Windows.  When TVS_NOHSCROLL is set after items				* have been inserted into the tree, Windows shows the				* scroll bar.  The fix is to check for this case and				* explicilty hide the scroll bar.				*/				int count = OS.SendMessage (handle, OS.TVM_GETCOUNT, 0, 0);				if (count != 0) {					if (!OS.IsWinCE) OS.ShowScrollBar (handle, OS.SB_HORZ, false);				}			}			if (EXPLORER_THEME) {				if (!OS.IsWinCE && OS.WIN32_VERSION >= OS.VERSION (6, 0)) {					OS.SetWindowTheme (handle, null, null);				}			}			break;		}	}}