第一种,消息映射第二种,重写OnCommandBOOL CmfcdlgDlg::OnCommand(WPARAM wParam, LPARAM lParam){switch(wParam){case IDC_BUTTON1:{ MessageBox(_T("标题按钮"));}break;}return CDialogEx::OnCommand(wParam, lParam);}