Messaging between CPropertySheet and CPropertyPage
Hi All,
It seems I must be missing something fundimental.
Generally: How to get a class to handle an event that originates in one of its members?
Specifically: I've got a CPropertySheet that has several CPropertyPage's. One of the CPropertyPage's has a button, but I need the BN_CLICKED message to be handled by the CPropertySheet.
Any help would me most appreciated.
Thanks in advance
Daniel
Re: Messaging between CPropertySheet and CPropertyPage
There are several ways you could do this:
1) Have the property sheet object give the page object a pointer to itself and then the page can callback some special method of the sheet.
2) From the page's handler of the BN_CLICKED notification you could resend the notification to the page's parent window (the sheet):
GetParent()->SendMessage(WM_COMMAND, MAKEWPARAM(BN_CLICKED, buttonID), (LPARAM)GetDlgItem(buttonID)->m_hWnd);