Results 1 to 3 of 3

Thread: Mouse emulation

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2001
    Location
    Colorado
    Posts
    12

    Cool 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

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    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.

  3. #3
    Lively Member
    Join Date
    Aug 2001
    Posts
    109
    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
  •  



Click Here to Expand Forum to Full Width