1、在BEGIN_MESSAGE_MAP添加MAP映射
cpp
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、添加头文件声明
cpp
LRESULT OnSysNormalMessage(WPARAM wParam, LPARAM lParam );
3、添加OnSysNormalMessage函数定义
cpp
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、调用
cpp
#define WM_SYS_NORMAL_MSG_SHOWLOG 0
SYS_PostNormalMsg( WM_SYS_NORMAL_MSG_SHOWLOG , NULL);