The Old New Thing

The posted message queue vs the input queue vs the message queue

There are multiple ways of viewing the interaction between posted messages and input messages. MSDN prefers to view posted messages and input messages as part of one giant pool of messages in a message queue, with rules about which ones get processed first. I, on the other hand, prefer to think of posted messages and input messages as ...

What’s the point of SecureZeroMemory?

The function zeroes out memory in a way that the compiler will not optimize out. But what's the point of doing that? Does it really make the application more secure? I mean, sure the data could go into the swap file or hibernation file, but you need to have Administrator access to access those files anyway, and you can't protect yourself ...

Why don’t hotkeys for items on my Start menu work when I am in a fullscreen application?

You can set a hotkey on the shortcuts in your Start menu, and Explorer will launch that shortcut when you press the hotkey, but not if you are in a fullscreen application, like when you set Paint into fullscreen mode, or when you are displaying a PowerPoint presentation. Why are shortcut hotkeys ignored when a fullscreen application is running...

What are the scoping rules for variables in nested courtyards?

I dreamed that I had to fix a bug caused by variable redeclaration inside a nested courtyard. Had to move the horses out of the way first. And then it got weird. I won't go into the orchestra rehearsal that turned out to be just a recording played on a loudspeaker in an empty concert hall. Because you wouldn't believe that part...

Even though mouse-move, paint, and timer messages are generated on demand, it’s still possible for one to end up in your queue

We all know that the generated-on-demand messages like , , and messages are not posted into the queue when the corresponding event occurs, but rather are generated by or when they detect that they are about to conclude that there is no message to return and the generated-on-demand message can be returned. When this happens, the window ...