The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

People are very sensitive to how the icons look
May 30, 2006
Post comments count 0
Post likes count 0

People are very sensitive to how the icons look

Raymond Chen
Raymond Chen

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
May 29, 2006
Post comments count 0
Post likes count 0

Every discipline has its crackpots: Stories of mathematics

Raymond Chen
Raymond Chen

The letters that mathematics departments get...

Wordplay (the movie)
May 27, 2006
Post comments count 0
Post likes count 0

Wordplay (the movie)

Raymond Chen
Raymond Chen

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
May 26, 2006
Post comments count 0
Post likes count 0

Assaulting users with dialog box after dialog box

Raymond Chen
Raymond Chen

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
May 25, 2006
Post comments count 0
Post likes count 0

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

Raymond Chen
Raymond Chen

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
May 24, 2006
Post comments count 0
Post likes count 0

Beware the C++ implicit conversion

Raymond Chen
Raymond Chen

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

Raymond makes a psychic prediction for 2006
May 23, 2006
Post comments count 0
Post likes count 0

Raymond makes a psychic prediction for 2006

Raymond Chen
Raymond Chen

I have gazed into my crystal ball and emerged with a prediction for 2006. Revealing my prediction now may influence the event itself, so I will post only the hash for the prediction. I will post the actual prediction at the end of the year. The output of this program (after you replace "prediction goes here" with the actual prediction, of course) is as follows:

That mysterious J
May 23, 2006
Post comments count 0
Post likes count 0

That mysterious J

Raymond Chen
Raymond Chen

It's a lost smiley face.

How do I write a regular expression that matches an IPv4 dotted address?
May 22, 2006
Post comments count 0
Post likes count 1

How do I write a regular expression that matches an IPv4 dotted address?

Raymond Chen
Raymond Chen

Writing a regular expression that matches an IPv4 dotted address is either easy or hard, depending on how good a job you want to do. In fact, to make things easier, let's match only the decimal dotted notation, leaving out the hexadecimal variant, as well as the non-dotted variants. For the purpose of this discussion, I'll restrict myself to the common subset of the regular expression languages shared by perl, JScript, and the .NET Framework, and I'll assume ECMA mode, wherein matches only the characters 0 through 9. (By default, in the .NET Framework, matches any decimal digit, not just 0 through 9.) The...