vb.net mouse pointer click

VNote 2020.04.30 08:10:13 *:

Public Class Form1

    Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)

    Private Const MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move

    Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down

    Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up

    Private Const MOUSEEVENTF_MOVE = &H1 ' mouse move

    Private Const MOUSEEVENTF_MIDDLEDOWN = &H20

    Private Const MOUSEEVENTF_MIDDLEUP = &H40

    Private Const MOUSEEVENTF_RIGHTDOWN = &H8

    Private Const MOUSEEVENTF_RIGHTUP = &H10

    Dim MousePointMove As Point

    Dim myMouse_x As Integer

    Dim myMouse_y As Integer

    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

 

    End Sub

 

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

        Me.Cursor = New Cursor(Cursor.Current.Handle)

        Cursor.Position = New Point(100, 100)

        mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)

 

    End Sub

End Class