The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Nov 10, 2009
Post comments count 0
Post likes count 1

I reorganized your kitchen for you, sweetie

Raymond Chen

I suspect most people are familiar with the It may be a mess, but it's my mess and I know where everything is phenomenon. That doesn't necessarily mean that items are in the best location, but at least you know which suboptimal location you chose. :: Wendy :: told me a story some time ago about something that happened while her parents were visiting. When she returned from work, her mother said, "Oh, Wendy, darling, I reorganized your kitchen for you. You had everything in the wrong place." Wendy's mother was trying to be helpful, but of course it was a net loss for poor Wendy, who couldn't find an...

Nov 10, 2009
Post comments count 0
Post likes count 1

Little-known command line utility: clip

Raymond Chen

Windows Vista includes a tiny command line utility called . All it does is paste its stdin onto the clipboard. For the opposite direction, I use a little perl script:

Nov 9, 2009
Post comments count 0
Post likes count 1

Stories of anticipating dead computers: Windows Home Server

Raymond Chen

Like most geeks, I have a bit of history with dead computers. In the past, I used the "wait until it breaks, and then panic" model, but recently I've begun being a bit more anticipatory, like replacing an old laptop before it actually expires. Anticipating another future dead computer, I bought an external USB hard drive for backing up important files, but upon reading the description on the box, I started to have second thoughts. It came with its own backup software that reportedly installed automatically when you plugged in the drive (!). I didn't want that; I just wanted a boring USB hard drive. One o...

Nov 9, 2009
Post comments count 0
Post likes count 1

How do I create a toolbar that sits in the taskbar?

Raymond Chen

Commenter Nick asks, "How would you go about creating a special toolbar to sit on the taskbar like the Windows Media Player 10 minimised toolbar?" You would look at the DeskBand API SDK Sample in the Windows Platform SDK. The magic word is DeskBand. This MSDN page has an overview. Bonus chatter: I've seen some online speculation as to whether a DeskBand counts as a shell extension, because of the guidance against writing shell extensions in managed code. As with all guidance, you need to understand the rationale behind the guidance so you can apply the guidance intelligently instead of merely following it ...

Nov 6, 2009
Post comments count 0
Post likes count 1

Signs that the symbols in your stack trace are wrong

Raymond Chen

One of the things programmers send to each other when they are trying to collaborate on a debugging problem is stack traces. Usually something along the lines of "My program does X, then Y, then Z, and then it crashes. Here is a stack trace. Can you tell me what's wrong?" It helps if you at least glance at the stack trace before you send it, because there are often signs that the stack trace you're about to send is completely useless because the symbols are wrong. Here's an example: We are testing our program and it gradually grinds to a halt. When we connect a debugger, we find that all of our threads, no ...

Nov 5, 2009
Post comments count 0
Post likes count 1

The day the coffee machine exploded

Raymond Chen

Some time ago, Microsoft began installing Starbucks coffee makers in the kitchens, and caffeine addicts waited anxiously for the machines to reach their building. Or at least that's what happened on the main Redmond campus. But what about the satellite offices? I'm told that each satellite office qualified for an iCup machine when the number of employees at the office reached some magic value. One of my colleagues who works at the office in New York City told me that they eagerly awaited the arrival of the machine when they learned that they reached that threshold. The long-anticipated day arrived: The coffee ...

Nov 4, 2009
Post comments count 0
Post likes count 1

In the product end game, every change carries significant risk

Raymond Chen

Exposure.

Nov 4, 2009
Post comments count 0
Post likes count 1

Good advice comes with a rationale so you can tell when it becomes bad advice

Raymond Chen

A customer asked for guidance in software design: Is there an issue with creating and using COM objects from a UI thread which was initialized as STA? I have heard that it is a best practice to create and use COM objects on a background thread which is MTA. I would like to have some more information as to why. Any help? (I still have trouble with the phrase best practice, especially when it is combined with the indefinite article: a best practice. It's like asking "Where is a tallest building?") Good advice comes with a rationale so you can tell when it becomes bad advice. If you don't understanding why somet...

Nov 3, 2009
Post comments count 0
Post likes count 0

When asked to choose among multiple options, the politician will pick all of them

Raymond Chen

During the run-up to a local election some time ago, the newspaper posed the same set of questions to each of the candidates and published the responses in a grid format so the readers could easily compare them. The candidates agreed on some issues, had opposing positions on others, but the question whose answers struck me was one of the form "If budget cuts forced you to eliminate one of the following four programs, which would you cut?" Notice that the first two candidates, when asked to make a tough decision, opted to make no decision at all. (Compare another election in which the mainstream candidates ra...