Solved

Cheching a button is enable or not and click on them

Posted on 2004-08-05
4
265 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
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

825 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