The Old New Thing

You can extend the PROPSHEETPAGE structure with your own bonus data

... for when regular strength lParam just isn't enough. A little-known and even less-used feature of the shell property sheet is that you can hang custom data off the end of the structure, and the shell will carry it around for you. Mind you, the shell carries it around by means of and destroys it by just freeing the underlying memory, so...

Why does my TIME_ZONE_INFORMATION have the wrong DST cutover date?

Public Service Announcement: Daylight Saving Time begins in most parts of the United States this weekend. Other parts of the world may change on a different day from the United States. A customer reported that they were getting incorrect values from the function. I have a program that calls , and it looks like it's returning incorrect DST ...

What's the difference between FreeResource and, say, DestroyAcceleratorTable

MaxMax asks a number of resource-related questions, starting with "How do you Unlock a Lock­Resource?" and culminating in "What are the differences between and , , etc.? It would be much easier to use a single function instead of a collection of five." It helps if you understand the history of resources, because the functions were ...

The window manager needs a message pump in order to call you back unexpectedly

There are a bunch of different ways of asking the window manager to call you when something interesting happens. Some of them are are in response to things that you explicitly asked for right now. The enumeration functions are classic examples of this. If you call and pass a callback function, then that callback is called directly from the ...

Although the x64 calling convention reserves spill space for parameters, you don't have to use them as such

Although the x64 calling convention reserves space on the stack as spill locations for the first four parameters (passed in registers), there is no requirement that the spill locations actually be used for spilling. They're just 32 bytes of memory available for scratch use by the function being called. We have a test program that works ...

Why does WaitForMultipleObjects return ERROR_INVALID_PARAMETER when all the parameters look valid to me?

A customer asked for assistance with the function: I am getting when calling even though all the parameters are valid as far as I can tell. I've narrowed it down to this simple program. First of all, thank you for narrowing the issue down to a minimal program that illustrates the problem. You'd be surprised how often a customer says...

Shortcuts are serializable objects, which means that they can be stored in places other than just a file

It's true that the vast majority of the time, people consider the shell shortcut object as synonymous with the file it is normally saved into, shortcuts need not spend their time in a file. You can put a shortcut anywhere you can save a hunk of bytes. Here's a program that creates a shortcut to the file name passed on the command line (make ...

If an operation results in messages being sent, then naturally the target window must be processing messages for the operation to complete

If an operation includes as part of its processing sending messages, then naturally the target window for those messages must be processing messages (or more precisely, the thread which owns the target window must be processing messages) in order for the operation to complete. Why? Because processing messages is the only way a window can ...