Respond to a BN_CLICKED notification which is sent to the button's parent in the form of a WM_COMMAND message. There are many examples of how to do this on this board but here it is again anyway:
Code:
case WM_COMMAND:
{
HWND hCntrl;
WORD wID,wNotify;
hCntrl=(HWND)lParam;
wID=LOWORD(wParam);
wNotify=HIWORD(wParam);
if (hCntrl)
{
/*notification is from a control*/
if (wNotify==BN_CLICKED)
{
/*the notification is a result of a button click*/
if (wID==identifier_of_your_button
{
/*button click came from button with id of
identifier_of_your_button*/
}
}
}
}
where identifier_of_your_button is, unsurprisingly, the identifier of your button control.
Since you seem to be doing a lot with controls just now, msdn: Windows Controls should be of considerable use to you. Please take the time to study the sections on the controls you are currently using: buttons, edits, toolbars, statusbars.
I expect the msdn: common dialogs will prove useful, too.