|
-
Apr 26th, 2004, 07:07 PM
#1
Thread Starter
New Member
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
-
Apr 26th, 2004, 08:26 PM
#2
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!!
-
Apr 27th, 2004, 07:42 PM
#3
Thread Starter
New Member
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
-
Apr 28th, 2004, 01:45 AM
#4
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:
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
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|