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

The quiet fading away of the CtlPanelClass

If you search MSDN for , you'll find a few really old Knowledge Base articles that include it in a list of "class names of common Windows applications." I'm not sure why the Knowledge Base articles bothered to list those classes; there is no technical reason for applications to need to know this, and including the information merely encourages programmers to rely on the window class name in strange undocumented ways. (This is another one of those cases where a Knowledge Base article written to assist in troubleshooting becomes interpreted as formal documentation.) Windows Vista finally got rid of that window cl...

The wisdom of seventh graders: Being President

Today is Election Day in the United States. Some years ago, seventh grade students (age 12) were asked to imagine they had just been elected president and to give an address to the nation on one thing they would change. Remember, these are only the most entertaining ideas. Do not assume all student ideas are like these. And this sentence came from a student destined for greatness as a politician: "Something must be done, and I will make it happen."

Saying that your case is different doesn't make it so

A customer wanted to do one of those user-hostile things that Windows doesn't make easy to do (the sort of thing I tend to call out on this Web site). After receiving an explanation that Windows doesn't provide a way of doing what they want because it abuses the component in question and goes against user expectations, the customer countered, "Yes, we understand that, but our case is different." The customer then proceeded to explain how they intended to use this newfound power (if only they could figure out how to do it) and under what circumstances they intend to invoke it. Their explanation was interesting in...

Why doesn't the End Task button end my task immediately?

Commenter littleguru asks, "Why does the End Now button not kill the process immediately?" When you click the End Now button, the process really does end now, but not before a brief message from our sponsor. When you kill a hung application, Windows Error Reporting steps in to record the state of the hung application so it can be submitted to the mother ship (with your permission). If you are running Windows XP or Windows Vista, you can briefly see a process called or ; these are the guys who are doing the data collection. After being uploaded to Microsoft, these failure reports are studied to deter...

It's the Great Pumpkin, Charlie Brown: The world of competitive pumpkin-growing

Bill Littlefield of NPR's sports program Only a Game interviews Susan Warren about competitive pumpkin-growing. [Direct link - Real format] An excerpt from her book Backyard Giants was printed in The Wall Street Journal: The Race to Break the Squash Barrier, the quest to grow a one-ton pumpkin. I'm fascinated by these subcultures of people obsessed with one thing.

Debugging walkthrough: Diagnosing a __purecall failure

Prerequisite: Understanding what means. I was asked to help diagnose an issue in which a program managed to stumble into the function. The stack at the point of failure looked like this: The line at that called the mystic was a simple : From what we know of , this means that somebody called into a virtual method on a derived class after the derived class's destructor has run. Okay, well, let's see if we can find the object in question. Since the method being called is a COM method, the calling convention applies, which means that the pointer is on the stack. Using our knowledge of the layou...

Why is there an LVN_ODSTATECHANGED notification when there's already a perfectly good LVN_ITEMCHANGED notification?

If you work with owner-data listviews, you take the responsibility for managing the data associated with each item in the list view. The list view control itself only knows how many items there are; when it needs information about an item, it asks you for it. It's the fancy name for a "virtual list view" control. When you use an ownerdata list view, you will receive a new notification, . The OD stands for ownerdata, so this is an "owner data state changed" notification. The list view sends this notification when the state of one or more items in an owner data list view control change simultaneously. Mind you, t...

How do I programmatically invoke Aero Peek on a window?

A customer wanted to know if there was a way for their application to invoke the Aero Peek feature so that their window appeared and all the other windows on the system turned transparent. No, there is no such programmatic interface exposed. Aero Peek is a feature for the user to invoke, not a feature for applications to invoke so they can draw attention to themselves. Yes, I realize you wrote a program so awesome that all other programs pale in comparison, and that part of your mission is to make all the other programs literally pale in comparison to your program. Sorry. Maybe you can meet up with that oth...

Hacking Barney the dinosaur for fun (no profit)

Wonder powers ActiMate!