自动鼠标单击屏幕的特定区域

时间:2014-09-13 09:38:05

标签: vb.net

我想在VB.NET中创建一个软件,该软件会读取所有屏幕内容,并在特定时间间隔后点击特定位置。
任何人都可以帮助我如何启动它。

1 个答案:

答案 0 :(得分:0)

Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4

要设置光标位置,请使用SetCursorPos(x,y)xy是屏幕坐标。
点击:mouse_event(MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)

您可以在Visual Basic here中找到有关调用Windows API的更多详细信息。