Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. How to get IDOK / IDCANCEL command message from an non-modal dialog set as client in CFrameWindowImpl?

How to get IDOK / IDCANCEL command message from an non-modal dialog set as client in CFrameWindowImpl?

Scheduled Pinned Locked Moved ATL / WTL / STL
hardwaretutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Philipp Kursawe
    wrote on last edited by
    #1

    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

    C A 2 Replies Last reply
    0
    • P 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

      C Offline
      C Offline
      Cool_Dev
      wrote on last edited by
      #2

      Then possibly you won't be getting WM_KEYDOWN messages in page. Are you getting it?

      modified on Friday, March 11, 2011 10:36 AM

      1 Reply Last reply
      0
      • P 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

        A Offline
        A Offline
        Alain Rist
        wrote on last edited by
        #3

        Hi Philipp, In your dialog message map add FORWARD_NOTIFICATIONS() to forward the WM_COMMAND (and some other) messages to the dialog's parent, ie your CTabViewImpl based window. CTabViewImpl in turn will forward (if not handled) the same messages to it's parent, see CTabViewImpl message map. cheers, AR

        When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)

        P 1 Reply Last reply
        0
        • A Alain Rist

          Hi Philipp, In your dialog message map add FORWARD_NOTIFICATIONS() to forward the WM_COMMAND (and some other) messages to the dialog's parent, ie your CTabViewImpl based window. CTabViewImpl in turn will forward (if not handled) the same messages to it's parent, see CTabViewImpl message map. cheers, AR

          When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)

          P Offline
          P Offline
          Philipp Kursawe
          wrote on last edited by
          #4

          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

          A 1 Reply Last reply
          0
          • P 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

            A Offline
            A Offline
            Alain Rist
            wrote on last edited by
            #5

            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)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups