how to simulate mouse movement and click

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2004
Posts: 2
Reputation: oujmjyu is an unknown quantity at this point 
Solved Threads: 0
oujmjyu oujmjyu is offline Offline
Newbie Poster

how to simulate mouse movement and click

 
1
  #1
Jun 26th, 2004
Hi,
I am creating a program that analyses a GUI within Windows XP environment.I am using Java to do all the Guis and other bits. Also, I use Java Native Interface to talk to Windows API. I am having a few problems. I need to make a mouse pointer move across on top of a program such as word, IE,etc in the windows XP environment and click a specified button.
How do I make a mouse move to a specified point and click?
eg, moveMouse(int x, int y);
IF you could give me tips, sample codes or working codes, that would be great.
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 436
Reputation: Chainsaw is an unknown quantity at this point 
Solved Threads: 11
Chainsaw's Avatar
Chainsaw Chainsaw is offline Offline
Unprevaricator

Re: how to simulate mouse movement and click

 
1
  #2
Jun 26th, 2004
If you know the window to send them to, you can use WM_MOUSEMOVE and WM_MOUSEACTIVATE. But you have to know the HWND. One way to do that is to use EnumWindows and EnumChildWindows to find the button in the app you are looking for.

Another approach is to pick an x,y and call WindowFromPoint() or ChildWindowFromPoint, and then with the HWND that returns, send IT the WM_MOUSEMOVE or WM_MOUSEACTIVATE.

Hope that gives you a starting point.
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2
Reputation: foolpanda is an unknown quantity at this point 
Solved Threads: 0
foolpanda foolpanda is offline Offline
Newbie Poster

Re: how to simulate mouse movement and click

 
1
  #3
Jun 29th, 2004
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2
Reputation: oujmjyu is an unknown quantity at this point 
Solved Threads: 0
oujmjyu oujmjyu is offline Offline
Newbie Poster

Re: how to simulate mouse movement and click

 
0
  #4
Jul 2nd, 2004
Thanks.. Let me try this and get back to you..

Man... There are so many good people other...
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