Re 3, you'll have to copy the values for the property from Directory to your custom one. And set the flag below saying it's there. It's type will be folder or system folder.
IShellFolder:
arseDisplayName
Translates a file object's or folder's display name into an item identifier list.
HRESULT ParseDisplayName(
HWND hwnd,
LPBC pbc,
LPOLESTR pszDisplayName,
ULONG *pchEaten,
LPITEMIDLIST *ppidl,
ULONG *pdwAttributes
);
Parameters
hwndOwner
[in] Optional window handle. The client should provide a window handle if it displays a dialog or message box. Otherwise set hwndOwner to NULL.
pbc
[in] Optional bind context that controls the parsing operation. This parameter is normally set to NULL.
lpwszDisplayName
[in] Null-terminated UNICODE string with the display name. Because each Shell folder defines its own parsing syntax, the form this string can take may vary. The desktop folder, for instance, accepts paths such as "c:\My Docs\My File.txt". It also will accept references to items in the namespace that have a globally unique identifier (GUID) associated with them using the "::{GUID}" syntax. For example, to retrieve a fully qualified identifier list for the Control Panel from the desktop folder, you can use:
"{CLSID for My Computer}\::{CLSID for the Control Panel}"
pchEaten
[out] Pointer to a ULONG value that receives the number of characters of the display name that was parsed. If your application does not need this information, set pchEaten to NULL, and no value will be returned.
ppidl
[out] Pointer to an ITEMIDLIST pointer that receives the item identifier list for the object. The returned item identifier list specifies the item relative to the parsing folder. If the object associated with lpwszDisplayName is within the parsing folder, the returned item identifier list will contain only one SHITEMID structure. If the object is in a subfolder of the parsing folder, the returned item identifier list will contain multiple SHITEMID structures. If an error occurs, NULL is returned in this address.
pdwAttributes
[in/out] Optional parameter that can be used to query for file attributes. If not used, it should be set to NULL. To query for one or more attributes, initialize the pdwAttributes with the flags that represent the attributes of interest. On return, those attributes that are true and were requested will be set. A file object's attribute flags may be zero or a combination of the following values:
ValueDescription
SFGAO_CANCOPY The specified file objects or folders can be copied (same value as the DROPEFFECT_COPY flag).
SFGAO_CANDELETE The specified file objects or folders can be deleted.
SFGAO_CANLINK Shortcuts can be created for the specified file objects or folders. This flag has the same value as DROPEFFECT_LINK. Typically, this flag is used 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_CANMONIKERIt is possible to create monikers for the specified file objects or folders.
SFGAO_CANMOVE The specified file objects or folders can be moved (same value as the DROPEFFECT_MOVE flag).
SFGAO_CANRENAME 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 This flag is a mask for the capability flags.
SFGAO_DROPTARGET The specified file objects or folders are drop targets.
SFGAO_HASPROPSHEET 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:
ValueDescription
SFGAO_DISPLAYATTRMASK This flag is a mask for the display attributes.
SFGAO_GHOSTED The specified file objects or folders should be displayed using a ghosted icon.
SFGAO_LINK The specified file objects are shortcuts.
SFGAO_READONLY The specified file objects or folders are read-only.
SFGAO_SHARE The specified folders are shared.
A file object's contents flags may be zero or a combination of the following values:
ValueDescription
SFGAO_CONTENTSMASK This flag is a mask for the contents attributes.
SFGAO_HASSUBFOLDER The specified folders have subfolders (and are, therefore, expandable in the left pane of Windows® Explorer).
A file object's miscellaneous attributes may be zero or a combination of the following values:
ValueDescription
SFGAO_BROWSABLE The specified items can be browsed in place.
SFGAO_COMPRESSED The specified items are compressed.
SFGAO_FILESYSTEM The specified folders or file objects are part of the file system (that is, they are files, directories, or root directories).
SFGAO_FILESYSANCESTOR The specified folders contain one or more file system folders.
SFGAO_FOLDER The specified items are folders.
SFGAO_NEWCONTENT The objects contain new content.
SFGAO_NONENUMERATED The items are nonenumerated items.
SFGAO_REMOVABLE The specified file objects or folders are on removable media.
SFGAO_VALIDATE This flag is used to confirm the existence of the folder or object that corresponds to lpwszDisplayName. Not every folder implements this flag, but if it is passed in to ParseDisplayName, and the folder or object does not exist, a failure code should be returned.
Return Values
Returns NOERROR if successful, or an OLE-defined error value otherwise.
Remarks
Some Shell folders may not implement ParseDisplayName. Each folder that does will define its own parsing syntax.
Querying for some attributes may be relatively slow and use significant amounts of memory. For example, to determine if a file is shared, the Shell will load network components. This procedure may require the loading of several DLLs. The purpose of dwAttributes is to allow you to restrict the query to only that information that is needed. The following code fragment illustrates how to find out if a file is compressed:
IShellFolder *psf;
DWORD dwAttribs = SFGAO_COMPRESSED;
....
hres = psf->ParseDisplayName(NULL,
NULL,
lpwszDisplayName,
&cbEaten,
&pidl,
&dwAttribs);
if(dwAttribs & SFGAO_COMPRESSED)
{
//do something with the compressed file
}
Since pdwAttributes is an in/out parameter, it should always be initialized. If you pass in an uninitialized value, some of the bits may be set. ParseDisplayName will then query for the corresponding attributes, which may lead to undesirable delays or memory demands. If you do not wish to query for attributes, set pdwAttributes to NULL to avoid unpredictable behavior.
This method is similar to the OLE IParseDisplayName:
arseDisplayName method.
See Also
IShellFolder, IShellLink, IShellFolder::GetAttributesOf
Requirements
Version 4.00 and later of Shell32.dll
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98/Me: Requires Windows 95 or later.
Header: Declared in Shlobj.h.
--
----------------------------------------------------------
http://www.g2mil.com/Dec2003.htm
localhost00 said:
I used a key that wasn't already used
Here is the regcode I have:
----------------Music Album.reg----------------
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{F5175861-2688-11d0-9C5E-00AA00A45958}]
@="Music Album"
[HKEY_CLASSES_ROOT\CLSID\{F5175861-2688-11d0-9C5E-00AA00A45958}\DefaultIcon]
@="%1\album.ico"
[HKEY_CLASSES_ROOT\CLSID\{F5175861-2688-11d0-9C5E-00AA00A45958}\InProcServer32]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25, 00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,77,00,65,00, 62,00,63,00,68,00,65,00,63,00,6b,00,2e,00,64,00,6c,00,6c,00,00,00
"ThreadingModel"="Apartment"
[HKEY_CLASSES_ROOT\CLSID\{F5175861-2688-11d0-9C5E-00AA00A45958}\shell]
@="enqueue"
[HKEY_CLASSES_ROOT\CLSID\{F5175861-2688-11d0-9C5E-00AA00A45958}\shell\enqueue]
@="Enqueue in Winamp"
[HKEY_CLASSES_ROOT\CLSID\{F5175861-2688-11d0-9C5E-00AA00A45958}\shell\enqueue\command]
@="c:\\winamp\\winamp.exe /add \"%1\\index.m3u\""
[HKEY_CLASSES_ROOT\CLSID\{F5175861-2688-11d0-9C5E-00AA00A45958}\shell\play]
@="Play in Winamp"
[HKEY_CLASSES_ROOT\CLSID\{F5175861-2688-11d0-9C5E-00AA00A45958}\shell\play\command]
@="c:\\winamp\\winamp.exe \"%1\\index.m3u\""
----------------End Music Album.reg----------------
----------------Desktop.ini----------------
[.ShellClassInfo]
CLSID={F5175861-2688-11d0-9C5E-00AA00A45958}
----------------End Desktop.ini----------------
Now, I have been trying to research what shellex and ShellFolder\Attributes do, but I haven't been able to find answers.
Thanks for the script, bt it doesn't get at my goal, which is not to put a System Folder Icon on the desktop and My Computer, but to change the behavior of a collection of Folders.