Modeless Dialog Boxes
-
How can you stop a modeless dialog box from being deleting, when the escape key is pressed. I tried trapping the VK_ESCAPE message, but it still got destroyed. Can anyone help me?
-
How can you stop a modeless dialog box from being deleting, when the escape key is pressed. I tried trapping the VK_ESCAPE message, but it still got destroyed. Can anyone help me?
If you dont't want to overwrite all the func (OnCancel, OnOk, ... (and don't forget Alt+F4), you can overwrite the PreTranslateMessage func and try catching ESC, Return ... BOOL CSelectToolDlg::PreTranslateMessage(MSG* pMsg) switch (pMsg->message) { case WM_KEYDOWN: switch (pMsg->wParam) { case VK_RETURN: pMsg->wParam = 0; break; case VK_ESCAPE: pMsg->wParam = 0; break; } break; Hope this helps erni