Solved

Cheching a button is enable or not and click on them

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DLL Windows equivalent in MAC OS 8 118
.NET Best Practice for SQLclient Connection String - Persist Security Info 4 299
Create a progress bar for timer 4 281
help with SQL 15 124
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…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…
A simple description of email encryption using a secure portal service. This is one of the choices offered by The Email Laundry for email encryption. The other choices are pdf encryption which creates an encrypted pdf of your email and any attachmen…

919 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

17 Experts available now in Live!

Get 1:1 Help Now