The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Jan 25, 2011
Post comments count 0
Post likes count 1

Why does the name of my TEMP directory keep changing?

Raymond Chen

A customer liaison contacted the shell team with the following request: Subject: Support case: 069314718055994 On two of my customer's machines, he's finding that if he opens %TEMP% from the Start menu, it opens C:\Users\username\AppData\Local\Temp\1, C:\Users\username\AppData\Local\Temp\2, and so on. Each time the user logs off and back on, the number increments. The number resets after each reboot. Why are we seeing these folders being created under Temp? This does not appear to be the default behavior. What would cause the operating system to create these folders? The customer rebuilt one of the affected m...

Jan 24, 2011
Post comments count 0
Post likes count 1

There's a default implementation for WM_SETREDRAW, but you might be able to do better

Raymond Chen

If your window doesn't have a handler for the message, then will give you a default implementation which suppresses messages for your window when redraw is disabled, and re-enables (and triggers a full repaint) when redraw is re-enabled. (This is internally accomplished by making the window pseudo-invisible, but that's an implementation detail you shouldn't be concerned with.) Although the default implementation works fine for simple controls, more complex controls can do better, and in fact they should do better, because that's sort of the point of . The intended use for disabling redraw on a window is in...

Jan 21, 2011
Post comments count 0
Post likes count 0

The 2011/2012 Seattle Symphony subscription season at a glance

Raymond Chen

Every year, I put together a little pocket guide to the Seattle Symphony subscription season for my symphony friends to help them decide which ticket package they want. As before, you might find it helpful, you might not, but either way, you're going to have to suffer through it. Here's the at-a-glance season guide for the first season with newly-appointed music director Ludovic Morlot. (Full brochure [pdf].) function filter(c) { var rows = document.getElementById("schedule").getElementsByTagName("TR"); for (var i = 0; i != rows.length; i++) { var row = rows[i]; var className = row.className; if (c...

Jan 21, 2011
Post comments count 0
Post likes count 1

Modality, part 9: Setting the correct owner for modal UI, practical exam

Raymond Chen

Here's a question that came from a customer. You can answer it yourself based on what you know about modal UI. (If you're kind of rusty on the topic, you can catch up here.) I've left in some irrelevant details just to make things interesting. Our program launches a helper program to display an Aero Wizard to guide the user through submitting a service request. There are no calls leading up to or returning from this call. the handles things nicely. When the user clicks "Cancel" to cancel the service request, we use a TaskDialog so we can get the new look for our confirmation message box. The task dial...

Jan 20, 2011
Post comments count 0
Post likes count 1

How to turn off the exception handler that COM "helpfully" wraps around your server

Raymond Chen

Historically, COM placed a giant around your server's methods. If your server encountered what would normally be an unhandled exception, the giant would catch it and turn it into the error . It then marked the exception as handled, so that the server remained running, thereby "improving robustness by keeping the server running even when it encountered a problem." Mind you, this was actually a disservice. The fact that an unhandled exception occurred means that the server was in an unexpected state. By catching the exception and saying, "Don't worry, it's all good," you end up leaving a corrupted server run...

Jan 19, 2011
Post comments count 0
Post likes count 1

Why didn’t they use the Space Shuttle to rescue the Apollo 13 astronauts?

Raymond Chen

Understanding decisions in the context of history.

Jan 18, 2011
Post comments count 0
Post likes count 1

Don't just stand around saying somebody should do something: Be someone

Raymond Chen

On one of the frivolous mailing lists in the Windows project, somebody spotted some behavior that seemed pretty bad and filed a bug on it. The project was winding down, with fewer and fewer bugs being accepted by the release management team each day, so it was not entirely surprising that this particular bug was also rejected. News of this smackdown threw the mailing list into an fit of apoplexy. Don't they realize how bad this bug is? Somebody should reactivate this bug. Yeah, this is really serious. I don't think they understood the scope of the problem. Somebody should mark the bug for reconsideration. D...

Jan 17, 2011
Post comments count 0
Post likes count 1

Was showing the column header in all Explorer views a rogue feature?

Raymond Chen

User :( asks whether the Explorer feature that shows the column headers in all views was a rogue feature or a planned one. If it was a rogue feature, it was a horribly badly hidden one. One of the important characteristics of the rogue feature is that you not be able to tell that the feature is there unless you go looking for it. If the feature is right there on the screen as soon as you open an Explorer window, odds are that somebody is going to notice and say something about it. (For example, the designer who is responsible for Explorer is probably going to notice that every screenshot of Explorer doesn't...

Jan 14, 2011
Post comments count 0
Post likes count 1

What's the difference between an asynchronous PIPE_WAIT pipe and a PIPE_NOWAIT pipe?

Raymond Chen

When you operate on named pipes, you have a choice of opening them in mode or mode. When you read from a pipe, the read blocks until data becomes available in the pipe. When you read from a pipe, then the read completes immediately even if there is no data in the pipe. But how is this different from a pipe opened in asynchronous mode by passing ? The difference is in when the I/O is deemed to have completed. When you issue an overlapped read against a pipe, the call to returns immediately, but the completion actions do not occur until there is data available in the pipe. (Completion actions are things l...