The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Oct 17, 2012
Post comments count 0
Post likes count 1

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

Raymond Chen

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 characteristics of a wiki is that it's easy to edit. (Another characteristic is that it is collaboratively-edited; there is no central authority.) In other words, if you see something wrong, fix it yourself. Don't just stand around saying somebody should do something. Be someon...

Oct 16, 2012
Post comments count 0
Post likes count 1

Irony patrol: Recycling bins

Raymond Chen

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 in my building that didn't have a recycling bin, and you'd think it'd be one of the rooms near the top of the list for needing one. The room without a recycling bin was the copy machine room. As a result, people were throwing their unwanted cover sheets and other paper wa...

Oct 15, 2012
Post comments count 0
Post likes count 1

The cries of "Oh no!" emerge from each office as the realization slowly dawns

Raymond Chen

Today is the (approximate) 15th anniversary of the Bedlam Incident. To commemorate that event, here's a story of another email incident gone horribly awry. Some time ago, an email message was sent to a large mailing list. It came from somebody in the IT department and said roughly, "This is a mail sent on behalf of Person X to check if your XYZ server has migrated to the new datacenter. Please visit http://blahblah and confirm that your server name is of the form XXYYNNZZ. If not, please Reply to All." Uh-oh. The seasoned Microsoft employees (and the new employees who paid attention during new employee o...

Oct 12, 2012
Post comments count 0
Post likes count 1

What happens if you forget to pass an OVERLAPPED structure on an asynchronous handle?

Raymond Chen

It becomes synchronous, sort of.

Oct 11, 2012
Post comments count 0
Post likes count 1

Combo boxes have supported incremental searching for quite some time now

Raymond Chen

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 typing: "S"-"L"-"O"-"V"-"E"... Hey, look, the combo box is performing incremental search and once you hit the "E", it selected Slovenia, the first item in the list which begins with the letters S-L-O-V-E. Wait a few seconds, and try it again. This time, type "S"-"P", and hey l...

Oct 10, 2012
Post comments count 0
Post likes count 1

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

Raymond Chen

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 folders) feature that comes with Windows cannot deal with. When we try to extract the contents of the zip file, we get the error message 'Windows has blocked access to these files to help protect your computer.' We've attached a copy of the file." The Compressed Folders fun...

Oct 9, 2012
Post comments count 0
Post likes count 1

Usage guidance for a popcorn machine in the kitchenette

Raymond Chen

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 particular order) This week is Fire Prevention Week.

Oct 8, 2012
Post comments count 0
Post likes count 1

How does Explorer deal with recent files that were renamed?

Raymond Chen

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 exists, the shell tries to resolve the shortcut; i.e., find the object, wherever it ended up moving to. As I explained several months before the question was posted, the algorithm used by the shell varies depending on the operating system and the file system and your domain p...

Oct 5, 2012
Post comments count 0
Post likes count 1

How do I override the default icon selection algorithm?

Raymond Chen

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 current display color depth to select an image, but they were obtaining the icon for printing purposes, so they wanted to get the highest-color-quality icon rather than the one that matched the screen's color depth. How do you override the default algorithm? You basically do the...