문제

I'm trying to make a simple mouse macro program but i cannot figure out how to get the coordinates of the mouse outside of the form itself. I have tried with MousePosition and Cursor.Position but this only seems to take the coordinates inside the form.

I have looked around on the internet but most examples are to capture inside the form/application and the only similar question i found on StackOverflow was unanswered. VB.net -- Getting mouse coordinates outside the form

So, is the a simple way to capture the mouse coordinates outside of its own program? If not a simple way, could someone explain the complicated way a bit? I would really appreciate it!

도움이 되었습니까?

해결책

Assuming WinForms, you can try using just a timer:

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
  Me.Text = MousePosition.ToString
End Sub
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top