The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

How do the menu functions find items?
Mar 19, 2007
Post comments count 0
Post likes count 0

How do the menu functions find items?

Raymond Chen
Raymond Chen

Most of the menu item functions such as allow you specify the menu item either by position or by command. Some of them use the and flags. Others separate the search algorithm into a separate flag. Searching for menu items by position is straightforward: The specified position is used as a zero-based index into the menu. In other words, the first item in the menu is item zero. Searching for menu items by command is trickier. The menu manager searches the entire menu hierarchy, including submenus, for an item with the command you specify. If more than one menu item has the identifier you requested, then one o...

Verizon backs down on made-up fees and then adds them anyway
Mar 16, 2007
Post comments count 0
Post likes count 0

Verizon backs down on made-up fees and then adds them anyway

Raymond Chen
Raymond Chen

I ranted a few years ago about rate hikes disguised as fees or taxes, but Verizon's unabashed deceptive practices still gets me all worked up. Last year, the FCC decided that Verizon didn't have to pay the Universal Service Fund fee any more, but that didn't stop them from charging for it anyway. What galls me is their explanation of the fee the invented to replace the USF: "... new costs that we've developed over the past year as we've been developing and delivering this standalone DSL service." Now, maybe I'm not hip to this whole "new economy" thing, but I always thought that the way to reflect increased co...

The format of accelerator table resources
Mar 16, 2007
Post comments count 0
Post likes count 0

The format of accelerator table resources

Raymond Chen
Raymond Chen

Continuing in the extremely sporadic series on the format of resources, today we'll take a look at accelerator tables. This topic is so simple, I'll cover both 16-bit and 32-bit resources on the same day! In 16-bit Windows, the format of an accelerator table resource was simply an array of structures. This array is the same array you would pass to the , with one important difference: The of the last entry in the accelerator resource has its high bit set to indicate that it is the end of the table. The format of 32-bit accelerator table resources is nearly identical to its 16-bit counterpart. The only d...

Email tip: Don't forget to ask your question
Mar 15, 2007
Post comments count 0
Post likes count 0

Email tip: Don't forget to ask your question

Raymond Chen
Raymond Chen

Sometimes people get so caught up in their problem that they forget to ask a question. My customer has noticed that blah blah blah blah, but if they do blah blah, then they get blah blah blah. This is different from blah blah blah, where blah blah blah. But neither is what the customer is expecting, which is blah blah blah. After installing blah blah blah, we found that the behavior changed to blah blah blah. What the customer is trying to do is blah blah blah. As a workaround, they're doing blah blah blah before doing the blah blah, and then doing another blah blah afterwards. Yeah, that's all very nice, but ...

News flash: Snacks at the theater concession stand are not good for you
Mar 14, 2007
Post comments count 0
Post likes count 0

News flash: Snacks at the theater concession stand are not good for you

Raymond Chen
Raymond Chen

"We try to make them as healthy as possible," says Jose Mier. As healthy as sixteen inches of deep-fried dough, covered in sugar, and stuffed with caramel can be. That is to say, not healthy at all. Here are some ideas for making them healthier: Don't coat them in sugar, don't stuff them with Bavarian cream, and don't deep-fry them. Or just get over the fact that churros aren't healthy and stop pretending that they are. (I was tipped off to this article by the always-entertaining Ken Levine.) In related news, whole wheat Krispy Kreme donuts are not health food.

Don't require your users to have a degree in philosophy, episode 2
Mar 14, 2007
Post comments count 0
Post likes count 0

Don't require your users to have a degree in philosophy, episode 2

Raymond Chen
Raymond Chen

Earlier, we learned that help text is not the place to put logic puzzles. Neither are dialog boxes. I ran across a configuration dialog box that had the item Turn off Feature X This is a negative-sense checkbox, which turns your dialog box into a logic puzzle. Checkboxes should be phrased positively. Use Feature X (The only exception to the "no negative checkboxes" rule is the "don't show me this message again" checkbox.) Negative-sense checkboxes turn into a game of confuse-the-user. "If I uncheck 'Turn off Feature X', then I'm not not running it." It gives the impression that your progr...

Out there gathering map data, one intersection at a time
Mar 13, 2007
Post comments count 0
Post likes count 0

Out there gathering map data, one intersection at a time

Raymond Chen
Raymond Chen

The New Yorker reported some time ago on how Navteq gathers map data. This story reminded me that, at least as of a few years ago, Navteq listed the driveway of a colleague of mine as a through road. Drivers came up to his driveway, realized that they've been hoodwinked, and spun their wheels in the gravel in frustration on their way out. He told me that he had reported the error to Navteq three years previously, but they still hadn't updated their map data. I haven't checked back to see if the data has been updated yet...

The only thing you can do with display names is display them
Mar 13, 2007
Post comments count 0
Post likes count 0

The only thing you can do with display names is display them

Raymond Chen
Raymond Chen

There are many functions that return strings called "display names". And the only thing you can do with display names is display them. Don't assume that the string actually means anything, because it doesn't. Theoretically, a function like could be implemented as and your program should still work. (Of course, this is merely a ground rule. Specific functions may have exceptions. For example, the has a special flag flag which explicitly indicates that the string returned is designed to be parsed.) The purpose of a "display name" is to be a string suitable for displaying to the user. The display name for...

What is a SM_SLOWMACHINE?
Mar 12, 2007
Post comments count 0
Post likes count 0

What is a SM_SLOWMACHINE?

Raymond Chen
Raymond Chen

Jason Doucette asks how slow a machine has to be to be considered a . The answer: Pretty darned slow by today's standards. When the metric was introduced in Windows 95, the definition of a "slow machine" was as follows (roughly): That bit about the display driver is a little strange. Windows actually trusted display drivers to report when they were slow. The guidance in the device driver documentation was to mark a driver as slow if it did not perform graphics hardware acceleration, but of course no card manufacturer would admit that their card was slow! I suspect nobody ever set that bit. The "slow m...