现有:
窗口A,里面有button1,按钮事件是AfxMessageBox(L"我是窗口A的按钮");
窗口B,里面有button1。按钮事件是AfxMessageBox(L"我是窗口B的按钮");
使用以下代码将button1发送到窗口B里面去:
this->GetDlgItem(IDC_BUTTON1)->SetParent(FromHandle(hwnd_B));
已经成功将窗口A的button1发送到窗口B中!
但为何发送过去之后的button1事件失效了?窗口B中的两个button都是执行AfxMessageBox(L"我是窗口B的按钮");的代码?
应该如何写代码,让发送过去的按钮依然执行"我是窗口A的按钮"?