
Non MFC modal dialogs in an MFC application - Dialog Message problem
I have an
MFC client application that is partly converted from a Win32 SDK
based application. The application consists of several modeless and modal
dialogs.
To be able to handle dialogmessages (Tab-key, dialog accellerators etc.) a
global HWND (hWndCurrent) has been created. This HWND is set equal to the
current windows HWND (or NULL) in response to WM_ACTIVATE (in the non MFC
dialogs). In my CWinApp::PreTranslateMessage i call IsDialogMessage() using
hWndCurrent.
This works fine in all cases exept when i open a non MFC modal dialog
(DialogBoxParam() function). If the user switches to a modeless dialog when
the modal dialog is still open CWinApp::PreTranslateMessage is not called.
The result is that the Tab-key, dialog accellerators etc stops working for
the modeless dialog. When the user closes the modal dialog the Tab-key,
dialog accellerators etc work fine.
With MFC based modal dialogs there is no problem.
Will I have to rewrite every non MFC modal dialog or can someone help me
with this?
I use:
Visual C++ 5.0
MFC 4.21
Jarle Jacobsen