Results 1 to 3 of 3

Thread: SendMessage

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    22

    Question

    how can i simulate a mouse click with "SendMessage" ?

  2. #2
    New Member
    Join Date
    Jul 2000
    Posts
    11
    I can never seem to get SendMessage to work for clicking a button. I use PostMessage and it works. Here is how I do it:

    Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    Public Const WM_LBUTTONDOWN = &H201
    Public Const WM_LBUTTONUP = &H202

    Public Sub ClickButton(hwnd As Long)
    PostMessage hwnd, WM_LBUTTONDOWN, 0, 0
    PostMessage hwnd, WM_LBUTTONUP, 0, 0
    End Sub

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2000
    Posts
    22

    Wink

    Thanks

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