943,701 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 3579
  • C++ RSS
Jan 14th, 2009
0

Moving the mouse cursor

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
giora88 is offline Offline
3 posts
since Jan 2009
Jan 14th, 2009
1

Re: Moving the mouse cursor

On windows the following code will move the mouse cursor.
C++ Syntax (Toggle Plain Text)
  1. #include <windows.h>
  2.  
  3. int main(void){
  4. SetCursorPos(50, 50);
  5. return 0;
  6. }
Of course you will want to play around with that. If you want more detail just ask

Chris
Reputation Points: 325
Solved Threads: 118
Master Poster
Freaky_Chris is offline Offline
702 posts
since Apr 2008
Oct 20th, 2011
-1
Re: Moving the mouse cursor
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 ?
Reputation Points: 7
Solved Threads: 0
Newbie Poster
asif123 is offline Offline
9 posts
since Oct 2011
Oct 20th, 2011
-1
Re: Moving the mouse cursor
Click to Expand / Collapse  Quote originally posted by asif123 ...
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.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in C++ Forum Timeline: Fib, Sequence Code help
Next Thread in C++ Forum Timeline: How to read the next line and stop at the next delimitor or the end of the line





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC