I have a CEdit derived class and I am trying to catch the VK_RETURN and VK_ESCAPE in the ON_WM_KEYDOWN message handler. It does not seem to get called when pressing escape key or enter key. Any other key it gets called.
Any ideas?
I places a breakpoint at the switch, but it doesn't break there if escape or enter is pressed. It seems to break for all other keys though.Code:BEGIN_MESSAGE_MAP(ElcEdit, CEdit) //{{AFX_MSG_MAP(ElcEdit) ON_WM_KEYDOWN() //}}AFX_MSG_MAP END_MESSAGE_MAP() void ElcEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { switch(nChar) { case VK_ESCAPE: GetParent()->SendMessage(MsgEditCancelled, 0, 0); break; } }
Mike B




Reply With Quote