Quote:
First we will deal with those that have a class name of "Button". You will need only the window handle of the button and the following API calls.
SendMessage
WM_KEYDOWN
WM_KEYUP
VK_SPACE
Dim sButton As Long
Call SendMessage(sButton&, WM_KEYDOWN, VK_SPACE, 0&)
Call SendMessage(sButton&, WM_KEYUP, VK_SPACE, 0&)
As you can see, we are sending a window's message to the button. This message is a virtual key message which simulates the pressing of the space bar. You need to have the WM_KEYUP too though. Without it, the button is held down.
SendMessage
WM_LBUTTONDOWN
WM_LBUTTONUP
Dim dButton As Long
Call SendMessage(dButton&, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessage(dButton&, WM_LBUTTONUP, 0&, 0&)
As you can see, this is a little simpler than the last. We find our button, then instead of using virtual keys, we use the left mouse button constants.
/edit->