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. C / C++ / MFC
  4. Notify to all dialogs in my program

Notify to all dialogs in my program

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestionannouncement
7 Posts 4 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.
  • M Offline
    M Offline
    manchukuo
    wrote on last edited by
    #1

    hi guys I have an app that has some dialogs opened, is kind of storage system. When i update a price in a dialog i want the other ones to be notified of the change, is there a way to do this? I know that using messages is an option but how to signal all dialogs. Thanks :rolleyes:

    M D _ 3 Replies Last reply
    0
    • M manchukuo

      hi guys I have an app that has some dialogs opened, is kind of storage system. When i update a price in a dialog i want the other ones to be notified of the change, is there a way to do this? I know that using messages is an option but how to signal all dialogs. Thanks :rolleyes:

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #2

      You could implement a simple Observer[^] mechanism.

      Watched code never compiles.

      1 Reply Last reply
      0
      • M manchukuo

        hi guys I have an app that has some dialogs opened, is kind of storage system. When i update a price in a dialog i want the other ones to be notified of the change, is there a way to do this? I know that using messages is an option but how to signal all dialogs. Thanks :rolleyes:

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Are the dialogs modal or modeless. Do they have a common parent?

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Man who follows car will be exhausted." - Confucius

        M 1 Reply Last reply
        0
        • M manchukuo

          hi guys I have an app that has some dialogs opened, is kind of storage system. When i update a price in a dialog i want the other ones to be notified of the change, is there a way to do this? I know that using messages is an option but how to signal all dialogs. Thanks :rolleyes:

          _ Offline
          _ Offline
          _Superman_
          wrote on last edited by
          #4

          The application and all its dialogs can use RegisterWindowMessage[^] with the same string to get the same value. Now use SendMessage[^] and specify the hWnd parameter as HWND_BROADCAST and the Msg parameter as the value returned by RegisterWindowMessage.

          «_Superman_» I love work. It gives me something to do between weekends.
          Microsoft MVP (Visual C++)

          M 1 Reply Last reply
          0
          • D David Crow

            Are the dialogs modal or modeless. Do they have a common parent?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Man who follows car will be exhausted." - Confucius

            M Offline
            M Offline
            manchukuo
            wrote on last edited by
            #5

            some are modal and some not but there could be at the same time 1 or more modeless with a modal

            1 Reply Last reply
            0
            • _ _Superman_

              The application and all its dialogs can use RegisterWindowMessage[^] with the same string to get the same value. Now use SendMessage[^] and specify the hWnd parameter as HWND_BROADCAST and the Msg parameter as the value returned by RegisterWindowMessage.

              «_Superman_» I love work. It gives me something to do between weekends.
              Microsoft MVP (Visual C++)

              M Offline
              M Offline
              manchukuo
              wrote on last edited by
              #6

              thanks, They should all have the same parent window?

              _ 1 Reply Last reply
              0
              • M manchukuo

                thanks, They should all have the same parent window?

                _ Offline
                _ Offline
                _Superman_
                wrote on last edited by
                #7

                Broadcast is only sent to top level windows and not child windows.

                «_Superman_» I love work. It gives me something to do between weekends.
                Microsoft MVP (Visual C++)

                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