if (point == null) error (SWT.ERROR_NULL_ARGUMENT); TVHITTESTINFO lpht = new TVHITTESTINFO (); lpht.x = point.x; lpht.y = point.y; OS.SendMessage (handle, OS.TVM_HITTEST, 0, lpht); if (lpht.hItem != 0) { if ((style & SWT.FULL_SELECTION) != 0 || (lpht.flags & OS.TVHT_ONITEM) != 0) { TVITEM tvItem = new TVITEM (); tvItem.mask = OS.TVIF_HANDLE | OS.TVIF_PARAM; tvItem.hItem = lpht.hItem; OS.SendMessage (handle, OS.TVM_GETITEM, 0, tvItem); return _getItem (lpht.hItem, tvItem.lParam); } } return null;
if (index < 0) error (SWT.ERROR_INVALID_RANGE); int hFirstItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_ROOT, 0); if (hFirstItem == 0) error (SWT.ERROR_INVALID_RANGE); int hItem = findItem (hFirstItem, index); if (hItem == 0) error (SWT.ERROR_INVALID_RANGE); TVITEM tvItem = new TVITEM (); tvItem.mask = OS.TVIF_HANDLE | OS.TVIF_PARAM; tvItem.hItem = hItem; OS.SendMessage (handle, OS.TVM_GETITEM, 0, tvItem); return _getItem (hItem, tvItem.lParam);
public TreeItem getItem (Point point) {	checkWidget ();	if (point == null) error (SWT.ERROR_NULL_ARGUMENT);	TVHITTESTINFO lpht = new TVHITTESTINFO ();	lpht.x = point.x;	lpht.y = point.y;	OS.SendMessage (handle, OS.TVM_HITTEST, 0, lpht);	if (lpht.hItem != 0) {		if ((style & SWT.FULL_SELECTION) != 0 || (lpht.flags & OS.TVHT_ONITEM) != 0) {			TVITEM tvItem = new TVITEM ();			tvItem.mask = OS.TVIF_HANDLE | OS.TVIF_PARAM;			tvItem.hItem = lpht.hItem;			OS.SendMessage (handle, OS.TVM_GETITEM, 0, tvItem);			return _getItem (lpht.hItem, tvItem.lParam);		}	}	return null;}