I was using the Mouse_Event
Function in Delphi 2009, but the Delphi documentation says this function has been superceded and to use SendInput
instead.
The Delphi SendInput
documentation defines the syntax and parameters, but there are no examples and it is not clear how to use the function. I've looked around on the web, and can't find any good Delphi examples.
Specifically, I am trying to simulate the left mouse down and then up. Currently I do this with Mouse_Event
as follows:
Mouse_Event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
Mouse_Event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
How would I do this using SendInput
?
Followup:
I ended up leaving my code as is as @David suggested.
But I gave @opc0de the answer since he did give an answer to my question. However, I can't vouch that it is correct, because I never did try it.