Results 1 to 4 of 4

Thread: Mouse movement emulation

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    6

    Mouse movement emulation

    I don't know if this is possible but any help will be appriciated.

    Is there a way to send mouse movements to an existing program? I want to send certain movements to an existing CAM program to control rotation.

    Thanks in advance,
    Wil

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    dunno if there is any other way, but if you want to actually move the cursor there is an API for that. Here's the VB6 declaration of it from the AllAPI program:

    Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long

    change Long to Integer and I think it should work
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    6
    That works fine for the movement. Is there a way to send the mouse focus to an application in other than the one that is sending the movements.

    I would search for it but I really don't know what to be searching for. Keywords would be a great help.

    Wil

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    hmm I'm not sure what you mean by sending the mouse focus to another app? If you want to send mouse click events though, try this...
    VB Code:
    1. Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
    2. Const MOUSEEVENTF_LEFTDOWN = &H2
    3. Const MOUSEEVENTF_LEFTUP = &H4
    4. Const MOUSEEVENTF_MIDDLEDOWN = &H20
    5. Const MOUSEEVENTF_MIDDLEUP = &H40
    6. Const MOUSEEVENTF_MOVE = &H1
    7. Const MOUSEEVENTF_ABSOLUTE = &H8000
    8. Const MOUSEEVENTF_RIGHTDOWN = &H8
    9. Const MOUSEEVENTF_RIGHTUP = &H10
    10.  
    11. Sub foo()
    12.       ' simulate a left click
    13.       mouse_event(MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
    14. End Sub
    That's again from the All-API program.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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