I've looked and looked to no avail...
How do I send a left mouse click via code?
Printable View
I've looked and looked to no avail...
How do I send a left mouse click via code?
not sure what you mean by SEND
if you wanna capture it
in mousedown of a contro/form
sorry if that didn't helpCode:if Button = 1 then
msgbox "you have clicked left button"
end if
No, not capture it..I want to essentially click the left mouse button, but using code...Not the mouse itself...
hmmm
you gotz to use apis for dis one
i think if you elaborate more on what your using this click for, i or someone else could help you come up with an alternative of doing it
sorry about first post, since i totally didn't get the question
Here is how to send a mouse click using the mouse_event api function.
Code: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)
Public Const MOUSEEVENTF_LEFTDOWN = &H2
Public Const MOUSEEVENTF_LEFTUP = &H4
Call mouse_event(MOUSEEVENTF_LEFTDOWN, 0&, 0&, 0&, 0&)
Call mouse_event(MOUSEEVENTF_LEFTUP, 0&, 0&, 0&, 0&)