What I want to do is to manipulate the mouse. It will be a simple macro for my own purposes. So it will move my mouse to certain position on the screen and click like I am clicking with certain interval.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s a code that is using unmanaged functions to simulate mouse clicks :
To keep the mouse pressed for a specific duration you can
Sleep()the thread that is executing this function, for example :The above code will keep the mouse pressed for 1 second unless the user presses the releases the mouse button. Also, make sure to not execute this code on the main UI thread as it will cause it to hang.