Showing results for October 2010 - The Old New Thing

Oct 29, 2010
0
0

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

Raymond Chen
Raymond Chen

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 ob...

Non-Computer
Oct 29, 2010
0
0

Debugging walkthrough: Diagnosing a __purecall failure

Raymond Chen
Raymond Chen

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 ...

Other
Oct 28, 2010
0
0

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

Raymond Chen
Raymond Chen

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 vi...

Code
Oct 27, 2010
0
0

How do I programmatically invoke Aero Peek on a window?

Raymond Chen
Raymond Chen

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 a...

Other
Oct 25, 2010
0
0

Belated happy first birthday, Windows 7

Raymond Chen
Raymond Chen

On Friday, the marketing folks informed me that they decided to put me on the Microsoft Careers United States home page in recognition of Windows 7's first birthday. It's an honor and to be honest a bit scary to be chosen to be the face of Windows on a day of such significance. (They told me that had narrowed it down to me and "some Directo...

Non-Computer
Oct 25, 2010
0
0

When you call a function, your code doesn't resume execution until that function returns

Raymond Chen
Raymond Chen

Consider this code fragment: When calls , and has not yet returned, does continue executing? Does get called before returns? No, it does not. The basic structure of the C/C++ language imposes sequential execution. Control does not return to the function until returns control, either by reaching the end of the function or by an explic...

Code
Oct 22, 2010
0
1

The evolution of the ICO file format, part 4: PNG images

Raymond Chen
Raymond Chen

We finish our tour of the evolution of the ICO file format with the introduction of PNG-compressed images in Windows Vista. The natural way of introducing PNG support for icon images would be to allow the field of the to take the value , in which case the image would be represented not by a DIB but by a PNG. After all, that's why we have a ...

Other
Oct 21, 2010
0
0

The evolution of the ICO file format, part 3: Alpha-blended images

Raymond Chen
Raymond Chen

Windows XP introduced the ability to provide icon images which contain an 8-bit alpha channel. Up until this point, you had only a 1-bit alpha channel, represented by a mask. The representation of an alpha-blended image in your ICO file is pretty straightforward. Recall that the old ICO format supports 0RGB 32bpp bitmaps. To use an alpha-blen...

Other
Oct 20, 2010
0
0

How do I get the dimensions of a cursor or icon?

Raymond Chen
Raymond Chen

Given a or a , how do you get the dimensions of the icon or cursor? The function gets you most of the way there, returning you an structure which gives you the mask and color bitmaps (and the hotspot, if a cursor). You can then use the function to get the attributes of the bitmap. And then here's the tricky part: You have to massage the data...

Code