|
-
Sep 25th, 2000, 07:26 AM
#1
Thread Starter
Hyperactive Member
How do i capture the mouse position and write it into a label?
-RaY
VB .Net 2010 (Ultimate)
-
Sep 25th, 2000, 08:45 AM
#2
Junior Member
You must use GetCursorPos
'Put this on your module page
Type POINTAPI
x As Long
y As Long
End Type
Declare Function GetCursorPos Lib "user32.dll" (lpPoint As POINTAPI) As Long
'On your form page
Private Sub Command1_click()
Dim Coord as POINTAPI
GetCursorPos Coord 'get the cursor position
Debug.Print "X coord : " & Coord.x 'Show the x position
Debug.Print "Y coord : " & Coord.y 'Show the y position
End Sub
Enjoy !
-
Sep 25th, 2000, 10:44 AM
#3
Thread Starter
Hyperactive Member
Once again
I'm drawn back with vb3.0...there has to be a way to do it with user.dll, i tried rewriting yours but i get a duplicate procedure when it tries to call the function. Any ideas.
-RaY
VB .Net 2010 (Ultimate)
-
Sep 25th, 2000, 11:28 AM
#4
Junior Member
OOppss !!
I have missed "Public".
The right syntax is :
Public Declare Function GetCursorPos Lib "user32.dll" (lpPoint As POINTAPI) As Long
Re Enjoy!
-
Sep 25th, 2000, 02:54 PM
#5
That still wont work. "User32" is still for 32-bit platforms. Try changing it to
Code:
Declare Function GetCursorPos Lib "user.dll" (lpPoint As POINTAPI) As Long
Or
Code:
Declare Function GetCursorPos Lib "user16.dll" (lpPoint As POINTAPI) As Long
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|