Solved

sending mouse clicks to an application?

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Starting up a Project

688 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