• Advertisement

Archived

This topic is now archived and is closed to further replies.

Moving the cursor in C

This topic is 5505 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I looked around the net but couldn''t find anything that really answered my question. By using C is there some call I can make in my program to move the mouse cursor by a set amount on the x or y axis under windows? for example if I want to move the cursor 1 pixle to the left I would want to call something like: mouse_move_X(1,0); or something along those lines. Can I also send a mose click command to windows too? I have to following included: #include <windows.h> #include <stdio.h> slip thanks in advance

Share this post


Link to post
Share on other sites
Advertisement

SetCursorPos


The SetCursorPos function moves the cursor to the specified
screen coordinates. If the new coordinates are not within the
screen rectangle set by the most recent ClipCursor function,
the system automatically adjusts the coordinates so that the
cursor stays within the rectangle.


BOOL SetCursorPos(
int X, // horizontal position
int Y // vertical position
);

- Andy Oxfeld

[edited by - AndyOxfeld on December 25, 2002 10:46:42 PM]

[edited by - AndyOxfeld on December 25, 2002 10:47:04 PM]

Share this post


Link to post
Share on other sites
Cool thanks for that. I''ve got it working nice.
what about sending a mouse click command?
slip
thanks again

Share this post


Link to post
Share on other sites

  • Advertisement