13.4 Registry

only for RuBoard - do not distribute or recompile

13.4 Registry

Here's the big question. How do we distinguish our band object as an Explorer band versus a Communication band or a Desk band? We do this by assigning our component to the Explorer Band component category . Component categories are used to group functionality. For instance, when you create an ActiveX DLL component in Visual Basic, a registry setting is added that specifies the component to be in the category "Automation Objects." Verify this for yourself. Look up any of the CLSIDs for the components we have created in this book under its HKEY_CLASSES_ROOT\CLSID entry. You will find a subkey named Implemented Categories . Here you will find the following key:

 {40FC6ED5-2438-11CF-A3DB-080036F12502} 

Now, search for this key under the following key:

 HKEY_CLASSES_ROOT\Component Categories 

You will find that this CLSID represents a category called "Automation Objects." OLE View groups components by category. Take a look. If you ever work on a project containing several components that implement common interfaces, you might want to create your own component category. It's as simple as creating a GUID with GUIDGEN.EXE and adding it to:

 HKEY_CLASSES_ROOT\Component Categories 

This mechanism allows the shell to quickly find the components it requires, in our case, Explorer Bands. Table 13.3 lists the CLSIDs for the three types of band objects.

Table13.3. CLSIDs of Band Categories

Band Category

CLSID

Desk Band

{00021492-0000-0000-C000-000000000046}

Explorer Band

{00021493-0000-0000-C000-000000000046}

Communication Band

{00021494-0000-0000-C000-000000000046}

So, in order to implement our component as an Explorer Band, we need to implement the category {00021493-0000-0000-C000-000000000046}. The default value for the HKEY_CLASSES_ROOT\CLSID key becomes the name that will be displayed in Explorer's menu for the band object. These settings are shown in Figure 13.9.

Figure 13.9. FileSpider registry settings
figs/vshl.1309.gif

Something to Know About Desk Bands

When implementing a desk band, there is something you need to know if you happen to be running Windows 2000 (also Windows 98 Second Edition).

It seems Windows 2000 keeps a category cache that updates itself only if it has determined that an installation has been run or if the cache location in the registry is not present. Restarting the shell will do nothing in terms of getting the shell to recognize the band.

The solution is to delete the following key from the registry:

 HKEY_CLASSES_ROOT\     Component Categories\         {00021492-0000-0000-C000-000000000046}\             Enum 

The CLSID under Component Categories is the category for desk bands (see Table 13.3).

You can read more about this feature in KnowledgeBase article Q214842.

Now that the band object is compiled and registered, it can be activated by selecting it from Explorer's View menu, as shown in Figure 13.10.

Figure 13.10. Opening FileSpider from the Explorer menu
figs/vshl.1310.gif

The complete listing for the FileSpider registry script is shown in Example 13.11.

Example 13.11. FileSpider Registry Script
 REGEDIT4 [HKEY_CLASSES_ROOT\CLSID\{8DA95148-3C75-11D3-BB7C-444553540000}] @ = "FileSpider" [HKEY_CLASSES_ROOT\CLSID\{8DA95148-3C75-11D3-BB7C-444553540000}\Implemented Categories\{00021493-0000-0000-C000-000000000046}] 
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