Results 1 to 5 of 5

Thread: MOUSE MOVING pls help me

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    10

    Angry

    Hi,

    i read all the posts about mouse moving in this board.
    The posts are really good.
    BUT...
    how can i make the mouse move not just
    from one point to another.
    I want the mouse to move from
    Point1 to Point2 to Point3 ...
    and then back to Point1 again.
    And then restart!

    Pls help me!
    I'm a newbie in VB-Coding!

    Thanks

    AbsoluteB

  2. #2
    Guest
    You can use the SetCursorPos or the mouse_event API to accomplish this.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    10

    Unhappy Well, Thanks

    Hmmmm

    ok

    Thank's

    Didn't I say that I'm a Newbie??

    ;(

    CU

    AbsoluteB

  4. #4
    Guest
    Saying you are a Newbie really cannot tell me your level of knowledge in a certain field.

    Anyhow, I can try to explain further. Below is the declaration for the Function. Paste it into a module. I have added the Sleep function as well to slow the process down

    Code:
    Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
    Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Put this code into a CommandButton on the Form

    Code:
    Private Sub Command1_Click()
    
    ' Make a loop to move the mouse
    For i = 1 To 300
        Sleep 10    ' Slow the process down by pausing for 10ms
        DoEvents    ' Make sure Windows doesn't freeze
        SetCursorPos 100 + i, 100 + i    ' Move the cursor to 100 + i
    Next i
    
    End Sub

  5. #5

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    10

    THANK YOU

    THANKS A LOT!!!

    You're great!!

    CU

    AB

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