|
-
Nov 21st, 2004, 12:25 AM
#1
Thread Starter
New Member
Simulate Mouse Click
I would like to simulate mouse clicks at fix coordinates without using api calls. Any1 any ideas?
-
Nov 21st, 2004, 02:52 PM
#2
I wonder how many charact
well, if you wanted to simulate it, you can do it this way.
You can simulate which mouse button, how many times the button was clicked, the x coodrinate, and the y coordinate, and the last parameter is the wheel rotation (which you should just leave at 0).
VB Code:
Form1_MouseDown(Nothing, New MouseEventArgs(MouseButtons.Left, 1, 150, 150, 0))
-
Nov 21st, 2004, 03:02 PM
#3
I wonder how many charact
Otherwise, this is a more technical way:
VB Code:
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Click
MessageBox.Show("Mouse clicked")
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim f As New Timer
f.Interval = 5000
f.Start()
AddHandler f.Tick, AddressOf Timer_Click
End Sub
Private Sub Timer_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim f As MouseEventArgs = New MouseEventArgs(MouseButtons.Left, 1, 40, 40, 0)
Me.InvokeOnClick(Me, f)
End Sub
-
Nov 22nd, 2004, 02:23 AM
#4
Thread Starter
New Member
thank you very much. but i should have been more specific. I want to do it to another window or the currently focused window. but that particular window has its process hidden. any idea? thanks in advance.
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
|