The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Feb 11, 2011
Post comments count 0
Post likes count 1

Any intelligent human being

Raymond Chen

The story of The Best reminded me of a classmate from school who was inordinately fond of the phrase any intelligent human being. For example, our classmate would say, "Any intelligent human being would do X" or "It's obvious to any intelligent human being that Y." (I often—but not always—consider myself to be an intelligent human being, yet sometimes the things "any intelligent human being" would do were things I personally wouldn't.) On the other hand, you wouldn't hear our classmate use the phrase in sentences like "I cannot comprehend how any intelligent human being would be fooled by&n...

Feb 11, 2011
Post comments count 0
Post likes count 1

How do specify that a shortcut should not be promoted as newly-installed on the Start menu?

Raymond Chen

Windows XP employed a number of heuristics to determine which Start menu shortcuts should be promoted when an application is newly-installed. But what if those heuristics end up guessing wrong? You can set the property to to tell the Start menu, "I am not the primary entry point for the program; I'm a secondary shortcut, like a help file."

Feb 10, 2011
Post comments count 0
Post likes count 1

Psychic debugging: Because of course when something doesn't work, it's because the program was sabotaged from above

Raymond Chen

When something stops working, you begin developing theories for why it doesn't work, and normally, you start with simple theories that involve things close to you, and only after you exhaust those possibilities do you expand your scope. Typically, you don't consider that there is a global conspiracy against you, or at least that's not usually your first theory. I'm trying to use the XYZ.DLL that comes with your product. I have successfully registered this DLL (as specified in the documentation) by performing a . According to the documentation, I should now be able to create a object, but when I try to do ...

Feb 9, 2011
Post comments count 0
Post likes count 1

Why does SHGetKnownFolderPath return E_FAIL for a known folder?

Raymond Chen

A customer reported having problems with the function. I've left in the red herrings. On Windows 7, I'm trying to retrieve the Internet folder with the following code: The call always fails with . What am I doing wrong? I tried passing as the token, but that didn't help. The reason the call fails has nothing to do with Windows 7 or the token. The call fails because is a virtual folder—there is no path in the first place! The reason is that the folder you are requesting is a virtual folder (KF_CATEGORY_VIRTUAL). Virtual folders don't exist in the file system, so they don't have a pat...

Feb 8, 2011
Post comments count 0
Post likes count 1

Microspeak: Recycling bits or recycling electrons

Raymond Chen

To recycle bits (or recycle electrons) is to take an old piece of email and use it to answer a similar (often identical) question or discussion on a mailing list. This is usually done by simply replying to the thread with the two-word message "Recycling bits" (or "Recycling electrons") and attaching the original email message. An important aspect of the use of this term is that the attached email message definitively answers the question or resolves the discussion. Usually, the attached email message comes from the very same mailing list that is hosting the current discussion. For example, consider this question...

Feb 7, 2011
Post comments count 0
Post likes count 1

The cursor isn't associated with a window or a window class; it's associated with a thread group

Raymond Chen

In my earlier discussion of the fact that changing a class property affects all windows of that class, commenters LittleHelper and Norman Diamond wanted to know "Why is the cursor associated with class and not a window?" This is another one of those questions that start off with an invalid assumption. The cursor is not associated with a class. The cursor is not associated with a window. The cursor is associated with an input state. (Initially, each thread has its own input state, but functions like can cause threads to share their input states.) As we saw when we explored the process by which the cursor ge...

Feb 4, 2011
Post comments count 0
Post likes count 0

The 2010 Niney Award nominees have been announced

Raymond Chen

The nominees for the first (annual?) Niney Awards have been announced. The Nineys are an award which recognizes those who have had the greatest impact on the technical/developer community over the past year. Winners are selected by you, the technical/developer community. The winners will be announced at the MIX11 conference in April. But before they can announce winners, they need to collect votes. That's where you come in. Cast your vote online in the following categories: Now, it so happens that among the nominees is an author of a somewhat unsucessful book on programming (not to be confused with an au...

Feb 4, 2011
Post comments count 0
Post likes count 1

Ready… cancel… wait for it! (part 3)

Raymond Chen

A customer reported that their application was crashing in RPC, and they submitted a sample program which illustrated the same crash as their program. Their sample program was actually based on the AsyncRPC sample client program, which was nice, because it provided a mutually-known starting point. They made quite a few changes to the program, but this is the important one: (It was actually more complicated than this, but this is the short version.) The program was crashing for the same reason that Wednesday's I/O cancellation program was crashing: The program issued an asynchronous cancel and didn't wait f...

Feb 3, 2011
Post comments count 0
Post likes count 1

I am no longer impressed by your fancy new 10,000 BTU hot pot burner

Raymond Chen

Two years ago, we had a gathering at my house for some friends for hot pot, the traditional way of ringing in the lunar new year (which takes place today). It was actually a bit of a cross-cultural event, since the attendees came from different regions of Asia, where different traditions reign. (And the American guests just had to choose sides!) My house has but one portable stove for hot pot, so one of the guests brought her own unit, a unit as it turns out which was purchased specifically for the occasion, which gleamed in the light and proudly proclaimed 10,000 BTU of raw heating power. This was cause for mu...