本文介绍了控制鼠标位置并点击SECOND监视器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要控制鼠标位置,然后在第二台显示器上的窗口中的按钮上单击鼠标。我已经尝试了几种控制鼠标位置和点击的方法,但还没有找到将鼠标发送到主监视器以外的任何监视器的方法。我正在使用Visual Basic(.NET 2015)。



我尝试过:



Private Sub OneClick_Click(发送者为对象,e为EventArgs)处理OneClick.Click



Dim Monitor As Object

Monitor = Screen.AllScreens(1).WorkingArea



SetCursorPos(299,299)

mouse_event(M_LEFTDOWN,0,0,0) ,0)

mouse_event(M_LEFTUP,0,0,0,0)



结束Sub

I need to control mouse position and click the mouse on buttons in a window on a 2nd monitor. I have tried several methods of controlling mouse position and clicking, but have not found a way to send the mouse to any monitor other than the primary monitor. I'm working with Visual Basic (.NET 2015).

What I have tried:

Private Sub OneClick_Click(sender As Object, e As EventArgs) Handles OneClick.Click

Dim Monitor As Object
Monitor = Screen.AllScreens(1).WorkingArea

SetCursorPos(299, 299)
mouse_event(M_LEFTDOWN, 0, 0, 0, 0)
mouse_event(M_LEFTUP, 0, 0, 0, 0)

End Sub

推荐答案


这篇关于控制鼠标位置并点击SECOND监视器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 19:55