hi friends
I have in my pocket how to use SetCursorPos & Mouse EVENT API usage.
But i want Mouse Click on given coordinates... Without moving Cursor
Means i can use Mouse Event API to generate Click
But cursor should stay where it is But click should be generated..
Lets take an example
Mouse Cursor is on Coordinates ( 100,100)
but i want to click at Coordinates (200,200) but cursor should keep on displaying at (100,100)
The only other way I can think of is to get the handle of the window or control at the position you want to click, you could use the WindowFromPoint API for that. Then send the WM_LBUTTONDOWN and WM_LBUTTONUP to that handle.
EDIT: BTW attached is a nice class I wrote that wraps the mouse_event and GetCursorPos. It's easy to use and you can specify point on the screen in pixels instead of absolute mouse coordinates. This could make it easy for you to move, click and the move back if you don't want to use the above mentioned approach.
Last edited by Joacim Andersson; May 12th, 2005 at 05:25 PM.