Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7963025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:30:47+00:00 2026-06-04T05:30:47+00:00

I have found some places that mention window messages are returned by GetMessage in

  • 0

I have found some places that mention window messages are returned by GetMessage in order of priority derived from the way they were sent with SendMessage being highest, than PostMessage and only than user input. However I couldn’t find any authoritative reference, i.e. from Microsoft, on this. The obvious page seems to explicitly deny it (says messages are processed in FIFO order with few exceptions) and I couldn’t find any other reference.

However I have an application behaviour of which suggests there are priorities (several WM_USER thread messages processed each second, yet clicks sometimes take many seconds to get processed). So I would like to know from an authoritative source how it is expected to behave so I can fix the application.

Note: The messages are sent with PostThreadMessage. I am watching messages comming out of GetMessage, so the non-queued messages don’t come into play here. A difference between thread and window messages possibly can.

Note: The application runs on WinCE, 5.0 in particular if it matters.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T05:30:48+00:00Added an answer on June 4, 2026 at 5:30 am

    Hans’s answer is not saying anything different than the linked MSDN documentation.

    Messages are processed in first-in, first-out order just like a standard queue, with a couple of special exceptions like WM_TIMER and WM_PAINT messages. Hans refers to this class of messages as those "synthesized from the window state"; MSDN just calls them out explicitly:

    With the exception of the WM_PAINT message, the WM_TIMER message, and the WM_QUIT message, the system always posts messages at the end of a message queue. This ensures that a window receives its input messages in the proper first in, first out (FIFO) sequence. The WM_PAINT message, the WM_TIMER message, and the WM_QUIT message, however, are kept in the queue and are forwarded to the window procedure only when the queue contains no other messages. In addition, multiple WM_PAINT messages for the same window are combined into a single WM_PAINT message, consolidating all invalid parts of the client area into a single area. Combining WM_PAINT messages reduces the number of times a window must redraw the contents of its client area.

    The catch is that messages sent with SentMessage are not queued, while those posted with PostMessage are. The same article on MSDN says as much in the next section:

    Nonqueued messages are sent immediately to the destination window procedure, bypassing the system message queue and thread message queue.

    […]

    Some functions that send nonqueued messages are BroadcastSystemMessage, BroadcastSystemMessageEx, SendMessage, SendMessageTimeout, and SendNotifyMessage.

    There are no "priorities". However, the behavior you describe is easily explained. Most likely, the WM_USER messages are sent by calls to the SendMessage function, which bypasses the message queue and sends the message directly to the window procedure for the destination window. That makes them appear to be processed with a higher "priority" because they’re processed immediately, before the SendMessage function returns, effectively bypassing the rest of the queue.

    That, in turn, explains why click events take longer to be processed—because they’re just shoved into the queue along with all of the other input messages, so the window doesn’t get around to processing them until after it handles the messages sent directly to it with calls to SendMessage.

    Important caveat: I know nothing about Windows CE, which your question indicates you’re talking about specifically. The behavior I describe here is accurate for desktop versions of Windows, but if there are any differences between that behavior and that of Windows CE, I wouldn’t know and I might have gotten something wrong.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a some code that gets passed a class derived from a certain
At some places, I have read that stacks grow from a higher address to
I'm hacking my way through learning Flex and have found some strange behaviour. When
Have done some research and found some stuff that may be helpful. I would
I have found that I often have to implement some sort of a scheduler
We have found that with our memcache some keys tend to be lost. To
Just random pick some methods that I have found: sforce.connection.describeSObject sforce.SearchResult sforce.sObject sforce.LeadConvert() sforce.connection.create()
I have done some profiling on a site and found that strtolower calls took
I have found some code snippet in the internet. But it is missing some
I have found some code on measuring execution time here http://www.dreamincode.net/forums/index.php?showtopic=24685 However, it does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.