?
Solved

How to get the button id from Window handle??

Posted on 2005-04-03
3
Medium Priority
?
221 Views
Last Modified: 2013-11-20
Hi All,

I have HWND instance of a button. Now I want to know how can I get the button id from that handle

Thanks
Sudhakar
0
Comment
Question by:sudhakar_koundinya
[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
3 Comments
 
LVL 9

Accepted Solution

by:
rcarlan earned 300 total points
ID: 13695027
int ::GetDlgCtrlID(HWND);

or

int CWnd::GetDlgCtrlID();

0
 
LVL 14

Author Comment

by:sudhakar_koundinya
ID: 13695040
So as you mentioned in this question,

http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_21374701.html#13694075

I can use GetDlgCtrlID method right??

Thanks
Sudhakar
0
 
LVL 9

Expert Comment

by:rcarlan
ID: 13695366
Should be OK, as long as the HWND you pass to GetDlgCtrlID corresponds to a child window (e.g. button). If it's not a child window, GetDlgCtrlID will most likely return 0 or -1.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Suggested Courses

762 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