|
-
Nov 15th, 1999, 06:08 AM
#1
Thread Starter
Frenzied Member
Hello All,
I need a little hand in helping me to build something using a GetCursorPos Api. What Its gonna do is when the mouse clicks it will Put the cursor in a variable. But when I try to do this it screwed up, and it wont allow me to store the Variable info.
What I tried was this...
Dim IntCurPosNEW as long
IntCurPosNEW = GetCursorPos point
But when It did that it came up with a syntax error..
Anyhelp???
Thankyou much,
Evan
-
Nov 15th, 1999, 06:13 AM
#2
Hyperactive Member
Code:
Type POINTAPI
x As long
y As Long
End Type
Private Sub Command1_Click()
Dim z As POINTAPI
Call GetCursorPos(z)
MsgBox "X = " & z.x & vbCrLf & "Y = " & z.y
End Sub
That code is untested.
------------------
Tom Young, 14 Year Old
[email protected]
ICQ: 15743470 Add Me ICQ Me
AIM: TomY10
PERL, JavaScript and VB Programmer
-
Nov 15th, 1999, 06:33 AM
#3
take a look at This great site for VB usage examples and explanations.
------------------
Marty
-
Nov 17th, 1999, 11:20 PM
#4
Hyperactive Member
GetCursorPos Function
Declare Function GetCursorPos Lib "user32.dll" (lpPoint As POINT_TYPE) As Long
GetCursorPos reads the current position of the mouse cursor. The x and y coordinates of the cursor (relative to the screen) are put into the variable passed as lpPoint. The function returns 0 if an error occured or 1 if it is successful.
lpPoint
Receives the x and y coordinates of the mouse cursor.
Example:
' Display the coordinates of the mouse cursor
Dim coord As POINT_TYPE ' receives coordinates of cursor
Dim retval As Long ' return value
retval = GetCursorPos(coord) ' read cursor location
Debug.Print "The mouse is at:"; coord.x; coord.y
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
|