1、在BEGIN_MESSAGE_MAP添加MAP映射
BEGIN_MESSAGE_MAP(CdesktopTotalMapDlg, CDialogEx)
ON_MESSAGE(WM_SYS_NORMAL_MSG, OnSysNormalMessage)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON_SELECTSOURCEDIR, &CdesktopTotalMapDlg::OnBnClickedButtonSelectsourcedir)
ON_BN_CLICKED(IDC_BUTTON_SELECTDSTFILE, &CdesktopTotalMapDlg::OnBnClickedButtonSelectdstfile)
ON_BN_CLICKED(IDC_BUTTON_STARTMARGE, &CdesktopTotalMapDlg::OnBnClickedButtonStartmarge)
END_MESSAGE_MAP()
2、添加头文件声明
LRESULT OnSysNormalMessage(WPARAM wParam, LPARAM lParam );
3、添加OnSysNormalMessage函数定义
LRESULT CdesktopTotalMapDlg::OnSysNormalMessage(WPARAM wParam, LPARAM lParam )
{
switch (wParam)
{
case 0:
UpdateData(FALSE);
CEdit*pedit=(CEdit*)GetDlgItem(IDC_EDIT_SHOWLOG);
int nline=pedit-> GetLineCount();
pedit-> LineScroll(nline-1);
break;
}
return NULL;
}
4、调用
#define WM_SYS_NORMAL_MSG_SHOWLOG 0
SYS_PostNormalMsg( WM_SYS_NORMAL_MSG_SHOWLOG , NULL);
文章来源地址https://www.toymoban.com/news/detail-675096.html
文章来源:https://www.toymoban.com/news/detail-675096.html
到了这里,关于windows MFC消息demo的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!