| | |
how to simulate mouse movement and click
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2004
Posts: 2
Reputation:
Solved Threads: 0
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.
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.
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.
![]() |
Similar Threads
- Mouse Movement is slow in VMware Guest OS (Windows NT / 2000 / XP)
- Sensing the mouse's movement (Visual Basic 4 / 5 / 6)
- Simulate Mouse Move (C++)
- Simulate Mouse Click (Visual Basic 4 / 5 / 6)
Other Threads in the C Forum
- Previous Thread: Need help on a program (function bug)
- Next Thread: 10, 20, 0
| Thread Tools | Search this Thread |
adobe ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork frequency getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o ide inches infiniteloop initialization interest kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer pointers posix power probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape single socketprograming socketprogramming stack standard strchr string strings suggestions systemcall test testautomation unix urboc user voidmain() wab win32api windows.h





