Solved

sending mouse clicks to an application?

Posted on 2007-03-27
3
240 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 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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

737 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