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. WTL User Defined Message

WTL User Defined Message

Scheduled Pinned Locked Moved ATL / WTL / STL
questionc++hardwarehelp
7 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.
  • D Offline
    D Offline
    damir_tk
    wrote on last edited by
    #1

    Hi everybody. Can somebody please help me with this? I have a dialog that I use embedded in the tab control, that is on the main dialog. I want to send a user defined message (or is there a better way?) to notify the parent dialog to hide-show itself. How do I go about this? Thanks.

    I M 2 Replies Last reply
    0
    • D damir_tk

      Hi everybody. Can somebody please help me with this? I have a dialog that I use embedded in the tab control, that is on the main dialog. I want to send a user defined message (or is there a better way?) to notify the parent dialog to hide-show itself. How do I go about this? Thanks.

      I Offline
      I Offline
      Igor Vigdorchik
      wrote on last edited by
      #2

      You send a user defined message using SendMessage() or PostMessage(). You define a message using #define.

      D 1 Reply Last reply
      0
      • I Igor Vigdorchik

        You send a user defined message using SendMessage() or PostMessage(). You define a message using #define.

        D Offline
        D Offline
        damir_tk
        wrote on last edited by
        #3

        Thanks, I know that. But the parent dialog does not intercept the message, as I have REFLECT_NOTIFICATIONS defined, so it doesn't work.

        I 1 Reply Last reply
        0
        • D damir_tk

          Hi everybody. Can somebody please help me with this? I have a dialog that I use embedded in the tab control, that is on the main dialog. I want to send a user defined message (or is there a better way?) to notify the parent dialog to hide-show itself. How do I go about this? Thanks.

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          Define a message ID in the WM_APP range, like this:

          #define UWM_SHOW_HIDE_MAIN_WINDOW WM_APP

          Then in your child dialog:

          GetTopLevelParent().SendMessage(WM_APP, show_or_hide_flag);

          Or you could break it into two messages, one for showing and one for hiding. Handle UWM_SHOW_HIDE_MAIN_WINDOW in your main dialog's message map and show/hide the window accordingly.

          --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Ford, what's this fish doing in my ear?

          D 1 Reply Last reply
          0
          • D damir_tk

            Thanks, I know that. But the parent dialog does not intercept the message, as I have REFLECT_NOTIFICATIONS defined, so it doesn't work.

            I Offline
            I Offline
            Igor Vigdorchik
            wrote on last edited by
            #5

            Why don't you get rid of REFLECT_NOTIFICATIONS?

            D 1 Reply Last reply
            0
            • I Igor Vigdorchik

              Why don't you get rid of REFLECT_NOTIFICATIONS?

              D Offline
              D Offline
              damir_tk
              wrote on last edited by
              #6

              I can not, because I am using a derived class to embed my dialog class into the tab control, so I need to reflect the messages. Thanks.

              1 Reply Last reply
              0
              • M Michael Dunn

                Define a message ID in the WM_APP range, like this:

                #define UWM_SHOW_HIDE_MAIN_WINDOW WM_APP

                Then in your child dialog:

                GetTopLevelParent().SendMessage(WM_APP, show_or_hide_flag);

                Or you could break it into two messages, one for showing and one for hiding. Handle UWM_SHOW_HIDE_MAIN_WINDOW in your main dialog's message map and show/hide the window accordingly.

                --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Ford, what's this fish doing in my ear?

                D Offline
                D Offline
                damir_tk
                wrote on last edited by
                #7

                Thanks Mike, you are as helpful as always. I ran through all of your articles about WTL, but couldn't figure this GetTopLevelParent() out. Thank again.

                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