CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2000
    Posts
    22

    Need an API function to repeat mouse click event.

    Hello everybody
    I'm searching for a solution to repeat mouse click event. It sounds stupid but I really nead it. My purpose is when user click mouse, it will switch to dblclick event automaticlly.
    I think SendMessage API function can do it, but I don't know how to use it in detail. Anyone can help me?
    Thanks for any suggestions.
    Trung


  2. #2
    Join Date
    Apr 2000
    Posts
    737

    Re: Need an API function to repeat mouse click event.

    you can also use PostMessage, since you say SendMessage, then we stick with SendMessage

    declare this :

    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_MBUTTONDBLCLK = &H209


    in the click event, put this

    SendMessage(me.hWnd,WM_MBUTTONDBLCLK,0,0)

    hope this help.

    cksiow
    http://vblib.virtualave.net - share our codes



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

Featured