TAB and Escape keys are not working in windows created using CreateDialog
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
Hi, I have created modeless dialogs in MFC using CreateDialog() and dialog is successfully shown.
void ParentDialog::OnButton1()
{
// TODO: Add your control notification handler code here
HWND retcode = CreateDialogParam(NULL,
MAKEINTRESOURCE(IDD_DIALOG2),
NULL,
MainWndProc);
}In message handler, added the following
int APIENTRY MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{switch(uMsg) { case WM\_INITDIALOG: ShowWindow(hwnd, SW\_SHOW); UpdateWindow(hwnd); return TRUE; break; case WM\_COMMAND: if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { DestroyWindow(hwnd); return TRUE; } break; } return FALSE;
}
After dialogs are displayed, when I am pressing hot keys or escape from the child dialogs, it is not working. Please help me. Thanks in advance. Vinoth