tree.update(); OS.ImageList_DragShowNolock(true);
void showDropTargetEffect(int effect, int x, int y) {	effect = checkEffect(effect);	int handle = tree.handle;	Point coordinates = new Point(x, y);	coordinates = tree.toControl(coordinates);	TVHITTESTINFO lpht = new TVHITTESTINFO ();	lpht.x = coordinates.x;	lpht.y = coordinates.y;	OS.SendMessage (handle, OS.TVM_HITTEST, 0, lpht);	int hItem = lpht.hItem;	if ((effect & DND.FEEDBACK_SCROLL) == 0) {		scrollBeginTime = 0;		scrollIndex = -1;	} else {		if (hItem != -1 && scrollIndex == hItem && scrollBeginTime != 0) {			if (System.currentTimeMillis() >= scrollBeginTime) {				int topItem = OS.SendMessage(handle, OS.TVM_GETNEXTITEM, OS.TVGN_FIRSTVISIBLE, 0);				int nextItem = OS.SendMessage(handle, OS.TVM_GETNEXTITEM, hItem == topItem ? OS.TVGN_PREVIOUSVISIBLE : OS.TVGN_NEXTVISIBLE, hItem);				boolean scroll = true;				if (hItem == topItem) {					scroll = nextItem != 0;				} else {					RECT itemRect = new RECT ();					itemRect.left = nextItem;					if (OS.SendMessage (handle, OS.TVM_GETITEMRECT, 1, itemRect) != 0) {						RECT rect = new RECT ();						OS.GetClientRect (handle, rect);						POINT pt = new POINT ();						pt.x = itemRect.left;						pt.y = itemRect.top;						if (OS.PtInRect (rect, pt)) {							pt.y = itemRect.bottom;							if (OS.PtInRect (rect, pt)) scroll = false;						}					}				}				if (scroll) {					OS.ImageList_DragShowNolock(false);					OS.SendMessage (handle, OS.TVM_ENSUREVISIBLE, 0, nextItem);					tree.update();					OS.ImageList_DragShowNolock(true);				}				scrollBeginTime = 0;				scrollIndex = -1;			}		} else {			scrollBeginTime = System.currentTimeMillis() + SCROLL_HYSTERESIS;			scrollIndex = hItem;		}	}	if ((effect & DND.FEEDBACK_EXPAND) == 0) {		expandBeginTime = 0;		expandIndex = -1;	} else {		if (hItem != -1 && expandIndex == hItem && expandBeginTime != 0) {			if (System.currentTimeMillis() >= expandBeginTime) {				if (OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_CHILD, hItem) != 0) {					TVITEM tvItem = new TVITEM ();					tvItem.hItem = hItem;					tvItem.mask = OS.TVIF_STATE;					OS.SendMessage (handle, OS.TVM_GETITEM, 0, tvItem);					if ((tvItem.state & OS.TVIS_EXPANDED) == 0) {						OS.ImageList_DragShowNolock(false);						OS.SendMessage (handle, OS.TVM_EXPAND, OS.TVE_EXPAND, hItem);						tree.update();						OS.ImageList_DragShowNolock(true);					}				}				expandBeginTime = 0;				expandIndex = -1;			}		} else {			expandBeginTime = System.currentTimeMillis() + EXPAND_HYSTERESIS;			expandIndex = hItem;		}	}	if (dropIndex != -1 && (dropIndex != hItem || (effect & DND.FEEDBACK_SELECT) == 0)) {		TVITEM tvItem = new TVITEM ();		tvItem.hItem = dropIndex;		tvItem.mask = OS.TVIF_STATE;		tvItem.stateMask = OS.TVIS_DROPHILITED;		tvItem.state = 0;		OS.ImageList_DragShowNolock(false);		OS.SendMessage (handle, OS.TVM_SETITEM, 0, tvItem);		tree.update();		OS.ImageList_DragShowNolock(true);		dropIndex = -1;	}	if (hItem != -1 && hItem != dropIndex && (effect & DND.FEEDBACK_SELECT) != 0) {		TVITEM tvItem = new TVITEM ();		tvItem.hItem = hItem;		tvItem.mask = OS.TVIF_STATE;		tvItem.stateMask = OS.TVIS_DROPHILITED;		tvItem.state = OS.TVIS_DROPHILITED;		OS.ImageList_DragShowNolock(false);		OS.SendMessage (handle, OS.TVM_SETITEM, 0, tvItem);		tree.update();		OS.ImageList_DragShowNolock(true);		dropIndex = hItem;	}	if ((effect & DND.FEEDBACK_INSERT_BEFORE) != 0 || (effect & DND.FEEDBACK_INSERT_AFTER) != 0) {		boolean before = (effect & DND.FEEDBACK_INSERT_BEFORE) != 0;		/*		* Bug in Windows.  When TVM_SETINSERTMARK is used to set		* an insert mark for a tree and an item is expanded or		* collapsed near the insert mark, the tree does not redraw		* the insert mark properly.  The fix is to hide and show		* the insert mark whenever an item is expanded or collapsed.		* Since the insert mark can not be queried from the tree,		* use the Tree API rather than calling the OS directly.		*/		TreeItem insertItem = (TreeItem)tree.getDisplay().findWidget(tree.handle, hItem);		if (insertItem != null) {			OS.ImageList_DragShowNolock(false);			tree.setInsertMark(insertItem, before);			tree.update();			OS.ImageList_DragShowNolock(true);			clearInsert = true;		}	} else {		if (clearInsert) {			OS.ImageList_DragShowNolock(false);			tree.setInsertMark(null, false);			tree.update();			OS.ImageList_DragShowNolock(true);		}		clearInsert = false;	}	return;}