Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to make the mouse cursor move??

Posted on 2000-02-23
2
Medium Priority
?
141 Views
Last Modified: 2013-11-20
how to create a random mouse cursor-mover??
please help
0
Comment
Question by:armansiu
  • 2
2 Comments
 
LVL 10

Accepted Solution

by:
RONSLOW earned 150 total points
ID: 2556220
use mouse_event
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2556250
like this...

int x = ... whatever;
int y = ... whatever;
mouse_event(MOUSEEVENTF_ABSOLUTE,x,y,0,0);

This will move the mouse to the given screen location.

If you want truly random movement, use rand() function and use SystemParametersInfo to get the size of the screen etc so you know the range of mouse positions available.

           
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Suggested Courses
Course of the Month12 days, 5 hours left to enroll

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question