BOOL CMyXxx::PreTranslateMessage(MSG* pMsg) { // If edit control is visible in tree view control, when you send a // WM_KEYDOWN message to the edit control it will dismiss the edit // control. When the ENTER key was sent to the edit control, the // parent window of the tree view control is responsible for updating // the item's label in TVN_ENDLABELEDIT notification code. if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) { CEdit* edit = m_TreeCtrl.GetEditControl(); if (edit) { edit->SendMessage(WM_KEYDOWN, pMsg->wParam, pMsg->lParam); return TRUE; } } // CXxxx can be a CFormView, Cdialog, or CPropertyPage class. return CXxxx::PreTranslateMessage(pMsg); }
BOOL CMyXxx::PreTranslateMessage(MSG* pMsg)
{
// If edit control is visible in tree view control, when you send a
// WM_KEYDOWN message to the edit control it will dismiss the edit
// control. When the ENTER key was sent to the edit control, the
// parent window of the tree view control is responsible for updating
// the item's label in TVN_ENDLABELEDIT notification code.
if (pMsg->message == WM_KEYDOWN &&
pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE)
{
CEdit* edit = m_TreeCtrl.GetEditControl();
if (edit)
{
edit->SendMessage(WM_KEYDOWN, pMsg->wParam, pMsg->lParam);
return TRUE;
}
}
// CXxxx can be a CFormView, Cdialog, or CPropertyPage class.
return CXxxx::PreTranslateMessage(pMsg);
}