Mouse Control

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    #1

    Mouse Control

    Hi
    I want to move mouse by inputing the spot in vb6 means x an y axis will be given by using two textboxes and the mouse pointer will move to that point
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

    Declare these "API's:
    Suppose ur text boxes are txtX and txtY

    [code=vb]
    Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)

    Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long


    [/code]

    Write this code in txtX and txtY "Change" event or Lost Focus Event, of both:

    [code=vb]
    Mouse_Event &H1, Val(txtX.Text), Val(txtY.Text), 0, 0
    [/code]


    Regards
    Veena

    Comment

    Working...