Domanda

I was wondering how to create a sort of auto clicker using VB.NET.

I would basicly have the click coordinates pre-defined and the clicks, which would have to be separated by delays I guess since I want more than one to happen periodically, would happen outside of the application window (I read this envolves extra system hooks?).

The only code I have been able to find is related to clicks on the application window, which is not what I am looking for.

In short: I want to click a button on the app window, which would initiate a number of clicks on certain pre-defined screen coordinates.

Thanks in advance :)

È stato utile?

Soluzione

See this discussion on social.msdn: Simulate a mouse click in a program.

Uses winapi: SetCursorPos, GetCursorPos and mouse_event.

Altri suggerimenti

I believe you need to P/Invoke into Windows to accomplish this.

Have a look at the SendInput function.

If you are using automate the program,that program have some tabindex in order to relevant control.then you can use;

SendKeys.Send("{TAB}");
SendKeys.Send("{ENTER}");

it is more accurate on desktop application

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top