| | |
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
Views: 19478 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays bash binarysearch centimeter char character convert copyanyfile copypdffile createcopyoffile createprocess() csyntax directory drawing dynamic executable feet fflush fgets file floatingpointvalidation fork frequency function getlasterror getlogicaldrivestrin givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o ide infiniteloop initialization interest intmain() kilometer lazy license linked linkedlist linux linuxsegmentationfault list match matrix meter microsoft multi mysql odf open openwebfoundation pattern pause pdf pointer pointers posix power program programming pyramidusingturboccodes read recursion recv recvblocked repetition scheduling segmentationfault send shape single socketprogramming spoonfeeding stack standard strchr string strings structures student suggestions system test testautomation unix urboc user voidmain() win32 win32api windows.h





