11.2 Explorer Architecture

only for RuBoard - do not distribute or recompile

11.2 Explorer Architecture

As Figure 11.4 illustrates, there are five distinct parts to Explorer: the menu, the toolbar, the tree view, the content pane (or view), and the status bar.

Figure 11.4. Explorer architecture
figs/vshl.1104.gif

When Explorer finds a namespace extension at a junction point (as defined in any of the four ways discussed in Section 11.1.2 earlier in this chapter), it loads the extension and queries for IShellFolder . This interface represents the folder in the tree view and basically acts as a liaison to the rest of the namespace extension. Everything a namespace extension needs is generated through this interface.

Explorer then asks the extension for an IShellView interface. This interface is provided by IShellFolder and is responsible for creating the view window in the content pane. The view in turn is responsible for displaying the data. Something that might not be so obvious is that Explorer does not provide the list view that is usually found in the content pane. It is the responsibility of the object implementing IShellView to create this window. Also, it must be noted that a namespace extension must be prepared to create multiple views. For example, Explorer provides five views: Large Icons, Small Icons, Details, List, and View as Web Page. But you can also provide custom views. Consider the Fonts namespace extension. It provides a view called List Fonts by Similarity that allows you to see groups of fonts that are similar in appearance. Because several views are possible, the object implementing IShellFolder is distinct from the object implementing IShellView . This is a one-to-many relationship.

Explorer provides the object implementing IShellView with a reference to an interface called IShellBrowser . This interface can be used by the view object to manipulate the menu, toolbar, and status bar of Explorer to add new menu items and toolbar buttons , and to manage text in the status bar.

Once the content pane has been made ready to receive data, the shell asks the namespace extension to enumerate the contents of the folder. This is handled by a third object that implements the IEnumIDList interface. This object is separate from IShellFolder because, like IShellView , it must be called multiple times throughout the lifetime of the extension.

Every time a branch of the extension is opened, an instance of IEnumIDList is created. In the tree view, the enumerated items that have the "folder" attribute are displayed. If these folders have the "has subfolders " attribute, a "+" node is displayed. The "+" nodes, of course, can be opened, and the entire process begins again.

IShellFolder provides services to handle the display text for each item. Additional user interface elements such as icons, context menus , and InfoTips are provided for as well.

only for RuBoard - do not distribute or recompile


Visual Basic Shell Programming
Visual Basic Shell Programming
ISBN: B00007FY99
EAN: N/A
Year: 2000
Pages: 128

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net