The Shell Utility API Routines

The shell utility API routines allow you to use a different set of API routines instead of the ones I’ve discussed up until now. While this might seem like a needless fragmentation of what should be a unified API, there’s are two reasons for it. First, some of the tasks that the shell utility API can do don’t have direct equivalents in the Win32 API. For example, the shell API has routines to copy a key and its contents, delete an entire key and all its subkeys, and so on. Second, Microsoft is clearly trying to position the utility API as the thing you use if you’re writing small utility components- not all of which will necessarily run on Windows as we know it today. (For example, what about an embedded version of Windows running on a smart card?)

Tip

The shell API routine definitions are unnecessarily confusing because of their naming scheme (or lack of one.) Most of the Registry-related routines have names that start with SHReg, but some don’t (e.g., SHDeleteValue or SHGetValue). Worse still, the file association routine names don’t use the SH prefix at all.

Working with File Associations

One of the biggest innovations of the Macintosh when it was originally introduced was the idea that documents would somehow “know” what application they belonged to. The Mac OS implemented this by storing eight bytes of type and creator information with each file. The type bytes identified the file’s datatype, and the creator bytes associated the file with a particular ...

Get Managing The Windows 2000 Registry now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.