declare integer GetActiveWindow in WIN32API >declare integer GetDC in WIN32API integer iHDC >declare integer GetDeviceCaps in WIN32API integer iHDC,integer iIndex >* Device context >liHwnd=GetActiveWindow() >liHDC=GetDC(liHwnd) >* Pixels per Inch >liPixelsPerInchX=GetDeviceCaps(liHDC,88) >liPixelsPerInchY=GetDeviceCaps(liHDC,90) >* Twips per pixel and store >unLTVX=1440/liPixelsPerInchX >unLTVY=1440/liPixelsPerInchY>
procedure MouseMove(button, shift, x, y) >IF thisform.chkHotTracker.Value > oNode=this.HitTest(X*unLTVX,Y*unltvY) > if type('oNode.text')==[C] > this.NodeClick(oNode) > else > ENDIF >ELSE >ENDIF >ENDPROC>
oNode=THIS.HitTest(X*THISFORM.unLTVX,Y*THISFORM.unLTVY) IF TYPE('oNode.text')==[C] && TYPE('oNode.text') is 'U' messagebox('Got It!') && just did not get it ENDIFFourthly, I moved the HitTest code out of the MouseMove event and put it in a commandbutton, with the MouseMove event only storing the {x,y} co-ords in form's properties, and something even more peculiar happens. If the {x,y} values are within limit the 1st time around, then subsequent calls to HitTest() with very large values (e.g. 250*15,350*15) does not crash the app.
* MouseMove ... THISFORM.liX = x THISFORM.liY = y
* CommandButton1 ... LOCAL oNode oNode = THISFORM.tvPPP.OBJECT.HitTest(THISFORM.liX*THISFORM.unLTVX,THISFORM.liY*THISFORM.unLTVY) * or oNode = THISFORM.tvPPP.HitTest(THISFORM.liX*THISFORM.unLTVX,THISFORM.liY*THISFORM.unLTVY)I have tried this on 2 different machines, and the responses the same.