Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to find a way to do mouse actions in java.

Can someone pls tell me how to move the mouse to a particular point on the screen using c++.I found a class named "Robot" of the awt package in java that serves my purpose..but the problem is that my project is in c++ and so i need a way to do the same job in c++.

Can someone tell me some classes, functions, etc. that would allow me to move and click the mouse.

P.S. I am not looking for detecting mouse events...
Posted
Comments
Sergey Alexandrovich Kryukov 19-Mar-12 11:34am    
Why?!
--SA

What is this? you are trying to move the cursor using C++ code in Java application?

WHY?

Only Idea I can come up with is to trigger the Java Application and let that one do the cursor move: Google on "Java moving cursor"[^]
 
Share this answer
 
Comments
Anirudh sundar 19-Mar-12 11:19am    
Its a c++ application...not a java application....i just wanted a class in c++
that did the same function as Robot class in java
Hi, You can use SetCursorPos function for positioning mouse.
and mouse_event function can be used for mouse event.
 
Share this answer
 
Comments
blacklabel01_ 18-Jan-13 12:56pm    
hello I am just new in c++ programming language and I have been using VC++ 2008 , I just want to ask if there are any code of example of mouse clicked , left or right, console application ...I was confused of some code/function in windows.h and I don't understand how to use each function and variables ... I am looking for this, for the sake of my grade bcoz my grade depend on our project ... thank you ...
[no name] 20-Jan-13 10:51am    
Yes, SetCurPos and mouse_event function are win32 api.
and we can also use those apis in console app.
So we can make mouse click in console app,programatically.
Thanks.
[no name] 20-Jan-13 10:52am    
And for those apis, you can reference MSDN or some forums.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900