The message is sent to the parent window's parent window
Time:10-10
Window a parent-child relationship is as follows: Dialog - & gt; The button Button to dynamically create, in the dialog box member variables have a CButton object associated with it, add button BN_CLICKED message response function, normal response Parent-child relationships to the following: Dialog - & gt; Group box - & gt; The button Response function is added in the dialog box class, there is no response, the group box cut away the news? If so, how to deal with, don't want to put the group box to inherit a subclass, and then the message map Is there any way to the news of the group box turn again to the dialog
CodePudding user response:
Sendmessage to the window need to send a message,
CodePudding user response:
Either you don't set the CButton father to grouping, control notification will only be passed to the parent class, you can set CButton father for Dialog box, or you in the combo box after receiving the BN_CLICKED forwarded to Dialog, through pDialog - & gt; SendMessage (WM_COMMAND, MAKEWPARAM (IDC_BUTTON, BN_CLICKED), 0).