954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Moving the mouse cursor

Hello.

Is there a way to move to the mouse cursor on the screen using C or C++?
I am using windows vista and Microsoft visual studio 2008.
I am pretty new to C so I don't know much.

I have read previous threads which said that you need to use the windows library "windows.h" though when i copied the code the whole program won't compile saying it won't find it.

Can you please maybe give me a step by step guide?

Thank's a lot.
Giora

giora88
Newbie Poster
3 posts since Jan 2009
Reputation Points: 10
Solved Threads: 0
 

On windows the following code will move the mouse cursor.

#include <windows.h>

int main(void){
  SetCursorPos(50, 50);
  return 0;
}


Of course you will want to play around with that. If you want more detail just ask

Chris

Freaky_Chris
Master Poster
702 posts since Apr 2008
Reputation Points: 325
Solved Threads: 118
 

i want to move the cursor of mouse and select the icons using visual c++.
i m new to visual c++. can anyone help me plz ?

asif123
Newbie Poster
9 posts since Oct 2011
Reputation Points: 7
Solved Threads: 0
 
i want to move the cursor of mouse and select the icons using visual c++. i m new to visual c++. can anyone help me plz ?


Here's an idea: read the thread you're trying to hijack. It has your answer.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You