The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

May 10, 2010
Post comments count 0
Post likes count 0

On nearly getting pickpocketed in both Lisbon and Madrid

Raymond Chen

My trip to Lisbon introduced me to another tourist phenomenon: pickpockets. It was around 10:30 in the morning, and I got on the train to head into town, planning to climb the steps through the Alfama district to visit the castle which looms over the city. The morning rush was over, and the Metro car was nearly empty. Just before the doors closed, a group of about four twentysomething guys stumbled onto the train, walking unsteadily and talking quite loudly among themselves. I found this immediately suspicious. They are acting drunk, but who is drunk at 10:30 in the morning? At 10:30, you're hung over, not drun...

May 10, 2010
Post comments count 0
Post likes count 1

Why can programs empty the clipboard when they start up?

Raymond Chen

Via the Suggestion Box, Johan Almén asks, "What was the rationale behind the decision to let Excel empty the clipboard when launched?" Why can an application empty the clipboard? Because it's there. After all, the point of the clipboard is to hold information temporarily. Programs are permitted to empty the clipboard, add data to the clipboard, or retrieve data from the clipboard. That's why it's there. (I'm assuming that the naming of the program Excel was just an example of a program, and that the question wasn't "Why doesn't Windows have a specific check for the program and block its clipboard acc...

May 7, 2010
Post comments count 0
Post likes count 0

Words you've had wrong your entire life

Raymond Chen

As a child, my mother would always call out "banzai" when she wanted me to raise my arms above my head so she could put on or take off a pullover shirt. I assumed that banzai was the word for "stick your hands in the air!" It wasn't until well into my adult life that my mother explained to me that, no, banzai does not mean "stick your hands in the air." It's a Japanese word meaning "ten thousand years", shouted as a term of approbation and accompanied by (you guessed it) throwing one's hands into the air. My mother was using it as a play term; in the United States, when you get your child to throw his hands into...

May 7, 2010
Post comments count 0
Post likes count 1

The many ways of converting a string from one language to another

Raymond Chen

A customer asked, "I'm looking for a way to convert English characters to another language. For example, if the target language is Arabic and the string is the word Hello, I want it to convert to H(Arabic)e(Arabic)l(Arabic)l(Arabic)o(Arabic)." The question is still vague, even with the assistance of the example, since it's not clear what "H(Arabic)" means. There are a variety of ways of converting a string from one language to another. Here are a few I was able to think of. As it turns out, the customer wasn't interested in any of these! What the customer wanted was, "Take the word Hello and imagine how you...

May 6, 2010
Post comments count 0
Post likes count 0

On the Portuguese custom of the couvert, and other restaurant customs

Raymond Chen

In restaurants in the United States, the custom is that anything brought to the table that you didn't order is complimentary. For example, after you place your order, the waiter returns to your table with a basket of bread. The bread is provided at no extra charge. These complimentary items are usually small, like some bread or a one-bite appetizer. (If anything bigger is brought to the table that you didn't request, it is customary to ask the waiter, "Is this ours?" just to make sure it wasn't delivered to the wrong table by mistake.) In Portugal, the custom is that these items (known as couvert) are brought to...

May 6, 2010
Post comments count 0
Post likes count 1

What are these strange =C: environment variables?

Raymond Chen

You won't see them when you execute a command, but if you write a program that manually enumerates all the environment variables and prints them out, and if you launch it from a command prompt, then you'll see weird variables with names like =C: and whose values correspond to directories on that drive. What are these things? These variables are part of the private bookkeeping of the command processor cmd.exe. That's why I added if you launch it from a command prompt to the steps above, because if you run the program from Explorer's Run dialog, you won't see them. If a cmd.exe is not in the chain of custody of...

May 5, 2010
Post comments count 0
Post likes count 0

Eating where the teenagers are: Pão Pão, Queijo Queijo

Raymond Chen

In Belém, directly to the east of the Mosteiro dos Jerónimos is a block of small shops, the most famous one of which being the Pastéis de Belém which sells the, um, Pastel de Belém, the Belém version of the unofficial dessert of Portugal. (This photo of a group of people eating was taken in front of the Pastéis de Belém shop. You can see the blue awnings in the background.) The place is always packed shoulder-to-shoulder with tourists. So turn around, leave the store, and walk back toward the Mosteiro dos Jerónimos. At about where the pink buildin...

May 5, 2010
Post comments count 0
Post likes count 2

How the shell converts an icon location into an icon

Raymond Chen

A customer had trouble getting an icon to display for a registered file type. In my resource file, I specify the icon like this: And when I register my file type, I set it like this: However, when I view an .xyz file, my awesome icon doesn't appear. On the other hand, if I change the 101 to a 0, then it works. Why? Isn't the number in the resource file the resource ID? Why yes, in fact, the number in the resource file is indeed the resource ID. But the number after the comma in the isn't. The format of shell icon locations (used most visibly by , but also used in other places) is , where...

May 4, 2010
Post comments count 0
Post likes count 1

Microspeak: The statistic known as BIS

Raymond Chen

I learned this term from a chart presented at a team meeting. It contained a column labelled BIS. When asked what those letters meant, the team manager explained that it's an abbreviation for butts in seats. Everybody in the room instantly understood. It is the number of actual human beings sitting at desks doing work. When doing project planning, you sometimes get carried away with the imaginary people who would be working on your project someday, treating them as if they were real people: coming up with features for these imaginary people to work on, projecting how many bugs these imaginary people will fix, lo...