CRichEdit自动添加的双击消息无响应

用:

BOOL CAaDlg::PreTranslateMessage(MSG *pMsg)
{
if( pMsg-> message == WM_LBUTTONDOWN ) 
{
HWND hWnd = ::GetFocus(); 
int iID = ::GetDlgCtrlID(hWnd); 
if(iID == IDC_RICHEDIT2) 

MessageBox( "RichEdit click! "); 



}


return CDialog::PreTranslateMessage(pMsg);
return TRUE;
}

重写该函数,先捕获消息,然后根据消息找到对应的ID

你可能感兴趣的:(CRichEdit自动添加的双击消息无响应)