The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Sep 16, 2008
Post comments count 0
Post likes count 1

The purpose of charts is normally to make information easier, not harder, to understand

Raymond Chen

In a presentation a few years ago, there was a pie chart, but not just any pie chart, but a pie chart that appeared to be specifically designed to convey no information whatsoever. (The presenter didn't realize this, of course, and probably thought it was awesomely cool.) The pie chart consisted of five wedges, each of which was a slightly different shade of green. No, wait, that's not right. Each wedge was a gradient from a common shade of green to a slightly different shade of green for each wedge. Accompanying the chart was a legend that described what each shade of green represented. It was completely usele...

Sep 15, 2008
Post comments count 0
Post likes count 1

I no longer have to remind the payroll department to gear up for annual raises

Raymond Chen

September 15 is the date on which annual raises take effect. This means that on the 15th, the payroll servers are swamped with people eyeballing their new paycheck breakdown to see what has changed. And every year, on September 15th, the servers would become overloaded and people would be unable to connect. Instead they'd get a message like this: Due to unexpectedly high demand, the payroll servers are unable to service your request. Please try again later. We apologize for the inconvenience. Unexpectedly high demand? This happens every year on exactly the same date! How could it be unexpect...

Sep 12, 2008
Post comments count 0
Post likes count 1

The terms of service you have to accept before you can see them

Raymond Chen

I had a few hours to kill at the airport a few years ago before my flight was ready for boarding, so I turned on my laptop and connected to the airport's wireless network. Like most pay services, they way you sign up is to fire up a web browser and go to any web site. Regardless of what site you go to, you are redirected to the "Here's how to buy a day's worth of wireless networking" site. So far so good. At the sign-up page, they asked for the usual information and also had a reminder that signing up for the service implies that you have read and accepted their terms of service. There was a link to their te...

Sep 12, 2008
Post comments count 0
Post likes count 1

Who is responsible for destroying the font passed in the WM_SETFONT message?

Raymond Chen

The message tells a control which font you would like the control to use for its text. This message is a convention, not a rule. For example, our scratch program doesn't pay attention to the message. If somebody sends it a , nothing happens. The scratch program just ignores the caller and uses whatever font it wants. Although supporting the message is optional, if you do choose to support it, you would be well-served to adhere to the following convention: The message does not alter font ownership. In other words, whoever was responsible for destroying the font before the message is sent is still responsib...

Sep 11, 2008
Post comments count 0
Post likes count 0

For a place that’s supposed to be full of doctors, they sure don’t look like doctors

Raymond Chen

Anthony Edwards is returning for a guest spot on his old series ER. I don't watch ER, but when I happen to stumble across it, the thing that strikes me most is that for a where most of the characters are supposed to be doctors, they sure don't look like doctors. They look like models who have been forced to wear scrubs and white lab coats. Except for Anthony Edwards. He actually looks like a doctor. One of my cousins is a doctor, and for some reason, we were watching an episode of ER in which the medical student was put in charge of a patient and made a bad medical decision. My cousin's reaction: "There's n...

Sep 11, 2008
Post comments count 0
Post likes count 1

Suggestion Box 3, short answers (part 2 of who knows how many)

Raymond Chen

Another round of short answers to questions in the suggestion box. How does Windows choose the monitor a window maximizes to? The window maximizes to the monitor selected by . The algorithm the uses to select the monitor is documented in MSDN. How do you make your Win32 application safe from keyloggers? You can't. In the battle between kernel mode and user mode, user mode loses. That's why we have a distinction between kernel mode and user mode in the first place. Why should you ever call MessageBox from inside a message handler that is re-entrant? "I'm having a ha...

Sep 10, 2008
Post comments count 0
Post likes count 0

And now, your moment of reflection

Raymond Chen

Master storyteller Ira Glass teaches us how to tell a story, and the importance of the moment of reflection. (In the third video he explains why when you are trying to do something creative you always suck, and that's okay.) And once you've soaked up Ira's advice, you can admire Kasper Hauser's parodies: Going Postal and Phantom High School.

Sep 10, 2008
Post comments count 0
Post likes count 2

What were ShellExecute hooks designed for?

Raymond Chen

Windows 95 introduced (and Windows Vista removed) the concept of ShellExecute hooks. These are objects which implemented the interface. That interface had just one method: , which took a structure and returned to indicate that the item was executed, to allow processing to continue, and an error code to halt processing. The intended purpose of the shell execute hook was to allow you to extend the set of strings that can be executed. For example, Internet Explorer 1 used a shell execute hook so that you could type into the Run dialog and invoke the Web browser. This was necessary because the o...

Sep 9, 2008
Post comments count 0
Post likes count 1

If you use an absurd signature, I might end up sending it back to you

Raymond Chen

Despite my previous rant, absurdly elaborate email signatures are still common at Microsoft, and I'm not just talking about the ones that contain information that may be required by department policy. I'm talking about signatures that use bright colors, large fonts, maybe a bitmap or two, sometimes even a photo of the sender! I will sometimes mention in my reply, "Please consider making your signature less eye-catching. It distracts from the text of your message." But other times, I just incorporate it in to the reply more directly: From: John Doe Blah blah blah question blah blah blah. John Doe Technical L...