The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts

Why can't you say </script> in a script block?

Because it ends the script block, of course. Duh, what's so hard about that? Because if you have script that generates script, you'll find yourself caught out if you're not careful. For example, you can't say in a script block because the HTML parser will see the and conclude that your script block is over. In other words, the script block extends as far as the highlighted section below: The parser doesn't understand "quoted strings" or "comments" or anything like that. It just looks for the nine characters "<", "/", "S", "C", "R", "I", "P", "T", and ">". When it sees them, it decides that the sc...

What does the CS_CLASSDC class style do?

Last time, I talked about the historical background for the class style and why it starts out sounding like a good idea but when you think about it some more turns out to be an awful idea. The class style is the same thing, but worse, for it takes all the problems of and magnifies them. Recall that the class style instructs the window manager to create a DC for the window and use that single DC in response to calls to and . The takes this one step further and creates a DC for all the windows of that class. So that problem I showed last time with a function that thought it had two different DCs for a wind...

What does the CS_OWNDC class style do?

Recall that window DCs are most commonly used only temporarily. If you need to draw into a window, you call or, if outside of a paint cycle, , although painting outside of a paint cycle is generally to be avoided. The window manager produces a DC for the window and returns it. You use the DC, then restore it to its original state and return it to the window manager with (or ). Internally, the window manager keeps a small cache of DCs which it dips into when people come asking for a window DC, and when the DC is returned, it goes back into the cache. Since window DCs are used only temporarily, the number of out...

Do it for Katie

A story in honor of Katie Couric's final day at the Today show. Last month I happened to run into a former member of the shell team who worked on the Windows XP Welcome screen. He told me a story from CES 2001, where Windows XP's interface (code-named Luna) was unveiled. There was going to be a segment on the Today show, and the Welcome screen was going to make an appearance, but the designers wanted to make one last tweak before it showed up on national television. Two hours before air time. So with a hard deadline of two hours, my colleague connected back to the computer at the office, made t...

Mellifluous NPR reporter name: Ofeibea Quist-Arcton

I first heard Ofeibea Quist-Arcton when she reported for the BBC. Now she's on NPR (you can listen to her discuss corruption in Nigeria in this recent report), thereby wresting the title of "most mellifluous NPR reporter name" from its previous holder, Sylvia Poggioli. (Sylvia Poggioli's dirty secret: She was born and grew up in the United States!) Other NPR personalities with cool-sounding names: Andrei Codrescu, Mandalit del Barco, Snigdha Prakash, and Eric Westervelt. Christiane Amanpour has a nice name, too, but she works for CNN, not NPR.

People are very sensitive to how the icons look

Windows XP shipped with new icons for many common items in the shell, and Windows Vista will have even more and newer icons. One of the things the designers have to be careful about with drawing these icons is to make sure they don't actually look like anything. Let me clarify. The folder icon, for example, is not based on any actual physical folder you can buy in the store. If it were a rendition of an actual folder, Windows would become vulnerable to a copyright infringement charge from the manufacturers of that folder. Instead, the manila folder icon is just something the designers made up from thei...

Every discipline has its crackpots: Stories of mathematics

The letters that mathematics departments get...

Wordplay (the movie)

This morning I saw a screening of Wordplay, a documentary on crossword puzzles featuring Will Shortz. If you're a crossword puzzler, this movie is a must-see. In addition to Will, there are plenty of other rock stars of the crossword puzzle subculture who play major roles: Merl Reagle, Trip Payne, and Ellen Ripstein. (I was particularly amused by this entry. Hey, if you're not going to appreciate Ellen Ripstein's autograph, give it to somebody who will!) The audience loved this movie, laughing so hard in places that it drowned out the dialogue. (And gasping in horror when... well, you'll have to watch the mo...

Assaulting users with dialog box after dialog box

Increasingly, I'm seeing solving problems by adding more dialog boxes. Asking the user too much is as bad as not asking enough. "You clicked on the Notepad icon. Do you wish to run Notepad?" Okay, nobody would write a dialog box that stupid, would they? But the following dialog boxes don't really help much either: "You clicked on an mp3 file. Do you want to open it with that program you just installed?" "You clicked on an avi file. Do you want to open it with that program you just installed?" "You clicked on an mpg file. Do you want to open it with that program you just installed?" "You clicked on a wmv f...