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. Sent Message

Sent Message

Scheduled Pinned Locked Moved C / C++ / MFC
data-structuresquestion
8 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.
  • S Offline
    S Offline
    sunit5
    wrote on last edited by
    #1

    The Messages which are post,they are synchronized due to message queue.What about the messages which are sent?

    never say die

    L 1 Reply Last reply
    0
    • S sunit5

      The Messages which are post,they are synchronized due to message queue.What about the messages which are sent?

      never say die

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I am not sure what you mean by synchronized. Window messages are placed into a FIFO stack and each message has a priority level. They are processed and removed from the stack based on location in the stack and priority level of the message type. This is a part of MS Windows that has evolved over the years, working slightly differently in older versions. However with that being said, currently in Windows XP and Windows Vista The Send* message functions bypass the standard message que and are pushed onto a seperate FIFO stack of nonqueued messages. These messages are processed with higher priority than messages which are in the standard message que. To read more about messages and message queues, the MSDN has an excellent article located here: http://msdn2.microsoft.com/en-us/library/ms644927.aspx[^] Best Wishes, -Randor (David Delaune)

      S 1 Reply Last reply
      0
      • L Lost User

        I am not sure what you mean by synchronized. Window messages are placed into a FIFO stack and each message has a priority level. They are processed and removed from the stack based on location in the stack and priority level of the message type. This is a part of MS Windows that has evolved over the years, working slightly differently in older versions. However with that being said, currently in Windows XP and Windows Vista The Send* message functions bypass the standard message que and are pushed onto a seperate FIFO stack of nonqueued messages. These messages are processed with higher priority than messages which are in the standard message que. To read more about messages and message queues, the MSDN has an excellent article located here: http://msdn2.microsoft.com/en-us/library/ms644927.aspx[^] Best Wishes, -Randor (David Delaune)

        S Offline
        S Offline
        sunit5
        wrote on last edited by
        #3

        By Synchronization I mean that if 2 threads post a message to a 3rd Thread (which is owning a window)then execution is synchronized that is which ever message comes first in the message queue is executed first.But in case of Send Message the thread directly call the WndProc , so how the synchronization takes place -- modified at 0:41 Thursday 20th September, 2007

        never say die

        S D L 3 Replies Last reply
        0
        • S sunit5

          By Synchronization I mean that if 2 threads post a message to a 3rd Thread (which is owning a window)then execution is synchronized that is which ever message comes first in the message queue is executed first.But in case of Send Message the thread directly call the WndProc , so how the synchronization takes place -- modified at 0:41 Thursday 20th September, 2007

          never say die

          S Offline
          S Offline
          sunit5
          wrote on last edited by
          #4

          I just read in the msdn Messages sent between threads are processed only when the receiving thread executes message retrieval code.May be the message retrieval code does the synchronization .If any body knows more than this please share it

          never say die

          1 Reply Last reply
          0
          • S sunit5

            By Synchronization I mean that if 2 threads post a message to a 3rd Thread (which is owning a window)then execution is synchronized that is which ever message comes first in the message queue is executed first.But in case of Send Message the thread directly call the WndProc , so how the synchronization takes place -- modified at 0:41 Thursday 20th September, 2007

            never say die

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

            Do you know what a message queue is?


            "A good athlete is the result of a good and worthy opponent." - David Crow

            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

            S 1 Reply Last reply
            0
            • S sunit5

              By Synchronization I mean that if 2 threads post a message to a 3rd Thread (which is owning a window)then execution is synchronized that is which ever message comes first in the message queue is executed first.But in case of Send Message the thread directly call the WndProc , so how the synchronization takes place -- modified at 0:41 Thursday 20th September, 2007

              never say die

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              The MSDN is somewhat misleading in that it states: "directly calls the WndProc" This is only true if the window belongs to the same thread executing SendMessage() In other words... if Thread1 executes SendMessage() to a window it owns, the WndProc is directly executed. If Thread1 executes SendMessage() to a window owned by Thread2, the message is placed into a seperate que. This special que contains messages of extreme high priority. This que is not the same as the standard message que. Hope it helps, -Randor (David Delaune)

              S 1 Reply Last reply
              0
              • L Lost User

                The MSDN is somewhat misleading in that it states: "directly calls the WndProc" This is only true if the window belongs to the same thread executing SendMessage() In other words... if Thread1 executes SendMessage() to a window it owns, the WndProc is directly executed. If Thread1 executes SendMessage() to a window owned by Thread2, the message is placed into a seperate que. This special que contains messages of extreme high priority. This que is not the same as the standard message que. Hope it helps, -Randor (David Delaune)

                S Offline
                S Offline
                sunit5
                wrote on last edited by
                #7

                Thanks a lot:-O

                never say die

                1 Reply Last reply
                0
                • D David Crow

                  Do you know what a message queue is?


                  "A good athlete is the result of a good and worthy opponent." - David Crow

                  "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                  S Offline
                  S Offline
                  sunit5
                  wrote on last edited by
                  #8

                  It is a thread specific message queue for GUI/non-GUI application. It stores the messages post by system or some other application.The thread retrieves the messages from its message queue using GetMessage or PeekMessage .If i m wrong somewhere pls rectify it.

                  never say die

                  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