The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
How do I invoke a verb on an IShellItemArray?
A customer wanted to invoke a command on multiple items at once. I have an , and I want to invoke a verb with that array as the parameter. I know that I can invoke a verb on a single by the code below, but how do I pass an entire array? The function invokes the command by extracting the pidl, then asking to invoke the command on the pidl. A limitation of is that it can invoke on only one pidl. What if you want to invoke it on a bunch of pidls at once? (Doing it all at once gives the target program the opportunity to optimize the multi-target invoke.) As noted in the documentation, passing flag tel...
Does the CopyFile function verify that the data reached its final destination successfully?
It just writes data.
The day I stole Joe Belfiore's mouse
He's now the head demo-monkey/cheerleader for Windows Phone, but back in the old days, Joe Belfiore was the head demo-monkey/cheerleader for the Windows 95 user interface design. A team-wide meeting was held to show off the new interface that they had developed. Wow look, we have a Start menu (though it wasn't known by that name yet), a taskbar (though it wasn't known by that name yet), shortcuts, a Close button (in the upper right corner), property sheets, all that good stuff. At that time, I was still developing my thermonuclear skills and in particular was cultivating the skill of asking challenging qu...
How do you deal with an input stream that may or may not contain Unicode data?
Dewi Morgan reinterpreted a question from a Suggestion Box of times past as "How do you deal with an input stream that may or may not contain Unicode data?" A related question from Dave wondered how applications that use to store data could ensure that the data is interpreted in the same code page by the recipient. "If I send a .txt file to a person in China, do they just go through code pages until it seems to display correctly?" These questions are additional manifestations of Keep your eye on the code page. When you store data, you need to have some sort of agreement (either explicit or implicit) with th...
Raymond learns about some of the things people do to get banned on Xbox LIVE
I still enjoy dropping in on Why Was I Banned? every so often, but not being a l33t Xbox haxxor, I don't understand a lot of the terminology. Fortunately, some of my colleagues were kind enough to explain them to me. (And now I'm explaining them to you so that you don't have to look as stupid asking them.) A modded lobby is a pre-game lobby (a server you connect to in order to find other people to play with or against) that has been modified (modded) with carefully-crafted parameters so that they grant people who visit them various advantages. For example, the reward for winning the game could be some absurd nu...
IShellFolder::BindToObject is a high-traffic method; don't do any heavy lifting
A customer observed that once the user visited their shell extension, Explorer ran really slowly. (Actually, it took a while just to get to this point, but I'll skip the early investigations because they aren't relevant to the story.) Some investigation showed that Explorer's tree view was calling into the shell extension, which was in turn hanging the shell for several seconds at a time. Explorer was calling into the shell extension because the node was in the folder tree view, and Explorer was doing a little bookkeeping to synchronize the folder state with the view. The node referred to a server that was no lo...
WM_CTLCOLOR vs GetFileVersionInfoSize: Just because somebody else screwed up doesn't mean you're allowed to screw up too
In a discussion of the now-vestigial parameter to the function, Neil asks, "Weren't there sufficient API differences (e.g. WM_CTLCOLOR) between Win16 and Win32 to justify changing the definitions to eliminate the superfluous handle?" The goal of Win32 was to provide as much backward compatibility with existing 16-bit source code as can be practically achieved. Not all of the changes were successful in achieving this goal, but just because one person fails to meet that goal doesn't mean that everybody else should abandon the goal, too. The Win32 porting tool PORTTOOL.EXE scanned for things which had change...
Rogue feature: Docking a folder at the edge of the screen
Starting in Windows 2000 and continuing through Windows Vista, you could drag a folder out of Explorer and slam it into the edge of the screen. When you let go, it docked itself to that edge of the screen like a toolbar. A customer noticed that this stopped working in Windows 7 and asked, "Was this feature dropped in Windows 7, and is there a way to turn it back on?" Yes, the feature was dropped in Windows 7, and there is no way to turn it back on because the code to implement it was deleted from the product. (Well, okay, you could "turn it back on" by working with your support represent...
One for the "They have to say that because of me": Ground rules at the Point Defiance Zoo
The ground rules for the Point Defiance Zoo and Aquarium in Tacoma include the usual things you might expect. "No pets." "Do not feed the animals." "No smoking." But then there's a rule that clearly is one about which somebody somewhere in the world can say "They have to say that because of me":