11.7 Registering DemoSpace

only for RuBoard - do not distribute or recompile

11.7 Registering DemoSpace

The last thing we need to do is register the namespace extension. The registry information shown in Example 11.35 will insert our namespace extension under My Computer. Remember, if you type this listing in, everything inside of the square brackets must be on the same line.

Example 11.35. DemoSpace.reg
 REGEDIT4 [HKEY_CLASSES_ROOT\CLSID\{DAE49F45-660D-11D3-BB7C-444553540000}] @="Root" [HKEY_CLASSES_ROOT\CLSID\{DAE49F45-660D-11D3-BB7C-444553540000}\ShellFolder\]  "Attributes"=dword:a0000000  [HKEY_CLASSES_ROOT\CLSID\{DAE49F45-660D-11D3-BB7C-444553540000}\DefaultIcon\] @="shell32.dll,46" [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer \  MyComputer  \Namespace\{DAE49F45-660D-11D3-BB7C-444553540000}\] @ = "Nothing Special Namespace Extension" HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\ ShellExtensions\Approved\] "{DAE49F45-660D-11D3-BB7C-444553540000}"="Demo namespace in VB" 

The CLSID in the listing is the same CLSID you would find under the HKEY_CLASSES_ROOT\DemoSpace.ShellFolder key. This is important. Everything starts with IShellFolder .

Also, notice the Attributes setting. This value is created by OR ing the SFGAO constants (See Example 11.2). The value A0000000 is a result of SFGAO_FOLDER ORed with SFGAO_HASSUBFOLDERS . This attribute is for the junction point of our namespace extension. Without this key, we wouldn't be able to open our namespace extension at all.

You might also decide that you would like to insert this example under the Desktop. This is as simple as changing My Computer to Desktop in the registry script. If you do this, you might also want to change the attributes to A0000020. This value is the result of OR ing together SFGAO_FOLDER , SFGAO_HASSUBFOLDERS , and SFGAO_CANDELETE . When you add a namespace extension under the Desktop, an icon is added to the Desktop. By adding the SFGAO_CANDELETE attribute, the Delete command is available from the context menu of the namespace extension. Otherwise, it would be impossible to remove the icon from the Desktop.

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