The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Don't be helpless: I don't know anything about MFC modal loops, but unlike some people, I'm not afraid to find out
May 21, 2007
Post comments count 0
Post likes count 0

Don't be helpless: I don't know anything about MFC modal loops, but unlike some people, I'm not afraid to find out

Raymond Chen
Raymond Chen

Commenter Tom Grelinger asks via the Suggestion Box: If I have a modal CDialog that is visible and usable to the user. Let's say I receive an event somewhere else in the program and I call DestroyWindow on the modal CDialog from within the event. I notice that the OnDestroy is called on the CDialog, but DoModal never exits until a WM_QUIT is posted to the modal's message pump. What are the pitfalls to this? Unfortunately, there is really no way to avoid this situation. I'm not sure what the question is, actually. The question as stated is "What are the pitfalls to this?" but he answered that in his own ques...

Don't drive your pick-up onto the roof of a house, especially if, well, read on
May 18, 2007
Post comments count 0
Post likes count 0

Don't drive your pick-up onto the roof of a house, especially if, well, read on

Raymond Chen
Raymond Chen

Back in 2000, a crazy stunt made the front page of the local newspaper, and it still holds a special place in my heart years later. We begin with Man drives pickup onto friend's roof as a stunt. The story opens with the picture of said pick-up on the roof of a house with its proud owner. That picture already tells a story. The run-down house, the pick-up on the roof, the can of beer, the frat-boy self-satifaction... And the article hasn't even begun yet. As Dave Anthony's pickup truck sank slowly through the roof of a one-story house yesterday morning, he popped a Spin Doctors CD into a player and reached for...

Getting in on the action while it's still there
May 18, 2007
Post comments count 0
Post likes count 0

Getting in on the action while it's still there

Raymond Chen
Raymond Chen

Remember day trading? All the cool people were doing it. Glamour stories of people who tripled or quadrupled their stake in a single day. With all this money available for the taking, you'd be a fool not to be day-trading! During the era of day trading frenzy, I got a particular chuckle out of one PC manufacturer who produced a Precision Online Trading Workstation, equipped with dual monitors and dual processors and preloaded with financial software, so you can see more stock quotes, crunch those numbers faster, and lose more money more quickly than you ever thought possible. I imagined the logic that went into...

Store Wars and the Meatrix
May 17, 2007
Post comments count 0
Post likes count 0

Store Wars and the Meatrix

Raymond Chen
Raymond Chen

Store Wars is a propaganda video for the Organic Trade Association, starring vegetables and bad puns. ("Darth Tater" indeed.) Yes, it's a propaganda video, but at least it's an entertaining propaganda video. The same company also created The Meatrix, in conjunction with (deep breath now) the Global Resource Action Center for the Environment. The difference is that The Meatrix isn't funny.

We're all in this together: No good deed goes unpunished, redux
May 17, 2007
Post comments count 0
Post likes count 0

We're all in this together: No good deed goes unpunished, redux

Raymond Chen
Raymond Chen

There were several suggestions as to how I could avoid being tagged as the owner of an issue because I helped route the problem. Many of them involved assigning the bug back to the testers to "teach them a lesson". Punishing the tester doesn't help the product. Remember, we're all in this together. The goal is to fix bugs and ship a quality product.† Being vindictive doesn't further that goal. Especially one suggestion which was to resolve the bug as "Won't fix" with the reason "Tester is an idiot." That may make you feel better, but it is a total disservice to your customers. It's almost certainly a ...

Please refer to the instructions that don't exist
May 16, 2007
Post comments count 0
Post likes count 0

Please refer to the instructions that don't exist

Raymond Chen
Raymond Chen

I bought myself a wireless mouse and was setting it up. Step 1: Insert the batteries. Check. Step 2: Position the receiver. Make sure the distance between the mouse and receiver is within the wireless range specified on the packaging. I wanted to put the receiver on the floor, off of my desk, so I had to make sure it would still be in range of the mouse on my desk. Let's look at the packaging. Nope, no mention of the receiver range. I guess this proves that nobody reads the installation instructions.

Why are console windows limited to Lucida Console and raster fonts?
May 16, 2007
Post comments count 0
Post likes count 0

Why are console windows limited to Lucida Console and raster fonts?

Raymond Chen
Raymond Chen

Because most fonts don't work in command prompts.

Get Sea-Tac flight information (including gate and baggage claim) via email
May 15, 2007
Post comments count 0
Post likes count 0

Get Sea-Tac flight information (including gate and baggage claim) via email

Raymond Chen
Raymond Chen

There are lots of flight status sites out there. (My favorite is FlightAware because it's the geekiest of them.) Many of them will send you email alerts when flight information changes, but the one from the Port of Seattle is the only one I know of that will also tell you when the arrival gate and baggage claim carousel number change, which is handy when you're picking up someone at the airport. (Main entry page here.) A useful site if you're departing from the airport is the TSA's Security Checkpoint Wait Times site, which gives you estimates of wait times based on data collected in the most recent few weeks...

Command lines need to be quoted; paths don't
May 15, 2007
Post comments count 0
Post likes count 0

Command lines need to be quoted; paths don't

Raymond Chen
Raymond Chen

While it's true that one category of problems comes from failing to quote spaces in command lines, it is a false statement that "path names in the registry should have quotation marks around them for obvious reasons." In fact it's the opposite. Path names should not be quoted. Think about it: Quotation marks are a parsing issue, not a file name issue. The quotation marks are not part of the file name. If you type or open the folder in Explorer, you don't see any quotation marks. You can't pass quotation marks to or since they aren't actually part of the file name. Quotation marks indicate to code that is pa...