BOOL CXXXXDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if( pMsg->hwnd == GetDlgItem(IDC_EDITCHAT)->m_hWnd )
if( pMsg->message == WM_KEYDOWN )
if( pMsg->wParam == VK_RETURN )
{
MessageBox("Get IT");
// add you code here
return true;
}
return CDialog::PreTranslateMessage(pMsg);
}
{
// TODO: Add your specialized code here and/or call the base class
if( pMsg->hwnd == GetDlgItem(IDC_EDITCHAT)->m_hWnd )
if( pMsg->message == WM_KEYDOWN )
if( pMsg->wParam == VK_RETURN )
{
MessageBox("Get IT");
// add you code here
return true;
}
return CDialog::PreTranslateMessage(pMsg);
}
用SetWindowLong()
为这个Edit窗口设置自己的过程函数
在这个过程函数中
用case WM_KEDOWN:
if(wParam==VK_RETURN)
{
......
}