0
votes

In my MFC MDI application, I have CDockablePanes.

In CDockablePane's I have edit control and listcontrol.

For example, if the user is typing text in an edit control in the app, and presses the delete key, instead of deleting a character like normal, it sends the ID_EDIT_DELETE command to active view, causing the selected objects to be deleted. How can I fix this?

I think I need to override PreTranslateMessage, and check what window has focus before passing it on, but I really don't know what to do in PreTranslateMessage.

1

1 Answers

0
votes

I overrided the PreTranslatemessage function in CDockablePane derived class and added below code and it is working for me.

BOOL CMyDockablePane::PreTranslateMessage(MSG* pMsg) 
{

  if(IsDialogMessage(pMsg))
    return true;

return CDockablePane::PreTranslateMessage(pMsg);
}