BOOL CCXXX::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN)
{
switch(pMsg->wParam)
{
case VK_RETURN://屏蔽回车
return TRUE;
case VK_ESCAPE://屏蔽Esc
return TRUE;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
{
if(pMsg->message == WM_KEYDOWN)
{
switch(pMsg->wParam)
{
case VK_RETURN://屏蔽回车
return TRUE;
case VK_ESCAPE://屏蔽Esc
return TRUE;
}
}
return CDialog::PreTranslateMessage(pMsg);
}
{
// TODO: Add your specialized code here and/or call the base class
//**Disable the esc key and enter key
if(pMsg->message==WM_KEYDOWN)
if(pMsg->wParam==VK_ESCAPE || pMsg->wParam==VK_RETURN)
return FALSE; return CDialog::PreTranslateMessage(pMsg);
}
{
// TODO: Add your specialized code here and/or call the base class
//**Disable the esc key and enter key
if(pMsg->message==WM_KEYDOWN)
if(pMsg->wParam==VK_ESCAPE || pMsg->wParam==VK_RETURN)
return FALSE; return CDialog::PreTranslateMessage(pMsg);
}
或者把改他的属性,去掉和回车相关的那个钩。