Anyone can comment, so leave your views

Tuesday, December 18, 2007

Windows API mouse move and click, VB6 source code

_ Windows API Mouse Move & Click, VB6 Source Code  _

Option Explicit
Declare Function SetCursorPos& Lib "user32" (ByVal X As Long, ByVal Y As Long)
Declare 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

Const MOUSE_EVENT_F_LEFT_DOWN As Integer = 2
Const MOUSE_EVENT_F_LEFT_UP As Integer = 4
Const MOUSE_EVENT_F_RIGHT_UP As Integer = 16

Public Sub MouseClick()
   Dim X As Integer
    Dim Y As Integer
    X = 400 ' where to move and click the mouse
    Y = 300
Call SetCursorPos(X, Y)

'if slow PC need to add sleep or is it a blocking call ? - works so not an issue
Call mouse_event(MOUSE_EVENT_F_LEFT_DOWN, X, Y, 0, 0)
Call mouse_event(MOUSE_EVENT_F_LEFT_UP, X, Y, 0, 0)

End Sub


Tushar Kapila Mobile and regular computer web site for back pain and Exercise timer application a good search page that allows you to search within any website uses google works best in Internet explorer and opera free ware windows minute alarm, easy reminder for back ache - stand up or meeting or call back yahoo : msn : GTalk :

Volunteer computer Cancer cures
Click: , and feed hungry , its free.
Please add these to your start-up how to:

No comments:

Ads by google:

Source code, testing article - one stop shop Software applications written in Java for cell phones, PHP, Java Dot net, PHP & Perl for the web and Vb6, Java, VB6, Perl and Excel VBA for the desktop .

- Tushar G Kapila
Bangalore India 2007 © Remaining page can be removed if you save on your pc or server.