如何模拟鼠标点击? [英] How to simulate mouse clicks?
问题描述
我想知道如何使用VB.NET创建一种自动答题器.
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.
先谢谢您了:)
推荐答案
See this discussion on social.msdn: Simulate a mouse click in a program.
使用winapi:SetCursorPos
,GetCursorPos
和mouse_event
.
Uses winapi: SetCursorPos
, GetCursorPos
and mouse_event
.
这篇关于如何模拟鼠标点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!