View Single Post
11-11-2007, 12:48 AM
#10
masfenix is offline masfenix
Status: Member
Join date: Mar 2006
Location: t.dot canaada
Expertise:
Software:
 
Posts: 182
iTrader: 1 / 100%
 

masfenix has a little shameless behaviour in the past

Send a message via AIM to masfenix

  Old

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.