|
-
Dec 11th, 2001, 01:11 AM
#1
Thread Starter
New Member
Mouse emulation
I need a way to have VB6 cause mouse clicks. I can move the mouse, but how do I emulate left, right, double clicks and click and drag?
I help people with disabilities in employment settings. One client can only press a single switch, so I present various choices to him as to what this switch will do. He clicks on the function he wants, such as what letter he wants to type, or where he wants the mouse to move to. But I do not know how to cause a click.
Any help would be appreciated. You can email me directly at [email protected].
Thanks,
Steve
-
Dec 11th, 2001, 07:23 AM
#2
Take a look at this link.
http://www.allapi.net/apilist/apifun...on=mouse_event
Incendently, I can find nothing on MouseEventEx, so play around with MouseEvent and see what that does for you.
-
Dec 11th, 2001, 02:14 PM
#3
Lively Member
you'll wanna use the SendMessage API with the WM_LBUTTONDOWN and WM_LBUTTONUP constants....
----
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
----
SendMessage hWnd&, WM_LBUTTONDOWN, 0&, 0&
SendMessage hWnd&, WM_LBUTTONUP, 0&, 0&
.... but before you do this, you need to get the handle (hWnd) of the window the mouse is over (the button, or whatever). If you dont know how to do this, lemme know...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|