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

  • Home
  • SEARCH
  • 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 5940187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:56:01+00:00 2026-05-22T15:56:01+00:00

This is somewhat of a general question regarding Windows programming: Are Window messages "reliable"?

  • 0

This is somewhat of a general question regarding Windows programming:

Are Window messages "reliable"?

For example (these are just examples):

  • Can you be certain that a WM_MOUSEMOVE will happen before a cursor enters your screen?

  • Can you be certain that you will get a WM_DEVICECHANGE message if a device is inserted?

  • Can you be certain that you will receive a WM_KILLFOCUS message if your window loses focus?

Or, in other words: Can you be certain that you’ll get the appropriate message at the appropriate times, or do you always have to code defensively in case that, somehow, you might miss a message for no apparently documented reason?


Example:

  • It is guaranteed (AFAIK) that a file system filter driver will not "miss" a file operation or change notification.

  • By contrast, it is not guaranteed that ReadDirectoryChangesW will not miss a notification. In fact, it can miss quite a few if its buffer overflows.

Note:

I am not talking about a situation against an adversary (e.g. someone hijacking your window procedure or installing a hook/filter); that would pretty much invalidate any guarantee. I’m only asking about obscure situations that could really happen even if no one meant anything bad intentionally, like if some random buffer overflows, if someone uses SendInput, etc., assuming you have control of your own code.

  • 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-05-22T15:56:02+00:00Added an answer on May 22, 2026 at 3:56 pm

    No you cannot be certain that a given message will be delivered in a specific order. Here are a couple of reasons why not

    • Messages can be sent progamatically and this can be used to simulate “impossible” scenarios like a WM_KEYUP followed by a WM_KEYDOWN.
    • Another routine could sub-class your window and selectively intercept messages and not send them on to your WNDPROC

    It’s best to code defensively around any scenarios where ordering is important

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

Sidebar

Related Questions

This is somewhat of a general question, is it realistic to assume that a
This is somewhat of a follow-up question to this question . Suppose I have
This is somewhat asp.net MVC related only for example purposes but I was hoping
I know this is somewhat of a server question, but I wanted to ask
This is a somewhat low-level question. In x86 assembly there are two SSE instructions:
This is a somewhat bizarre question. My objectives are to understand the language design
[This question is somewhat related to this question , but the answers are not...]
Although somewhat related to this question , I have what I think is a
This may seem like a somewhat contrived example, but I'm left scratching my head.
This is a general kind of question. Very often, I need to write JavaScript

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.