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_DOWN As Integer = 8
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


 


Regards
Tushar Kapila
http://sel2in.in
http://tk.celladmin.com Mobile and regular computer web site for back pain and Exercise timer application
http://ksoft7.tripod.com/g2.html a good search page that allows you to search within any website uses google works best in Internet explorer and opera
http://minutes-alarm.sourceforge.net free ware windows minute alarm, easy reminder for back ache - stand up or meeting or call back

tushar.kapila@gmail.com yahoo : tushar.kapila@yahoo.com msn : tgkprog3@hotmail.com GTalk : tgkprog@gmail.com

Volunteer computer Cancer cures www.worldcommunitygrid.org
Click: www.thehungersite.com , and www.bhookh.com feed hungry , its free. www.ecologyfund.com
Please add these to your start-up how to: http://tusharkapila.blogspot.com/2007/07/when-i-think-all-of-100000s-of.html

No comments:

G
 
Forum
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.