--
---------------------------------------------------------------
David Candy
www.mvps.org/serenitymacros
http://www.winsite.com/bin/Info?500000002364
---------------------------------------------------------------
"Patrick J O'Neil" <pato...@hotmail.com> wrote in message news:3C55ECB9...@hotmail.com...
> I have an application that manages images in specialized database. I
> would like to implement the Compressed Zip Explorer interface to provide
> a view of the image files within my database but cannot seem to find any
> documentation on how Microsoft has implemented compressed zip files as
> folders.
>
> Does anyone know how to change a file into a folder that acts like a
> shell namespace? Microsoft knows how but noone else seems to....
>
> Thanks.
>
Most namespace extensions are a subset of the Shell namespace. When you create a junction point, as described in Specifying a Namespace Extension's Location, Microsoft® Windows® Explorer allows users to navigate into and out of your namespace extension just like any other folder. However, it is also possible to use Windows Explorer to display only the contents of your namespace extension. This display option is sometimes referred to as a rooted view. Although not commonly used, rooted views might be preferable to normal views for some types of extensions.
With a rooted view, a new instance of Windows Explorer is created that displays the contents of the extension as a separate namespace. The tree view of a rooted view shows only those folders that are part of the extension. Users cannot navigate from a rooted view to other parts of the Shell namespace.
Extensions are implemented in the same way for rooted views as they are for normal views. The only difference is in the way the contents of the extension are displayed by Windows Explorer. It is even possible to have normal and rooted views of the same extension.
To open a view of an extension, you must launch an instance of Explorer.exe with a /root flag. There are several different ways to launch a rooted view, depending on the nature of your extension.
Typically, clicking or double-clicking the folder that represents a junction point opens a normal view of the contents of the associated extension. However, you can use the registry to specify that browsing into a junction point will open a rooted view. To do so, add Open and Explore command keys to your extension's CLSID registry key.
HKEY_CLASSES_ROOT
CLSID
...
{Extension CLSID}
...
Shell
Open
Command==%SYSTEMROOT% \explorer.exe/e,/root,"%1"
Explore
Command==%SYSTEMROOT% \explorer.exe/e,/root,"%1"
When the user clicks or double-clicks the junction point, an instance of Explorer.exe is launched to display the contents of the extension as a rooted view.
Another approach to launching a rooted view is to create a shortcut file and set the command to Explorer.exe with a /root flag. The exact form the command takes depends on the location of the junction point:
Explorer.exe /e,/root,::{Extension CLSID}
Explorer.exe /e,/root,[Fully qualified path to the folder]
Explorer.exe /e,/root,::{Folder CLSID}\::{Extension CLSID}The system virtual folders that can contain junction points have the following CLSIDs.
| My Computer | {20D04FE0-3AEA-1069-A2D8-08002B30309D} |
| My Network Places | {208D2C60-3AEA-1069-A2D7-08002B30309D} |
| Control Panel | {21EC2020-3AEA-1069-A2DD-08002B30309D} |
| Internet Explorer | {871C5380-42A0-1069-A2EA-08002B30309D} |
Note Systems earlier than Microsoft® Windows® 2000 use a display name of Network Neighborhood instead of My Network Places. However, the CLSID is the same for both.
Extensions are usually presented to the user as a folder. However, you can also use an extension to allow users to browse the contents of a file. Extensions of this sort are typically used to display the contents of the members of a file class. For instance, the members of a file class might contain multiple compressed files or images, organized in a hierarchy. Rather than write an application to allow the user to view the contents of such a file, you can instead write a namespace extension and let Windows Explorer handle the display.
You must use a rooted view to have an extension display the contents of a file. The most common way to provide a rooted view of the members of the file class is to define a shortcut menu verb that launches an instance of Explorer.exe. By making this verb the default verb, a double-click will also open a rooted view of the file. You can either define a verb for all members of the file class by modifying the registry, or dynamically define verbs on a file-by-file basis by implementing a shortcut menu handler.
The following example illustrates how to use the registry to provide a rooted view of the members of a file class by modifying the registry. The sample registry entry is a modification of one of the examples in Extending Shortcut Menus. The registry entries define files with an .myp file name extension as a file class, and use the browse verb to launch a rooted view of members of that class.
HKEY_CLASSES_ROOT
.myp=MyProgram.1
...
MyProgram.1=MyProgram Application
Shell=browse
browse
command=%SYSTEMROOT%\explorer.exe /e,/root,{Extension CLSID}, "%1"
You can use the same verb to programmatically launch a rooted view of a member of the file class by calling ShellExecute.
Well, I have finally made some progress but am still not there. It's very strange that the documentation does not match the implementation. I have tried every combination possible. None of the commands work if they are set up in the system registry, regardless of how I try.
I have found only one command that works from the Start-->Run and that
is:
explorer /e,/root, {F778AFE0-2289-11d0-8AEC-00A0C90C9246}, D:\My Documents\Combined
Library.dpl
This opens a new Explorer window (not exactly what I want but a start) with "Combined Library.dpl" as the folder name and my namespace extension as the viewer. However, for the life of me, I cannot get it to treat the "Combined Library.dpl" as a folder with subfolders (e.g., a plus sign to the left). I need that to be able to navigate to the different subfolders in the library.
Any ideas?
Pat
This is an additional parameter that means a Windows internal structure is being passed. eg:
Explorer.exe /e,/idlist,%I
The %I is a replacable parameter representing an IDLIST.
"Patrick J O'Neil" <pato...@hotmail.com> wrote in message news:3C31C60D...@hotmail.com...
I looked briefly at the cabview sample and will probably need to go back to it since everything that I try seems to fail.
I tried setting up my registry just as you suggested but I get an error message when I "Explore" the file. The error message states that Explorer cannot find the file!!! The name is right but it cannot find it.
There is obviously something that I am missing but I don't have a clue what it is....
Is there a complete list of Explorer slash commands. I have seen so far /e, /root and /idlist?
Frustrated....
Pat
David Candy wrote:
Have you seen cabview sample (it also comes with 95 powertoys and NT4 powertoys too I think) that is part of 98/2000/ME/XP. + signs are put there with the shellfolder flags in it's registry entries. CabviewWindows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\CLSID\{0CD7A5C0-9F37-11CE-AE65-08002B2E1262}\ShellFolder]
"Attributes"=dword:680001a0The attributes define the behaviour of your namespace extension. This is the command line cabview uses%SystemRoot%\Explorer.exe /idlist,%I,%LThough it uses DDE as well.
/IDLIST
This is an additional parameter that means a Windows internal structure is being passed. eg:Explorer.exe /e,/idlist,%I
The %I is a replacable parameter representing an IDLIST.%L is a long file name The extension is set to the name space[HKEY_CLASSES_ROOT\.cab]
@="CLSID\\{0CD7A5C0-9F37-11CE-AE65-08002B2E1262}"
"InfoTip"="Contains compressed files"
--
---------------------------------------------------------------
David Candy
www.mvps.org/serenitymacros
http://www.winsite.com/bin/Info?500000002364
---------------------------------------------------------------
"Patrick J O'Neil" <pato...@hotmail.com> wrote in message news:3C31C60D...@hotmail.com...Hi David,
"Patrick J O'Neil" <pato...@hotmail.com> wrote in message news:3C350330...@hotmail.com...
Here are my registry entries
HKCR/.dpl default value is Digital PhotoLibrary
HKCR/DigitalPhotoLibrary default value is "Digital Photo Library"
HKCR/DigitalPhotoLibrary/CLSID default value is {F778AFE0-2289-11d0-8AEC-00A0C90C9246}
HKCR/DigitalPhotoLibrary/Shell/Execute/Command default value is ""%SYSTEMROOT%\explorer.exe
/e, /root"
HKCR/DigitalPhotoLibrary/Shell/Execute1/Command default value is ""%SystemRoot%\Explorer.exe
/idlist,%I,%L"
HKCR/DigitalPhotoLibrary/Shell/Execute1/Command default value is ""%SystemRoot%\Explorer.exe
/idlist,%I,%L"
HKCR/DigitalPhotoLibrary/Shell/Execute2/Command default value is "%SYSTEMROOT%explorer
/e,::{F778AFE0-2289-11d0-8AEC-00A0C90C9246},"%1""
All of these give me an error...
Lets go back to what I am trying to accomplish... I am trying to implement a namespace extension to explore database files. I want to trigger the creation of a "???.dpl" namespace folder ( with "+" sign to denote subfolder) every time Windows Explorer encounters a .dpl file in a folder.
Is this possible?
David Candy wrote:
That is the complete list of explorer commands. You would have to set up the DDE so explorer and your NSE can browse through your file. I just get a sense, and I can't put my finger on it, that there's a misunderstanding somewhere between how you think it works and how it works. This is not the best group for this question. I don't program in C and I've never actually written one. Try news://msnews.microsoft.com/microsoft.public.platformsdk.shellTell them what've you've done, what interfaces you've used, when you've used what function calls/methods in response to what events. Post your full registry entries as well (post them here and I'll look at them). But you can't explore into your folder unless it's rooted.
--
---------------------------------------------------------------
David Candy
www.mvps.org/serenitymacros
http://www.winsite.com/bin/Info?500000002364
---------------------------------------------------------------
"Patrick J O'Neil" <pato...@hotmail.com> wrote in message news:3C350330...@hotmail.com...Hi Dave,
Retrieves the attributes of one or more file objects or subfolders.
HRESULT GetAttributesOf(
UINT cidl,
LPCITEMIDLIST *apidl,
SFGAOF *rgfInOut
);
A file object's capability flags may be zero or a combination of the following values:
| Flag | Value | Description |
|---|---|---|
| SFGAO_CANCOPY | 0x00000001 | The specified file objects or folders can be copied (same value as the DROPEFFECT_COPY flag). |
| SFGAO_CANDELETE | 0x00000020 | The specified file objects or folders can be deleted. |
| SFGAO_CANLINK | 0x00000004 | Shortcuts can be created for the specified file objects or folders. This flag has the same value as DROPEFFECT_LINK. The normal use of this flag is to add a "Create Shortcut" item to the shortcut menu that is displayed during drag-and-drop operations. However, SFGAO_CANLINK also adds a "Create Shortcut" item to the Windows Explorer's File menu, and to normal shortcut menus. If this item is selected, your application's IContextMenu::InvokeCommand will be invoked with the lpVerb member of the CMINVOKECOMMANDINFO structure set to "link". Your application is responsible for creating the link. |
| SFGAO_CANMONIKER | 0x00400000 | It is possible to create monikers for the specified file objects or folders. |
| SFGAO_CANMOVE | 0x00000002 | The specified file objects or folders can be moved (same value as the DROPEFFECT_MOVE flag). |
| SFGAO_CANRENAME | 0x00000010 | The specified file objects or folders can be renamed. Note that this flag is essentially a suggestion. It does not guarantee that a namespace client will rename the file or folder object. |
| SFGAO_CAPABILITYMASK | 0x00000177 | This flag is a mask for the capability flags. |
| SFGAO_DROPTARGET | 0x00000100 | The specified file objects or folders are drop targets. |
| SFGAO_HASPROPSHEET | 0x00000040 | The specified file objects or folders have property sheets. |
A file object's display attributes may be zero or a combination of the following values:
| Flag | Value | Description |
|---|---|---|
| SFGAO_DISPLAYATTRMASK | 0x000F0000 | This flag is a mask for the display attributes. |
| SFGAO_GHOSTED | 0x00080000 | The specified file objects or folders should be displayed using a ghosted icon. |
| SFGAO_LINK | 0x00010000 | The specified file objects are shortcuts. |
| SFGAO_READONLY | 0x00040000 | The specified file objects or folders are read-only. |
| SFGAO_SHARE | 0x00020000 | The specified folders are shared. |
A file object's contents flags may be zero or a combination of the following values:
| Flag | Value | Description |
|---|---|---|
| SFGAO_CONTENTSMASK | 0x80000000 | This flag is a mask for the contents attributes. |
| SFGAO_HASSUBFOLDER | 0x80000000 | The specified folders may have subfolders, and are, therefore expandable in the left pane of Windows® Explorer. |
Note: The SFGAO_HASSUBFOLDER attribute is only advisory, and may be returned by Shell folder implementations even if they do not contain subfolders. Returning SFGAO_HASSUBFOLDER is recommended whenever a significant amount of time is required to determine whether or not any subfolders exist. For example, the Shell always returns SFGAO_HASSUBFOLDER when a folder is located on a network drive.
A file object's miscellaneous attributes may be zero or a combination of the following values:
| Flag | Value | Description |
|---|---|---|
| SFGAO_BROWSABLE | 0x08000000 | The specified items can be browsed in place. |
| SFGAO_COMPRESSED | 0x04000000 | The specified items are compressed. |
| SFGAO_FILESYSTEM | 0x40000000 | The specified folders or file objects are part of the file system (that is, they are files, directories, or root directories). |
| SFGAO_FILESYSANCESTOR | 0x10000000 | The specified folders contain one or more file system folders. |
| SFGAO_FOLDER | 0x20000000 | The specified items are folders. |
| SFGAO_NEWCONTENT | 0x00200000 | The objects contain new content. |
| SFGAO_NONENUMERATED | 0x00100000 | The items are nonenumerated items. |
| SFGAO_REMOVABLE | 0x02000000 | The specified file objects or folders are on removable media. |
| SFGAO_VALIDATE | 0x01000000 | Validate cached information. The Shell will validate that the objects specified in apidl still exist and will not use cached information when retrieving the attributes. If one or more of the items specified in apidl no longer exist, this method will return an error code. If cidl is zero, the Shell will discard all cached information for the Shell folder. This is similar to doing a refresh of the folder. |
Returns NOERROR if successful, or an OLE-defined error value otherwise.
You can optimize this operation by not returning unspecified flags.
Version 4.00 and later of Shell32.dll
Windows NT/2000: Requires Windows NT 4.0 or later."Patrick J O'Neil" <pato...@hotmail.com> wrote in message news:3C364366...@hotmail.com...
The web reference that you give is to a cabview extraction program and not the sample cabview shell extension. I still cannot find the sample cabview shell anywhere other than the article with snippits of code in it. Do you have a copy or know where to download from?
I don't understand your meaning of the following: "It goes in shellfolder key not shellext key, see mydocs or mycomputer or recycled bin entries."
Thanks for the explanation of the DDE entries. I think I understand what you are saying... that Explorer uses them and not any of my code....
Thanks again for putting up with me... I really appreciate it....
Pat
David Candy wrote:
Cabview the program is different to cabview the samplehttp://msdn.microsoft.com/msdn-files/026/000/017/readme_txt.asp?frame=true It goes in shellfolder key not shellext key, see mydocs or mycomputer or recycled bin entries. DDE is used to change folders without starting a new instance of explorer. EG when you click a word document word start up without a document open then explorer sends it a fileopen command and the filename so the existing word will open files
"Patrick J O'Neil" <pato...@hotmail.com> wrote in message news:3C387C5B...@hotmail.com...
--
---------------------------------------------------------------
David Candy
www.mvps.org/serenitymacros
http://www.winsite.com/bin/Info?500000002364
---------------------------------------------------------------
"David Candy" <dav...@sia.net.au> wrote in message news:OnONYu1lBHA.2252@tkmsftngp04...
--
---------------------------------------------------------------
David Candy
www.mvps.org/serenitymacros
http://www.winsite.com/bin/Info?500000002364
---------------------------------------------------------------
"Patrick J O'Neil" <pato...@hotmail.com> wrote in message news:3C3C0468...@hotmail.com...