The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
Totally Recall: The meal
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?
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?
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
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
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
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...
If Twitter is micro-blogging, then is what I’m doing macro-tweeting?
Here are a collection of brief messages not worthy of a full blog entry. I think I'm going to call it macro-tweeting.
Why is there a dry fountain in the Redmond North campus?
One of the things that may strike you if you visit Microsoft's Redmond North campus is that there's a large, dry fountain outside the cafeteria. Why isn't the fountain running? The Redmond North campus was purchased from Safeco, and with the purchase, Microsoft obtained title to a fountain whose design had two fatal flaws: Having large quantities of water dripping into a parking garage is not a good situation, and the Facilities people shut off the water and drained the fountain to prevent any further water damage. Further investigation revealed that the problem was quite serious and was not a simple fi...
Do QueryProcessCycleTime and QueryThreadCycleTime include cycles spent in kernel mode?
Do and include cycles spent in kernel mode? Yes, they do. They count cycles spent both in user mode and in kernel mode.