Use DragOver event of Treeview to detect the node you're dragging over:
Treeview's DragOver event:
LPARAMETERS oSource, nXCoord, nYCoord, nState
THIS.DropHighlight = THIS.HitTest((nXcoord-THIS.Left) * TreeFactorX, (nYCoord-THIS.Top) * TreeFactorY)
Don't forget to apply this code before using Drag'n'Drop because TreeView uses it's own unit of measurement called Twip.
#define cnLOG_PIXELS_X 88
#define cnLOG_PIXELS_Y 90
#define cnTWIPS_PER_INCH 1440
* 1440 twips per inch
local liHWnd, liHDC, liPixelsPerInchX, liPixelsPerInchY
* Declare some Windows API functions.
declare integer GetActiveWindow in WIN32API
declare integer GetDC in WIN32API integer iHDC
declare integer GetDeviceCaps in WIN32API integer iHDC, integer iIndex
* Get a device context for VFP.
liHWnd = GetActiveWindow()
liHDC = GetDC(liHWnd)
* Get the pixels per inch.
liPixelsPerInchX = GetDeviceCaps(liHDC, cnLOG_PIXELS_X)
liPixelsPerInchY = GetDeviceCaps(liHDC, cnLOG_PIXELS_Y)
* Get the twips per pixel.
TreeFactorX = cnTWIPS_PER_INCH/liPixelsPerInchX
TreeFactorY = cnTWIPS_PER_INCH/liPixelsPerInchY
Eugene