Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.
AMouseObj()
This function, added in VFP 6, gives you information about the current position of the mouse pointer.
nFoundSomething = AMouseObj( Info [, nRelativeToForm ] )
Parameter |
Value |
Meaning |
Info |
Array Name |
The array to hold the results of the function. |
nRelativeToForm </td> | Omitted |
Return information about the mouse position relative to the container of the object over which the mouse is positioned. |
</tr>
1 (or any other value) |
Return information about the mouse position relative to the containing form. |
|
nFoundSomething |
4 |
The mouse is positioned over an object and the array has been filled with the information. |
0 |
The mouse is positioned over something that's not an object in the sense of this function and the array is unchanged. |
The function doesn't handle grids properly. When you call AMouseObj() with the mouse over a grid column (either the header or the control in the grid) and omit the second parameter, both object references point to the column. Sounds like somebody can't decide how deep to drill here. The GridHitTest method can help you work around this one. |
You need to release the array (or at least null the first two elements) before you can release the form. Otherwise, the references in the array prevent the form from being destroyed. |