-
simluate mouse press
ive lloked through the forums and a code site but i cant find anything that helps me, how do i make a dos program that simulates the left mouse button being pressed, i know its possible with the keyboard (http://www.codeproject.com/system/ke...asp#xx848776xx) but im not sure with a mouse. im using borland free command line compiler with windows 98, if thats any help.
thx a lot for any help.
-
I don't believe that console applications can interact with a mouse.
-
You should be able to include windows.h and then call SendMessage. WM_LBUTTONDOWN and WM_RBUTTONDOWN are the events. What I'm sure of is what window you'd want to simulate the mouse click on.
-
-
ya microsoft suks at explaining things, i do a lot better with examples, they basically give me the syntaxt and some stuff you can put in there, and i cant understand how to do it right, ive searched the web and tried a few things but i cant figure out how to get this code to work, here it is.
VOID mouse_event(
DWORD dwflag,
DWORD dx,
DWORD dy,
DWORD dwData,
ULONG_PTR dwExtraInfo
);
can anyone just tell me how to fill thiss out?
-
ya microsoft suks at explaining things, i do a lot better with examples, they basically give me the syntaxt and some stuff you can put in there, and i cant understand how to do it right, ive searched the web and tried a few things but i cant figure out how to get this code to work, here it is.
VOID mouse_event(
DWORD dwflag,
DWORD dx,
DWORD dy,
DWORD dwData,
ULONG_PTR dwExtraInfo
);
can anyone just tell me how to fill thiss out? check out the mouse_event() link for some more info on it.^ ^
-
Google is often a good place to start when looking for sample code.
Code:
SetCursorPos(10, 10); /* Move the cursor to 10, 10 */
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); /* Left button down. */
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); /* Left button up. */