Code:
Public Class frmClicker
Const MOUSEEVENTF_MOVE = &H1
Private Sub btnPosition_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPosition.Click
System.Threading.Thread.Sleep(2000)
txtX.Text = System.Windows.Forms.Cursor.Position.X
txtY.Text = System.Windows.Forms.Cursor.Position.Y
End Sub
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
'get the cursor handle
Me.Cursor = New Cursor(Cursor.Current.Handle)
Cursor.Position = New Point(Convert.ToInt32(txtX.text), Convert.ToInt32(txty.text))
End Sub
End Class
try using the framework as much as possible. api is good but use it when its absolutely neccessary.