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. a question abt DispatchMessage

a question abt DispatchMessage

Scheduled Pinned Locked Moved C / C++ / MFC
questiondata-structures
5 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.
  • N Offline
    N Offline
    namaskaaram
    wrote on last edited by
    #1

    Dear all, I would like to know what the Dispatch message actually does?I havent quite understood what it does? does it send the message to the message queue? thanx!

    V N 2 Replies Last reply
    0
    • N namaskaaram

      Dear all, I would like to know what the Dispatch message actually does?I havent quite understood what it does? does it send the message to the message queue? thanx!

      V Offline
      V Offline
      voorugonda prashanth
      wrote on last edited by
      #2

      namasthe, Dispatch message will send the message to the corresponding applications window procedure. r u from AP??? Regards, Prashanth.v

      N 1 Reply Last reply
      0
      • N namaskaaram

        Dear all, I would like to know what the Dispatch message actually does?I havent quite understood what it does? does it send the message to the message queue? thanx!

        N Offline
        N Offline
        NiceNaidu fo
        wrote on last edited by
        #3

        The system automatically creates a message queue for each thread. If the thread creates one or more windows, a message loop must be provided; this message loop retrieves messages from the thread's message queue and dispatches them to the appropriate window procedures You create a message loop by using the GetMessage and DispatchMessage functions. // Start the message loop. while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0) { if (bRet == -1){ // handle the error and possibly exit } else{ TranslateMessage(&msg); DispatchMessage(&msg); } } // Return the exit code to the system. return msg.wParam; The DispatchMessage function dispatches a message to a window procedure. It is typically used to dispatch a message retrieved by the GetMessage function Appu.. "If you judge people, you have no time to love them."

        N 1 Reply Last reply
        0
        • N NiceNaidu fo

          The system automatically creates a message queue for each thread. If the thread creates one or more windows, a message loop must be provided; this message loop retrieves messages from the thread's message queue and dispatches them to the appropriate window procedures You create a message loop by using the GetMessage and DispatchMessage functions. // Start the message loop. while( (bRet = GetMessage( &msg, NULL, 0, 0 )) != 0) { if (bRet == -1){ // handle the error and possibly exit } else{ TranslateMessage(&msg); DispatchMessage(&msg); } } // Return the exit code to the system. return msg.wParam; The DispatchMessage function dispatches a message to a window procedure. It is typically used to dispatch a message retrieved by the GetMessage function Appu.. "If you judge people, you have no time to love them."

          N Offline
          N Offline
          namaskaaram
          wrote on last edited by
          #4

          what if tehre is no window for taht thread?...then?where does teh message go?...moreover how is routing the mesg to a particulatr window possible?....Dispatch Message has only one parameter.....???? cheerz!

          1 Reply Last reply
          0
          • V voorugonda prashanth

            namasthe, Dispatch message will send the message to the corresponding applications window procedure. r u from AP??? Regards, Prashanth.v

            N Offline
            N Offline
            namaskaaram
            wrote on last edited by
            #5

            what if the application has no window?....then? nope not from AP!.... thanx!

            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