|
-
Jul 17th, 2001, 10:44 PM
#1
Thread Starter
Addicted Member
Can you tell me how to move ...
Hi,
I'm getting used to VB now, but still do have the odd problem that I can't figure out. I need to know how to move a mouse cursor remotely over a UDP connection. I have this so far:
On the first form: 'in a timer function...
Dim Point as POINTAPI
Dim Crp as String
GetCursorPos Point
Text1.Text = Point.x ' Just to see the X-Y
Text2.Text = Point.y
Crp = Text1.Text +", "+Text2.Text
Winsock1.SendData Crp
An on the Second form:
Private Sub Winsock1_DataArrival()
Dim strData As String
Winsock1.GetData strData
txtOutput.Text = strData ' To make sure the X-Y made it
SetCursorPos strData
End Sub
But I get an error that the SetCursorPos "Argument not optional".
I would guess that I would have to somehow Use the Left and Right functions to extract the appropriate #'s ?
Or is there an easier way?
Any help is very much appreciated!!
Thanx a million,
Scott
-
Jul 17th, 2001, 10:58 PM
#2
Fanatic Member
okay that is because setcurserpos expects to seperate values not one value
you need to split strData into the seperate x and y coordinates and then pass them to the function as long variable types
-
Jul 17th, 2001, 11:11 PM
#3
Thread Starter
Addicted Member
Ok, so how do I split it?
I understand that I need to split the string up into 2 to give setcursorpos the proper number of arguments, but with a string that is constantly changing anywhere from 0,0 to 1024,768 how do I get the numbers left of the comma into one string and the numbers right of the comma into another seperate string?
Thanx again,
Scott
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
|