The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Then again, sometimes the improvement is merely incremental
Dec 25, 2008
Post comments count 0
Post likes count 0

Then again, sometimes the improvement is merely incremental

Raymond Chen
Raymond Chen

Several years ago, the security department sent out a company-wide memo: Over the next few months, we will be upgrading the card readers on all of our major campuses. The old card readers show a solid red light when the door is locked, whereas the new card readers show a blinking red light. Aw-right, a blinking light. Now we're cookin' with gas!

Foiled by my withered hand
Dec 24, 2008
Post comments count 0
Post likes count 0

Foiled by my withered hand

Raymond Chen
Raymond Chen

A few years ago, some email was sent out to the product team asking for a volunteer hand model to demonstrate how to open the Windows Vista box. Alas, I withdrew myself from consideration due to my withered hand.

Misheard lyrics as applied to Christmas songs
Dec 23, 2008
Post comments count 0
Post likes count 0

Misheard lyrics as applied to Christmas songs

Raymond Chen
Raymond Chen

While visiting my young nieces, we sang some Christmas songs, and when it came to sing Toyland, the four-year-old sang it with misheard lyrics: "Toi-let! Toi-let!"

Why isn’t there a SendThreadMessage function?
Dec 23, 2008
Post comments count 0
Post likes count 0

Why isn’t there a SendThreadMessage function?

Raymond Chen
Raymond Chen

Here's an interesting customer question: Windows has and . It also has but no . Why isn't there a function? Am I forced to simulate it with an event? What would this imaginary function do? Recall that delivers the message directly to the window procedure; the message pump never sees it. The imaginary function would have to deliver the message directly to.... what? There is no "thread window procedure" to deliver it to. Okay, maybe you still intend to process the thread message in your message pump, but you want the caller of the imaginary function to wait until you've finished processing the messag...

On 64-bit Windows, 32-bit programs run in an emulation layer, and if you don’t like that, then don’t use the emulator
Dec 22, 2008
Post comments count 0
Post likes count 0

On 64-bit Windows, 32-bit programs run in an emulation layer, and if you don’t like that, then don’t use the emulator

Raymond Chen
Raymond Chen

On 64-bit Windows, 32-bit programs run in an emulation layer. This emulation layer simulates the x86 architecture, virtualizing the CPU, the file system, the registry, the environment variables, the system information functions, all that stuff. If a 32-bit program tries to look at the system, it will see a 32-bit system. For example, if the program calls the function to see what processor is running, it will be told that it's running on a 32-bit processor, with a 32-bit address space, in a world with a 32-bit sky and 32-bit birds in the 32-bit trees. And that's the point of the emulation: To keep the 32-bit pr...

The Fargo campus responds to Redmond’s December 2008 storm conditions
Dec 22, 2008
Post comments count 0
Post likes count 0

The Fargo campus responds to Redmond’s December 2008 storm conditions

Raymond Chen
Raymond Chen

Apparently it's no big deal to them.

What is the mysterious fourth message box button?
Dec 19, 2008
Post comments count 0
Post likes count 0

What is the mysterious fourth message box button?

Raymond Chen
Raymond Chen

When you call the MessageBox function, you pass flags specifying which of a fixed set of button patterns you want (for example, Yes/No and OK/Cancel) and which button you want to be the default (MB_DEFBUTTON1 through MB_DEFBUTTON4.) Wait a second. What's with this MB_DEFBUTTON4? None of the button patterns are four-button patterns. The highest number of buttons you can specify is three: Abort/Retry/Ignore. How can you set a nonexistent button to be the default? Let's do some header file spelunking. The flag for this magical fourth button is defined here: #define MB_DEFBUTTON1 0x00000000L #def...

How do I obtain the computer manufacturer’s name?
Dec 18, 2008
Post comments count 0
Post likes count 0

How do I obtain the computer manufacturer’s name?

Raymond Chen
Raymond Chen

One customer wanted a way to determine the name of the computer manufacturer. For example, they wanted to make some function call and get back "IBM" or "Compaq" or "Dell". I don't know why they wanted this information, and for the moment, I don't care. And of course, when you're looking for information, you don't search MSDN; that's for crazy people. No, let's just fire up regedit and hit Ctrl+F. (I can't imagine how many application compatibility bugs were created by that "helpful" Ctrl+F dialog in regedit.) The customer found the registry keys that are used to customize the System control panel, as well as...

How to create a Zune podcast from an audiobook or other files you already have
Dec 17, 2008
Post comments count 0
Post likes count 0

How to create a Zune podcast from an audiobook or other files you already have

Raymond Chen
Raymond Chen

Here's a trick one of my friends taught me. The Zune has two styles of audio playback, one for music, and another for podcasts. For music, clicking right and left move you by song, and when you switch to another album, then come back to the first album, it starts you over at the beginning of the album. On the other hand, for podcasts, clicking right and left seeks through the episode, and when you return to a podcast, it resumes from where you left off. This is nice, because podcast episodes tend to be long, and the sequence is usually important. But what if you want the podcast behavior for songs? For exam...