The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
The Fargo campus responds to Redmond’s December 2008 storm conditions
Apparently it's no big deal to them.
What is the mysterious fourth message box button?
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?
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
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...
The worms go in, the worms go out
Neuroscientist Daniel Levitin, author of This Is Your Brain on Music: The Science of a Human Obsession (another book in the Catchy title: Long boring subtitle category), explains why ABBA songs get stuck in your head. Meanwhile, the Earworm Research Institute has some tips on how to get them out.
Microspeak: Suited and booted
At Microsoft's consulting divisions, customer visits are a part of the job. A shorthand has developed to describe how formally dressed you should be at the meeting with the customer. (I leave it as an exercise to develop the comparable attire for women.) Note: This Microspeak entry was submitted by a colleague from the UK, so it may be peculiar to the UK dialect of Microspeak.
Today, we use a GPS to locate Baby Jesus
When Baby Jesus disappears from a Nativity scene, he might be wearing a tracking device: For two consecutive years, thieves made off with the baby Jesus figurine in Wellington, a town of 60,000 in Palm Beach County, Fla. The ceramic original, donated by a local merchant, was made in Italy and worth about $1,800... Last year, officials took a GPS unit normally used to track the application of mosquito spray and implanted it in the latest replacement figurine. After that one disappeared, sheriff's deputies quickly tracked it down. It's sad that the world has come to this, but nice to know that technology is ...
Why does the Explorer address bar reset itself while you’re typing into it?
When you ask Explorer to navigate to a new location, the steps go roughly like this (vastly oversimplified): Pretty straightforward, right? Well, commenter dhiren asks: Any idea why the address bar in Explorer randomly decides to reset itself while you're typing in it? It's not like Explorer is saying, "Ha, ha! Sucker!" Explorer is just doing its thing, following its happy little checklist, and when it finally locates the navigation target, it moves on to step three and switches the view and synchronizes the address bar to match the view. If you've messed with the address bar in the meantime, the s...
PDC 2008 notes: The aftermath
The Web page associated with my PDC 2008 talk has been updated to include the source code that I used for all of the demos. Other remarks: