The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Why waste your money on the car when it's the sound system you care about?
Sep 8, 2011
Post comments count 0
Post likes count 1

Why waste your money on the car when it's the sound system you care about?

Raymond Chen
Raymond Chen

There is apparently a subculture of people who decide to economize on the car part of the "loud stereo in car" formula (since they really don't care about the car—it's all about the music) and put their loud stereo on the back of a bicycle instead. This quotation from the article caught my attention: "People say, 'It's the next best thing to having a system in a car.' But it's better because you don't even have to roll down the windows." I had been unsure what to think about people who drive down the street with their stereos blaring. Are they audiophiles who prefer their music loud? Or are they jerks ...

Why doesn't the Disk Management snap-in incorporate S.M.A.R.T. data?
Sep 8, 2011
Post comments count 0
Post likes count 0

Why doesn't the Disk Management snap-in incorporate S.M.A.R.T. data?

Raymond Chen
Raymond Chen

My article a while back on Why the Disk Management snap-in reports my volume as Healthy when the drive is dying gave the low-level explanation of why the Disk Management snap-in does not incorporate SMART information: because the Disk Management snap-in is concerned with volume partitioning. DWalker59 noted that the use of the word "Healthy" carries more meaning than the authors of the snap-in intended. The authors of the snap-in assumed that everybody knew what the Disk Management snap-in was for, and therefore everybody know that the word "Healthy" applied to the state of the file system. I never said that t...

Why is the registry a hierarchical database instead of a relational one?
Sep 7, 2011
Post comments count 0
Post likes count 0

Why is the registry a hierarchical database instead of a relational one?

Raymond Chen
Raymond Chen

Commenter ton asks why the registry was defined as a hierarchical database instead of a relational database. Heck, it's not even a hierarchical database! The original registry was just a dictionary; i.e., a list of name/value pairs, accessed by name. In other words, it was a flat database. If you turned your head sideways and treated the backslashes as node separators, you could sort of trick yourself into believing that this resulted in something vaguely approximating a hierarchical database, and a really lame one at that (since each node held only one piece of data). When you choose your data structu...

What happened to that suspicious-looking guy hanging around the entrance?
Sep 6, 2011
Post comments count 0
Post likes count 0

What happened to that suspicious-looking guy hanging around the entrance?

Raymond Chen
Raymond Chen

One of the fun parts of attending a conference is swapping stories with other professionals. Today's story is in honor of Global Security Week. (And retroactively in honor of the upcoming //build conference.) One of the attendees (let's call him Bob) shared with me a story of the time they had to make a change in one of their data centers. This particular change required physical presence at the facility, and to minimize impact on customers, the change was made at night (presumably because that's when demand was lowest). When Bob arrived at the data center, he walked past a suspicious-looking guy on his way to ...

Thanks for letting me know what my ideal career and company are
Sep 5, 2011
Post comments count 0
Post likes count 0

Thanks for letting me know what my ideal career and company are

Raymond Chen
Raymond Chen

When it's performance review season, all of a sudden you start getting mail about career management. What a coincidence. There are a variety of career management tools available, some mandatory, some optional. I gave one of the optional ones a shot, since it claimed to help me "manage my career and professional development", and as I already noted, I appear to have been promoted by mistake all these years, so maybe I should figure out how to get promoted for real. This particular tool sends me to the Web site of an external company that was contracted by Microsoft to provide career guidance services. I went thr...

What's the story with the parameters to the WM_INPUT_DEVICE_CHANGE message?
Sep 2, 2011
Post comments count 0
Post likes count 0

What's the story with the parameters to the WM_INPUT_DEVICE_CHANGE message?

Raymond Chen
Raymond Chen

A customer found these strange macros in winuser.h: According to the documentation for the message, the is the operation code and the is a handle to the device that changed. Given that definition, the correct macro would be . What's up with the bogus macro? The macro was incorrectly defined in Windows Vista. In the Windows 7 version of the Platform SDK, the correct macro was added, but in order to avoid introducing a breaking change to existing code, the old broken macro remains in place in order to retain bug-for-bug compatibility with existing code. Even though the macro didn't work, ...

Invoking commands on items in the Recycle Bin
Sep 1, 2011
Post comments count 0
Post likes count 0

Invoking commands on items in the Recycle Bin

Raymond Chen
Raymond Chen

Our old friend, the IContextMenu.

Modernizing our simple program that retrieves information about the items in the Recycle Bin
Aug 31, 2011
Post comments count 0
Post likes count 0

Modernizing our simple program that retrieves information about the items in the Recycle Bin

Raymond Chen
Raymond Chen

Last time, we wrote a simple program to print various properties of the items in the Recycle Bin, and we did so in the classical style, using item ID lists and s. One thing you may have noticed is that a lot of functions take the combination of an and a . In the shell namespace, operations on items usually happen by means of the pair (folder, child), and one of the common mistakes made by beginners is failing to keep track of the pairing and passing child pidls to the wrong parent folder. Even if you're not a beginner and are good at keeping track of which child pidls correspond to which parent folders, it's...

How can I get information about the items in the Recycle Bin?
Aug 30, 2011
Post comments count 0
Post likes count 0

How can I get information about the items in the Recycle Bin?

Raymond Chen
Raymond Chen

For some reason, a lot of people are interested in programmatic access to the contents of the Recycle Bin. They never explain why they care, so it's possible that they are looking at their problem the wrong way. For example, one reason for asking, "How do I purge an item from the Recycle Bin given a path?" is that some operation in their program results in the files going into the Recycle Bin and they want them to be deleted entirely. The correct solution is to clear the flag when deleting the items in the first place. Moving to the Recycle Bin and then purging is the wrong solution because your search-and-de...