cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Windows Programming
Handle of that particular button style a
Handle of that particular button style and caption
Jun 13, 2012 at 10:23am UTC
RIZWAN MODI
(6)
HI, In my project i receive style of the button(ex-Pushbutton) and caption of that button(ex-cancel) now i have to find the exact button and have to return the handle of button.. i need related examples ( buttons.)
Jun 13, 2012 at 2:35pm UTC
freddie1
(1838)
You need to have available at global scope the control id of the button such as you would have if it were defined like so ...
#define IDC_BUTTON 1500
Then, you would have set that control id in your CreateWindow() call that created the button. It would go in the HMENU parameter ...
... , (HMENU)IDC_BUTTON, ...
Then, to find the HWND of the button whose parent is hDialog, do this ...
HWND hButton=GetDlgItem(hDialog, IDC_BUTTON);
Topic archived. No new replies allowed.