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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. User Defined Messages - Value [modified]

User Defined Messages - Value [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionlearning
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.
  • C Offline
    C Offline
    Cliff Hatch
    wrote on last edited by
    #1

    The help files recommend that user messages be defined in the range WM_USER to 0x7fff, but opening the Resource Symbols dialog to create a new ID and letting it choose the value seems to work fine. Does anyone know if there is anything wrong with this? Best Regards Cliff Hatch -- modified at 14:42 Wednesday 24th May, 2006

    D M 2 Replies Last reply
    0
    • C Cliff Hatch

      The help files recommend that user messages be defined in the range WM_USER to 0x7fff, but opening the Resource Symbols dialog to create a new ID and letting it choose the value seems to work fine. Does anyone know if there is anything wrong with this? Best Regards Cliff Hatch -- modified at 14:42 Wednesday 24th May, 2006

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

      Cliff Hatch wrote:

      The help files recommend that user messages be defined in the range WM_USER to 0x7fff...

      It should be WM_APP.


      "The largest fire starts but with the smallest spark." - David Crow

      PJ ArendsP 1 Reply Last reply
      0
      • D David Crow

        Cliff Hatch wrote:

        The help files recommend that user messages be defined in the range WM_USER to 0x7fff...

        It should be WM_APP.


        "The largest fire starts but with the smallest spark." - David Crow

        PJ ArendsP Offline
        PJ ArendsP Offline
        PJ Arends
        wrote on last edited by
        #3

        Depends on the usage. If you are defining a message that will only be used within the application, then use WM_APP. If the message is for a control that could be used in other apps the use WM_USER. If it is a message that is used to communicate between different modules then use ::RegisterWindowMessage().


        You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!

        Within you lies the power for good; Use it!

        D 1 Reply Last reply
        0
        • PJ ArendsP PJ Arends

          Depends on the usage. If you are defining a message that will only be used within the application, then use WM_APP. If the message is for a control that could be used in other apps the use WM_USER. If it is a message that is used to communicate between different modules then use ::RegisterWindowMessage().


          You may be right I may be crazy -- Billy Joel -- Within you lies the power for good - Use it!

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

          PJ Arends wrote:

          If the message is for a control that could be used in other apps the use WM_USER.

          WM_USER should not be used at it can conflict with messages that Microsoft uses. RegisterWindowMessage() is the safest/preferred method in any case.


          "The largest fire starts but with the smallest spark." - David Crow

          C 1 Reply Last reply
          0
          • D David Crow

            PJ Arends wrote:

            If the message is for a control that could be used in other apps the use WM_USER.

            WM_USER should not be used at it can conflict with messages that Microsoft uses. RegisterWindowMessage() is the safest/preferred method in any case.


            "The largest fire starts but with the smallest spark." - David Crow

            C Offline
            C Offline
            Cliff Hatch
            wrote on last edited by
            #5

            Thanks guys. I can see that there is a problem if messages conflict, but what's puzzling me is why does it matter what the value is so long as it is unique - and if I use the Resource Symbols dialog to create it, doesn't that guarantee uniqueness? Is it a matter of standardisation and ease of maintenance perhaps? Best Regards Cliff

            1 Reply Last reply
            0
            • C Cliff Hatch

              The help files recommend that user messages be defined in the range WM_USER to 0x7fff, but opening the Resource Symbols dialog to create a new ID and letting it choose the value seems to work fine. Does anyone know if there is anything wrong with this? Best Regards Cliff Hatch -- modified at 14:42 Wednesday 24th May, 2006

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

              See Which message numbers belong to whom?[^]

              --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

              C 1 Reply Last reply
              0
              • M Michael Dunn

                See Which message numbers belong to whom?[^]

                --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

                C Offline
                C Offline
                Cliff Hatch
                wrote on last edited by
                #7

                Thanks Michael, that answers my question perfectly. :) Best Regards Cliff

                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