Results 1 to 3 of 3

Thread: here's sumthing for the pro's

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Location
    Pembroke Dock, Pembrokeshire, Wales
    Posts
    10

    Post

    here's the deal:

    how do I create a prog that makes the computer think the the mouse has been moved and this must happen every 20 seconds. Any ideas?

  2. #2
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355

    Post

    Do you want to actually move it, (you can hide it), or just make the pc think it has, because the former is easy:

    use API viewer to get SetCursorPos

    then:

    SetCursorPos AnyNumber, AnyNumber

    Optionally, you can hide it with the API ShowCursor:

    ShowCursor False

    finally, put the SetCursorPos in a timer with interval 20 secs.

    Not sure if that's what u want, but soemone might find it useful
    buzzwords are the language of fools

  3. #3
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    You can use SetCursorPos API to move the cursor.
    Just add the Timer control to your form and set it's Interval property to 20000. Then place this code on Timer event of the Timer control:
    Code:
    Private Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long
    
    Private Sub Timer1_Timer()
        Dim x As Long
        Dim y As Long
        
        Randomize
        x = (Rnd * 9) * 100
        y = (Rnd * 9) * 100
        Call SetCursorPos(x, y)
    End Sub
    This will move the cursor to a different position every time the Timer event fires.

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