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

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...

Using Yoda on an x86 may be hazardous to your systems' health

In former times very cross-platform NTVDM was. If you view in a hex editor, you'll find the message "Using Yoda on an x86 may be hazardous to your systems' health" buried inside it. Yoda was the name of the internal debugger that was used to debug the MS-DOS emulator, also known as the Virtual DOS Machine or VDM. (Buried inside the Yoda source code are such wonderful variables as "luke" and "chewy".) The Intel 80386 has a mode known as "Virtual-8086 mode" or just "V86 mode" wherein the CPU ran as if it were an 8086, except that if the program did anything interesting like issue a privileged instruction, call ...

Beware the C++ implicit conversion

Today's topic was inspired by a question from a customer: I am working on a stack overflow bug. To reduce the size of the stack frame, I removed as many local variables as I could, but there's still a a lot of stack space that I can't account for. What else lives on the stack aside from local variables, parameters, saved registers, and the return address? Well, there's also structured exception handling information, but that's typically not too much and therefore wouldn't be the source of "a lot" of mysterious stack usage. My guess is that the code is generating lots of large C++ temporaries. Consider the ...