|
-
Jul 6th, 2000, 08:38 PM
#1
Thread Starter
Junior Member
how can i simulate a mouse click with "SendMessage" ?
-
Jul 7th, 2000, 04:48 AM
#2
New Member
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
-
Jul 7th, 2000, 07:28 AM
#3
Thread Starter
Junior Member
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
|