The Old New Thing

Why does ShellExecute return SE_ERR_ACCESSDENIED for nearly everything?

We saw a while ago that the function returns at the slightest provocation. Why can't it return something more meaningful? The short-term answer is that the return value from is both a success code and an error code, and you check whether the value is greater than 32 to see which half you're in. In particular, the error code case is if ...

If there's a problem with a wiki, then you can fix it; that's why it's a wiki

On an internal mailing list, somebody asked a question about how to do X with Y, and I replied with a link to an internal wiki that described how to do X with Y (answer: use the Z tool). Somebody else replied, "Time to update that article because the link to the Z tool is broken." Apparently, this person forgot that one of the defining ...

Irony patrol: Recycling bins

Microsoft has a large corporate recycling effort. Every office, every mail room, every kitchenette, every conference room has a recycling bin. The dining facilities earned Green Restaurant Certification, and there is a goal of making the cafeterias a zero-landfill facility by 2012. (Hey, that's this year!) A few years ago, I found one room...

Combo boxes have supported incremental searching for quite some time now

Back in August 2007, I promised to post a program the following day but it appears that I never did. Oops. I discovered this as I went through my "things to blog about" pile and figured better late than never. Though five years late is pretty bad. Here's a program which fills a combo box with some strings. Run this program and start ...

Why does Windows Compressed Folders (Zip folders) reject paths that begin with a slash?

A customer asked, "Does NTFS support files with a null string as the name?" No, NTFS does not support files with no name. None of the commonly-used Windows file systems do. Files must have a name. But what a strange question that is. The customer was kind enough to explain why they cared. "We have a zip file that the Compressed Folders (Zip ...

Usage guidance for a popcorn machine in the kitchenette

My colleague KC Lemson tipped me off to a sign hanging next to a popcorn machine in one of the kitchens: A friend of mine happened to have a chat with a fire fighter who used to be assigned to the fire station nearest to Microsoft main campus. According to him, the top three reasons for being called to a Microsoft building are (in no ...

How does Explorer deal with recent files that were renamed?

Roni wonders how Explorer manages to keep track of files that were moved or renamed. Specifically, "opening a shortcut to a renamed file actually updates the shortcut's destination and opens the renamed file. How is this done? Is it an NTFS feature?" This feature has been around since Windows 95. If the target of a shortcut no longer ...

How do I override the default icon selection algorithm?

The usual way of loading an icon from a resource is to use the or function and letting the window manager's icon selection algorithm decide which image to use based on the images available in the icon, the desired icon size, and the current color depth. A customer wanted to override that algorithm, because the window manager uses the ...