Results 1 to 3 of 3

Thread: [RESOLVED] Moving Mouse to a point and clicking it

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2009
    Posts
    127

    Resolved [RESOLVED] Moving Mouse to a point and clicking it

    I need code for Moving mouse from any point to coordinates 10,10 and click it.
    VB n00b with stupid questions
    Home site keywen.com

  2. #2
    PowerPoster motil's Avatar
    Join Date
    Apr 2009
    Location
    Tel Aviv, Israel
    Posts
    2,143

    Re: Moving Mouse to a point and clicking it

    this is the code, i hope it for a good use

    Code:
    Public Class Form1
        Declare Auto Function mouse_event Lib "user32.dll" (ByVal dwflags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal dwData As Integer, ByVal dwExtraInfo As Integer) As Integer
    
        Public Const MOUSEEVENTF_LEFTDOWN = &H2
        Public Const MOUSEEVENTF_LEFTUP = &H4
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          
        End Sub
    
        Private Sub cclick()
    
    
            Windows.Forms.Cursor.Position = _
            New System.Drawing.Point(10, 10)
    
    
    
            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
        
        End Sub
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            cclick()
    
        End Sub
    End Class
    Last edited by motil; Jul 28th, 2009 at 05:22 PM.
    * Rate It If you Like it

    __________________________________________________________________________________________

    "Programming is like sex: one mistake and you’re providing support for a lifetime."

    Get last SQL insert ID

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2009
    Posts
    127

    Re: Moving Mouse to a point and clicking it

    THAT’S WHAT I'M TALKING ABOUT THANK YOU!!!
    VB n00b with stupid questions
    Home site keywen.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width