How to get IDOK / IDCANCEL command message from an non-modal dialog set as client in CFrameWindowImpl?
-
Hello! I have a CTabViewImpl set as the client in a CFrameWindowImpl. I wonder how its possible to get WM_COMMAND messages from the active tab page's dialog. When I have the same dialog template used in a modal dialog, the IDOK and IDCANCEL buttons placed in the template generate the appropriate WM_COMMAND messages. However, when I use the dialog template as a page in the CTabViewImpl the WM_COMMAND messages are no longer generated. Usually a press on ESC oder RETURN generate the WM_COMMAND messages. Any way to have this mechanism work in embedded, non-modal dialogs too?
Happy coding, Philipp Kursawe
-
Hello! I have a CTabViewImpl set as the client in a CFrameWindowImpl. I wonder how its possible to get WM_COMMAND messages from the active tab page's dialog. When I have the same dialog template used in a modal dialog, the IDOK and IDCANCEL buttons placed in the template generate the appropriate WM_COMMAND messages. However, when I use the dialog template as a page in the CTabViewImpl the WM_COMMAND messages are no longer generated. Usually a press on ESC oder RETURN generate the WM_COMMAND messages. Any way to have this mechanism work in embedded, non-modal dialogs too?
Happy coding, Philipp Kursawe
-
Hello! I have a CTabViewImpl set as the client in a CFrameWindowImpl. I wonder how its possible to get WM_COMMAND messages from the active tab page's dialog. When I have the same dialog template used in a modal dialog, the IDOK and IDCANCEL buttons placed in the template generate the appropriate WM_COMMAND messages. However, when I use the dialog template as a page in the CTabViewImpl the WM_COMMAND messages are no longer generated. Usually a press on ESC oder RETURN generate the WM_COMMAND messages. Any way to have this mechanism work in embedded, non-modal dialogs too?
Happy coding, Philipp Kursawe
Hi Philipp, In your dialog message map add
FORWARD_NOTIFICATIONS()
to forward theWM_COMMAND
(and some other) messages to the dialog's parent, ie yourCTabViewImpl
based window.CTabViewImpl
in turn will forward (if not handled) the same messages to it's parent, seeCTabViewImpl
message map. cheers, ARWhen the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
-
Hi Philipp, In your dialog message map add
FORWARD_NOTIFICATIONS()
to forward theWM_COMMAND
(and some other) messages to the dialog's parent, ie yourCTabViewImpl
based window.CTabViewImpl
in turn will forward (if not handled) the same messages to it's parent, seeCTabViewImpl
message map. cheers, ARWhen the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
What I want to achieve is that my tabbed windows use the IsDialogMessage to behave as if they were dialogs. So I have implemented a handler for WM_FORWARDMSG in each of my tabviews windows. In my MainFrame I call tabview.PreTranslateMessage() which correctly forwards the message to the current active tab window. My CWindowImpl of each tab window has this: MESSAGE_HANDLER_EX(WM_FORWARDMSG, OnForwardMsg) LRESULT OnForwardMsg(UINT uMsg, WPARAM wParam, LPARAM lParam) return IsDialogMessage((LPMSG)lParam); } However, pressing the VK_RETURN or VK_ESCAPE key does not result in a WM_COMMAND message being sent to the tabviews window.
Happy coding, Philipp Kursawe
-
What I want to achieve is that my tabbed windows use the IsDialogMessage to behave as if they were dialogs. So I have implemented a handler for WM_FORWARDMSG in each of my tabviews windows. In my MainFrame I call tabview.PreTranslateMessage() which correctly forwards the message to the current active tab window. My CWindowImpl of each tab window has this: MESSAGE_HANDLER_EX(WM_FORWARDMSG, OnForwardMsg) LRESULT OnForwardMsg(UINT uMsg, WPARAM wParam, LPARAM lParam) return IsDialogMessage((LPMSG)lParam); } However, pressing the VK_RETURN or VK_ESCAPE key does not result in a WM_COMMAND message being sent to the tabviews window.
Happy coding, Philipp Kursawe
Sorry, I don't understand the relationship with your OP :(
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)