|
-
January 21st, 2000, 02:23 PM
#1
HOW TO: Simulate/force mouse click...
Does anyone have any idea? Workaround, hints, etc...
I tried using PostMessage() but that does not seem to work.
--maciej
-
January 21st, 2000, 02:32 PM
#2
Re: HOW TO: Simulate/force mouse click...
Use the Mouse_Event API, ie.
private Declare Sub mouse_event Lib "user32" (byval dwFlags as Long, byval dx as Long, byval dy as Long, byval cButtons as Long, byval dwExtraInfo as Long)
private Const MOUSEEVENTF_LEFTDOWN = &H2
private Const MOUSEEVENTF_LEFTUP = &H4
private Sub Command1_Click()
Call mouse_event(MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
End Sub
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
February 2nd, 2000, 08:15 AM
#3
Re: HOW TO: Simulate/force mouse click...
First get the handle for the object you want to click. You can use functions like "findwindow", "getwindow"... ONce you get the window, use the API "sendmessage". Here is an example:
call sendmessage(buttonhWnd%, WM_LBUTTONDOWN, 0&, 0&)
call sendmessage(buttonhWnd%, WM_LBUTTONUP, 0&, 0&)
that should click an object. hope it helped!
-Will [email protected]
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
|