The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts

The power of statistical photography

Inside Microsoft, there was an employee photography contest to provide images to be included in Windows 7, either in one of the pre-release versions or in the final product. Each subsidiary selected the photos to be included in their localized version of Windows, choosing images which best reflect that region's culture, history, and natural beauty. The employee-submitted photos were in direct competition against the professional photographs; as a result, some regions ended up selecting multiple employee-contributed images and others picked none. The Swiss delegation, in characteristically Swiss fashion, ...

My least effective Hallowe'en costume

One year I decided to dress as a nerd for Hallowe'en. I took an old pair of glasses with large lenses, "repaired" it with some masking tape, and combined it with a plaid dress shirt with a pocket protector and courduroy pants that were too short. Nobody at work realized I was wearing a costume. The best Hallowe'en work costume I saw was someone who came dressed as a Christmas tree. Complete with Christmas lights. She had to make sure to stand near an electrical outlet so she could plug herself in. I wish I had a picture: One of my friends spotted somebody at a work Hallowe'en party dressed as Bill Gates. But n...

Why isn't my transparent static control transparent?

A customer reported that their application uses transparent static controls positioned over a bitmap image control, but even though they set the Transparent property on the static control, the static control isn't transparent. The customer was kind enough to provide clear steps to illustrate the problem: Open Visual Studio 2005 or 2008. From the menu, select File, New File, Visual C++, Resource Template File (RCT). Right-click on the RCT file, select Add Resource, and add a bitmap named . Open the dialog box () and add a "Picture Control", specifying as its ID. Change the type to Bitmap a...

Why do the pinned items in the Jump List go on the top instead of the bottom?

When you pin items to the Jump List, they go to the top of the menu that appears when you right-click the Taskbar item. Why not put the pinned items at the bottom? After all, over 98% of users leave the taskbar at the bottom of the screen, so putting the pinned items at the bottom of the list maintains a consistent position relative to the Taskbar icon, permitting the development of muscle memory. The Taskbar folks tried out all sorts of ideas for ordering the Pinned items, the Frequent/Recent items, the Tasks, and the system commands on that one pop-up menu. And these ideas were put to the test: With real user...

How can I get notified when some other window is destroyed?

A customer wanted to know whether there was a method (other than polling) to monitor another window and find out when it gets destroyed. The goal was to automate some operation, and one of the steps was to wait until some program closed its XYZ window before moving on to the next step. Finding the XYZ window could be done with a , but since the window belongs to another process, you can't subclass it to find out when it gets destroyed. Enter accessibility. The function lets you monitor accessibility events, and you can do it globally, for a particular process, or for a particular thread. Since we're interes...

Raymond misreads restaurant names: Local 360

Okay, maybe this time I'm misreading it on purpose, but when I see the name of popular new restaurant Local 360, I think, "That doesn't look all that low-calorie to me. I bet their dishes have more than 360 calories." Or maybe it's "We serve high-calorie foods five days a year. Congratulations, you happen to have picked those five days."

No good deed goes unpunished: Helping to redirect a question

It is a common occurrence that a question is sent to a mailing that is close, but not quite right. Usually somebody will provide information to help redirect the question to a more appropriate mailing list. But this effort does not always go unpunished. From: X A customer is encountering a problem with Product Q when they blah blah blah. Can somebody help? From: Y Support for Product Q is handled by Team R. Note that Product Q is out of mainstream support; you will need to have an extended support agreement. From: X Thank you. I have confirmed that the customer has an extended ...

Squeezing the last bit of enjoyment out of the lost half-inning of a baseball game

A colleague of mine complained, "When the home team is winning, they don't bother playing the bottom half of the ninth inning. I'm getting ripped off! Make them finish the game!" This led to some speculation as to how the visiting team could manage to salvage a win out of that final half-inning, given that they had no further opportunity to score any runs. My proposal was that they could try to get as many players on the home team to be rendered ineligible to play (say, by injuring them or provoking fights and getting them thrown out of the game), until the home team had fewer than nine eligible players, at whic...

If the shell is written in C++, why not just export its base classes?

ton suggested that since the shell is written in C++, should have been an abstract class, and then it could have used techniques like exceptions and Inversion of Control. Okay, first of all, I'm not sure how Inversion of Control is something that requires C++, so I'm going to leave that aside. Second of all, who says the shell is written in C++? As it happens, when was introduced in Windows 95, the entire shell was written in plain C. That's right, plain C. Vtables were built up by hand, method inheritance was implemented by direct replacement in the vtable, method overrides were implemented by funct...