How to Retrieve Mouse Cursor Coordinates in Visual BasicLast reviewed: June 21, 1995Article ID: Q114777 |
The information in this article applies to:
SUMMARYApplications such as Paint programs use functions from the Windows API (Application Programming Interface) to retrieve Mouse coordinates that in turn help the user design and paint their picture. This article shows by example how to use the Windows API GetCursorPos() function to retrieve the mouse coordinates from Visual Basic.
MORE INFORMATIONThe GetCursorPos() function returns a structure that contains the current position of the caret. To call the GetCursorPos() function from Visual Basic, you have to set up a Type structure. This is shown in the following example.
Step-by-Step Example
REFERENCES"Programming Windows: the Microsoft Guide to Writing Applications for Windows 3," Charles Petzold, Microsoft Press, 1990 "Microsoft Windows Software Development Kit" Reference Manuals and on-line help WINSDK.HLP file shipped with Microsoft Windows 3.0 Software Development Kit "Visual Basic Programmers Guide to the Windows API", Daniel Appleman, Ziff Davis Press, 1993
|
Additional reference words: 3.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |