Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

sending mouse clicks to an application?

Posted on 2007-03-27
3
Medium Priority
?
245 Views
Last Modified: 2013-11-20
I'm using Windows XP.  I have an application that I need to start that does not have a COM interface.  After an initial setup, the application will occasionally need some mouse clicks (always the same spot relative to the application window).  What I need is to automatically send a mouse click to that spot.  I don't care if it does it repeatedly in a loop as clicking the area does nothing until the app enables it.

If I could get some small sample code on
1)  Getting a handle to the app (I will have to find the correct app based off of title bar information)
2)  How to send a mouse click to a particular spot relative to where the winapp is positioned
0
Comment
Question by:keenez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 16

Accepted Solution

by:
AlexNek earned 750 total points
ID: 18799562
Here is a godd sample, I think
http://www.codeguru.com/Cpp/W-P/win32/article.php/c4543/
You can send WM_MOUSEDOWN / WM_MOUSEUP to your window
 If you need to "press a button" then try to find the button's ID and send the owner window the WM_COMMAND message with that button's ID as the low word of the wParam and BN_CLICKED as the high word.
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 18801034
A completely different approach:
http://www.autoitscript.com/autoit3/
0
 
LVL 1

Expert Comment

by:i_mahesh
ID: 18805430
You can use SendInput Win32 API to achieve what you are looking for
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question