Solved

Cheching a button is enable or not and click on them

Posted on 2004-08-05
4
269 Views
Last Modified: 2010-04-24
I am writing a program to control other applications.  I know how to get the handles to the top processes and the buttons in the applications. The question is how to determine whether the the buttons in other applications are enabled or not and if they are enabled I want to simulate a "click" on them (this is less important than finding whether it's enabled or not). Thanks for your help.
0
Comment
Question by:imagafx
[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
  • 2
  • 2
4 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 11733139
Having the button handle you can use IsWindowEnabled function.
0
 
LVL 1

Author Comment

by:imagafx
ID: 11733955
Alex, thanks for your help. And do you know to simulate a "click" on a button given the handle of that button? It's part of the question.
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 500 total points
ID: 11734405
int nID = GetDlgCtrlID(hButton);
HWND hParent = GetParent(hButton);

if ( hParent )
    PostMessage(hParent, WM_COMMAND,  nID, hButton);
0
 
LVL 1

Author Comment

by:imagafx
ID: 11741464
Alex, thanks a lot.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

635 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