Tengo el siguiente problema con mouse_event move:
El mouse se mueve a la esquina de abajo a la derecha de la pantalla en vez de a sus coordenadas correctas.
Declaraciones:
Pruebas:
Alguna idea? Saludos y gracias!
El mouse se mueve a la esquina de abajo a la derecha de la pantalla en vez de a sus coordenadas correctas.
Declaraciones:
Código [Seleccionar]
Private Declare Function apimouse_event Lib "user32.dll" Alias "mouse_event" (ByVal dwFlags As Int32, ByVal dX As Int32, ByVal dY As Int32, ByVal cButtons As Int32, ByVal dwExtraInfo As IntPtr) As Boolean
<DllImport("user32.dll")>
Private Shared Sub mouse_event(dwFlags As UInteger, dx As UInteger, dy As UInteger, dwData As UInteger, dwExtraInfo As Integer)
End Sub
Pruebas:
Código [Seleccionar]
Private Sub Button1_Click_4(sender As Object, e As EventArgs) Handles Button1.Click
mouse_event(MouseEventFlags.MOUSEEVENTF_MOVE, Convert.ToUInt32(txtx3.Text), Convert.ToUInt32(txtx4.Text), 0, 0)
End Sub
Private Sub savex_Click(sender As Object, e As EventArgs) Handles savex.Click
txtx3.Text = x1.Text
txtx4.Text = x2.Text
End Sub
Private Sub NativeMethods_MouseMove(sender As Object, e As MouseEventArgs) Handles Me.MouseMove
x1.Text = MousePosition.X.ToString
x2.Text = MousePosition.Y.ToString
End Sub
Alguna idea? Saludos y gracias!