The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
Office Office Office Malkovich Office Office Office
Some years ago, a colleague of mine received a message from our IT department. It began like this: You are receiving this notification because our records show that the machines below are still running a pre-release version of Office 2010. All pre-release versions of Office 2010 will expire on Office 31, 2010. Either the Office team managed to name a month after themselves, or the IT department had a bit too much Office on their mind.
At least it's clear who will NOT be bunking together
I dreamed that I was on a business trip with two colleagues. We discussed Canadian science broadcaster David Suzuki and how in photos of him as a teenager, he looked like Elvis Presley. (Note: Not actually true as far as I know. Remember, this is a dream.) Fortunately, the hotel room we booked had three beds. But if Michael Jackson hadn't canceled, then two of us would have had to double-up, and we briefly discussed who would be bunking together. Possibly my two colleagues together, or me with the first colleague, or me with the second colleague. It went without saying, however, that had Michael Jackson actuall...
A program for my nieces: The ABCs, part 3
One problem I discovered when my nieces ran my initial ABC program was that they had a habit of holding down a key, thereby triggering autorepeat. I had instructed them not to mash the keyboard but rather to press only one key at a time, and while they were good at adhering to the "one key at a time" rule, they also interpreted it as "type really slowly" and ended up autorepeating a lot. So let's disable keyboard autorepeat. Of course, one way to do this would be to change the system keyboard autorepeat setting, but that would be using global state to manage a local problem. Instead, we just filter the aut...
Nasty gotcha: STGM_READ | STGM_WRITE does not grant read/write access
You might think that if you want to get read/write access, you could pass . You would be wrong. You have to pass . The three flags , , and are mutually exclusive. If you try to combine them, you get a weird mess. In particular, since the numerical value of is zero, passing is numerically equivalent to passing , which grants write-only access. The documentation for the constants specifically says "It is not valid to use more than one element from a single group," and and belong to the Access group (as does ). These values date back to the days of MS-DOS, where function 3Dh (Open File) passed an access mo...
If you're not using the command line interpreter, then the command line interpreter metacharacters mean nothing
A customer observed that the parameters passed to were not being interpreted correctly. The process is created successfully, but it prints the message ERROR: The system was unable to find the specified registry key or value.. Why aren't the parameters being parsed correctly by ? They work fine if I paste them into a command prompt. This is a variation of the problem we saw a few years ago. Back then, we had a string with command line redirection metacharacters, but since we were passing them directly to , the command interpreter never got a chance to interpret them. Here, we have a string that contains an...
Why is LOCALE_SDURATION so dorky-looking?
For formatting time spans, you can use the format string, but the result is a dorky format. Why isn't there a format that is fancier like ? You have the complexities of natural language to thank. In the general case, there is not enough information to provide the appropriate grammatical context in order to know the correct format. This isn't a big deal in English, since English words typically do not inflect for case (pronouns and genetive being the most commonly-encountered exceptions), but in many other languages, choosing the exact form of the word "hours" depends on grammatical information that cannot be...
Microspeak: Landing, especially the heated kind
Work on Windows occurs in several different branches of the source code, and changes in one branch propagate to other branches. When talking about a feature or other task becoming visible in a branch, the preferred jargon word at Microsoft is landing. In its purest form: We expect the feature to land in the trunk early next week. The term land when used in this way is typically used to describe a feature arriving in a branch different from its home branch. From this basic meaning, extended usages arise. The term landing is often accompanied by additional aviation adjectives to describe how smoothly the fea...
Watch out for those out-of-control Canadian tour buses
I don't remember the details, but I dreamed about a bunch of things, including careening through Canada on a tour bus trying to catch a ferry while people worried about their cell phone roaming charges, an episode of Friends shot in the style of ER, and one of my friends in an orange jumpsuit sneaking around.
A program for my nieces: The ABCs, part 2, choosing a font
I added a feature to my ABC program that it turns out I never actually used: Change the font. I added this in case my nieces were somehow unhappy with the font I chose, and this was a little escape hatch to let me select a different one. The real work happens in the function. All I have to do is call it. I tell the common font dialog to initialize itself from the I passed in, which I initialize from the font itself. If the user picks a font, the function puts the result in the same , and I use that to create the new font and swap it into the edit control. The rest is just hooking up this function. ...