Moving the mouse cursor

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2009
Posts: 3
Reputation: giora88 is an unknown quantity at this point 
Solved Threads: 0
giora88 giora88 is offline Offline
Newbie Poster

Moving the mouse cursor

 
0
  #1
Jan 14th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 671
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Moving the mouse cursor

 
0
  #2
Jan 14th, 2009
On windows the following code will move the mouse cursor.
  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
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC