 |
GetCursorPos Add comment W32 Constants Translate this page |
 |
 |
|
Retrieves the cursor"s position, in screen coordinates. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
BOOL GetCursorPos(
LPPOINT lpPoint // cursor position
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE SHORT GetCursorPos IN user32 STRING @ lpPoint
|
 |
 |
 |
| Parameters: |
 |
lpPoint
[out] Pointer to a POINT structure that receives the screen coordinates of the cursor. |
 |
 |
| Return value: |
 |
| If the function succeeds, the return value is nonzero. |
 |
 |
| My comment: |
 |
This function returns an absolute screen position.
Position the cursor with MOUSE AT , ; where x and y are local coordinates of VFP main window. After that read the cursor position with GetCursorPos function. That gives you a difference between local and global coordinates.
Put = INKEY(0.1) or any other delay between setting and reading the cursor position. It seems that without such delay VFP does not have enough time to inform the OS about mouse cursor repositioning. |
 |
 |
| Word Index links for the GetCursorPos : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2001-07-31 12:00:00 | | Modified: | 2001-11-26 16:02:47 | Visited in last 7 days: 60 |