Results 1 to 3 of 3

Thread: Can you tell me how to move ...

  1. #1

    Thread Starter
    Addicted Member killer_cobra's Avatar
    Join Date
    Jun 2001
    Location
    Lost in space
    Posts
    131

    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

  2. #2
    Fanatic Member rudvs2's Avatar
    Join Date
    Mar 2001
    Location
    NZ
    Posts
    935
    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


  3. #3

    Thread Starter
    Addicted Member killer_cobra's Avatar
    Join Date
    Jun 2001
    Location
    Lost in space
    Posts
    131

    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
  •  



Click Here to Expand Forum to Full Width