Solved

sending mouse clicks to an application?

Posted on 2007-03-27
3
233 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
3 Comments
 
LVL 16

Accepted Solution

by:
AlexNek earned 250 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 85

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article will show, step by step, how to integrate R code into a R Sweave document
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 …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

706 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now