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
Printable View
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
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
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
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...
That's again from the All-API program.VB Code:
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) Const MOUSEEVENTF_LEFTDOWN = &H2 Const MOUSEEVENTF_LEFTUP = &H4 Const MOUSEEVENTF_MIDDLEDOWN = &H20 Const MOUSEEVENTF_MIDDLEUP = &H40 Const MOUSEEVENTF_MOVE = &H1 Const MOUSEEVENTF_ABSOLUTE = &H8000 Const MOUSEEVENTF_RIGHTDOWN = &H8 Const MOUSEEVENTF_RIGHTUP = &H10 Sub foo() ' simulate a left click mouse_event(MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) End Sub