控件之间发送MW_NOTIFY,没有反应
我想在Button2中给Button1发送BN_CLICKED消息,但却没有反应,我的代码如下:
void CGfhDlg::OnButton2()
{
NMHDR hdr;
hdr.hwndFrom = ((CButton*)GetDlgItem(IDC_BUTTON1))->m_hWnd;
hdr.idFrom = IDC_BUTTON1;
hdr.code = BN_CLICKED;
SendMessage(WM_NOTIFY, (WPARAM)IDC_BUTTON1, (LPARAM)&hdr);
}
void CGfhDlg::OnButton1()
{
AfxMessageBox(_T(""));
}
不知道何解?