• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

How to get the button id from Window handle??

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
sudhakar_koundinya
Asked:
sudhakar_koundinya
  • 2
1 Solution
 
rcarlanCommented:
int ::GetDlgCtrlID(HWND);

or

int CWnd::GetDlgCtrlID();

0
 
sudhakar_koundinyaAuthor Commented:
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
 
rcarlanCommented:
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

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now