Article ID: 114777 - View products that this article applies to.
This article was previously published under Q114777
Applications 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.
The 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.
"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
Article ID: 114777 - Last Review: October 29, 2003 - Revision: 2.0
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Contact us for more help