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. What is the difference between GetMessage ,PeekMessage and PostMessage?

What is the difference between GetMessage ,PeekMessage and PostMessage?

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

    Regards nisha

    M C CPalliniC 3 Replies Last reply
    0
    • N nisha00000

      Regards nisha

      M Offline
      M Offline
      Manish K Agarwal
      wrote on last edited by
      #2

      GetMessage and PeekMessage are used to get a message from message queue while PostMessage is used to post a message. The major difference between GetMessage and PeekMessage is that GetMessage doesn't return until it finds a message to retrieve from the Message Queue and PeekMessage() returns immediately weather there are any messages or not. While PostMessage is used to post a message to window and it returns immediately without waiting for the response.

      Manish Agarwal manish.k.agarwal @ gmail DOT com

      1 Reply Last reply
      0
      • N nisha00000

        Regards nisha

        C Offline
        C Offline
        Cedric Moonen
        wrote on last edited by
        #3

        SendMessage :) Which the same as PostMessage except it blocks until the message has been processed by the window.

        Cédric Moonen Software developer
        Charting control [v1.5 - Updated] OpenGL game tutorial in C++

        1 Reply Last reply
        0
        • N nisha00000

          Regards nisha

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          Do you feel the documentation about [^] not satisfactory? :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          In testa che avete, signor di Ceprano?

          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