The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Sometimes people don’t even read what they’re typing
Mar 11, 2009
Post comments count 0
Post likes count 0

Sometimes people don’t even read what they’re typing

Raymond Chen
Raymond Chen

As an even more extreme case of people seeing something, confirming that they see it, but not actually reading it is someone who sees something, types it into an email message, yet still doesn't read it. Subject: "Invoke or BeginInvoke cannot be called on a control until the window handle has been created." exception crashes our program I'm looking for guidance on why this exception is thrown and how I can avoid it. Here's a sketch of what we're doing: void DoStuff() { try { // attempt operation X, which throws an...

The house no-electronics zone
Mar 10, 2009
Post comments count 0
Post likes count 0

The house no-electronics zone

Raymond Chen
Raymond Chen

In my house, I have designated two rooms as the no-electronics zone. No use of electronic gadgets is allowed. No television, laptops, PDAs, cell phones, handheld video games, you get the idea. The purpose of this section of the house is to interact with other people face-to-face. Now, exceptions have been made for extenuating circumstances. For example, when some of my friends were without electricity due to a power outage, I invited them to my house, and they were permitted to use their laptops in what would normally be the no-electronics zone. But those are the exceptions. So if you come to my house, reme...

Why don’t the favorites I copy into the common Favorites directory show up in the Favorites menu of all users?
Mar 10, 2009
Post comments count 0
Post likes count 0

Why don’t the favorites I copy into the common Favorites directory show up in the Favorites menu of all users?

Raymond Chen
Raymond Chen

The Favorites menu in Internet Explorer shows the user's favorites. And stuff in the is visible to all users. Therefore, Internet shortcuts placed into the directory should show up on the Favorites menu of all users, right? So why doesn't it work? Because features don't exist by default. It's true that there are a few highly-visible cases where the items shown to the user are a combination of files from the and the , the most commonly encountered ones being the desktop and the Start menu. But that doesn't happy as a result of magic. Somebody had to sit down and hook them up. Even the highly visible ca...

Totally Recall: The meal
Mar 9, 2009
Post comments count 0
Post likes count 0

Totally Recall: The meal

Raymond Chen
Raymond Chen

At lunch, we got the crazy idea of putting together a meal menu consisting entirely of foods which had been the subject of highly-publicized product recalls. And of course, we gave it a name consisting of a really bad pun: Totally Recall. Starter Green leaf lettuce with tomatoes, green onions, and jalapeno peppers. Main course Swimming Rama: Spinach with peanut sauce and stir-fried beef. Beverage Odwalla juice. Dessert ? Suggestions welcome. (White Rabbit candies?) And if you don't like this meal, you can just go to the Jack in the Box restaurant down the street.

Why doesn’t the MoveWindow function generate the WM_GETMINMAXINFO message?
Mar 9, 2009
Post comments count 0
Post likes count 0

Why doesn’t the MoveWindow function generate the WM_GETMINMAXINFO message?

Raymond Chen
Raymond Chen

Commenter Phil Quirk asks why calling does not result in a message being sent to validate the moved window size. Well, because you moved it after all. You're being trusted to respect your own rules. After all, if you didn't want the window to be wider than 200 pixels, you shouldn't have passed , right? The message is for obtaining minimum and maximum sizing information when the sizes were chosen by a means outside the application's control, such as when you said "I'll let you choose the window size ()" or when the user grabbed the corner of the window and started dragging it around. But if you yourself c...

Why is the Win32 epoch January 1, 1601?
Mar 6, 2009
Post comments count 0
Post likes count 1

Why is the Win32 epoch January 1, 1601?

Raymond Chen
Raymond Chen

Public Service Announcement: This weekend marks the start of Daylight Saving Time in most parts of the United States. The structure records time in the form of 100-nanosecond intervals since January 1, 1601. Why was that date chosen? The Gregorian calendar operates on a 400-year cycle, and 1601 is the first year of the cycle that was active at the time Windows NT was being designed. In other words, it was chosen to make the math come out nicely. I actually have the email from Dave Cutler confirming this.

Race you to the top: The Empire State Building Run-Up
Mar 5, 2009
Post comments count 0
Post likes count 0

Race you to the top: The Empire State Building Run-Up

Raymond Chen
Raymond Chen

The winner completes the race in just ten minutes and seven seconds, but the vertical climb is a killer: Straight up the 1576 steps of the Empire State Building to the Observation deck. (When I visit the Observation Deck of the Empire State Building, I use the elevator.) And when it's over, everybody goes to work. What else am I going to do, like go celebrate? Am I going to go have martinis at 11:30 in the morning? No, you slink into work and you sit at your desk, and you work all day, and when you're done you stand up and your back is stiff, and you call your wife, and you get yelled at, and you go home to ...

Fixups are not the same as rewriting code, they’re just fixups
Mar 5, 2009
Post comments count 0
Post likes count 0

Fixups are not the same as rewriting code, they’re just fixups

Raymond Chen
Raymond Chen

Classically speaking, a linker cannot rewrite the code the compiler generated; its job is merely to resolve symbols. Of course, resolving symbols means that references to those symbols in the code generated by the compiler turn from "I don't know" to "Here it is." Somebody named George appeared to be confused by this, believing that all changes by the linker counted as "rewriting code." Obviously if the linker weren't allowed to change anything at all, there wouldn't be much point to having a linker. For example, you wouldn't be able to access functions or variables in a separate compilation unit (for example,...

Microspeak: Year-over-year
Mar 4, 2009
Post comments count 0
Post likes count 0

Microspeak: Year-over-year

Raymond Chen
Raymond Chen

In economics, the attributive adjective year-over-year means compared to the same time last year. Examples: "Year-over-year sales show a marked improvement." "Expenses continue to fall year over year." (The hyphens disappear when the adjective is used predicatively.) I have only one citation, but it appears that the term has broadened its meaning inside Microsoft and is now merely a synonym for annual or year after year. We hold decision-makers accountable year over year for carrying out their plan. There is no obvious compared to the same time last year going on here. It's not like you are 15% more accountab...