I would like to simulate mouse clicks at fix coordinates without using api calls. Any1 any ideas?
Printable View
I would like to simulate mouse clicks at fix coordinates without using api calls. Any1 any ideas?
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))
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
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.