O'Reilly logo

VB Shell Programming by J.P. Hamilton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the Namespace Extension

The extension we will build in this chapter is far more contrived than the previous examples. It does absolutely nothing. The point of this project is to learn how to build a namespace extension. Because most of the code in a namespace extension can be of a proprietary nature, it is best that we use an example that is fairly easy to implement yet covers all of the major features of a namespace extension.

Our project, which we’ll call DemoSpace, begins with a junction point under My Computer called Root. Root will contain five “folders” numbered through 4. Each folder will contain “items” numbered through the current folder number. DemoSpace is shown in Figure 11.6.

DemoSpace

Figure 11-6. DemoSpace

When we wrote shell extensions, each extension mapped to one object. That object implemented all the interfaces that were required by the extension. But in this case, things work a little differently. Folders operate independently of the view. It is perfectly legal for a namespace extension to provide several views. So theoretically, folders and views represent a one-to-many relationship.

Namespace extensions will contain several objects, not just one. One object will implement IShellFolder and IPersistFolder. This object can be associated with the action that takes place in the tree view. Another object will implement IShellView, which of course, represents the content ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required