Geoff Chappell - Software Analyst
The ShellDesktop class is one of many that SHELL32 exposes through its exported DllGetClass function. Instances can therefore be created using such well-documented COM functions as CoCreateInstance, by anyone who knows the CLSID:
CLSID_ShellDesktop | {00021400-0000-0000-C000-000000000046} |
The class implements the following interfaces (in the SHELL32 version 6.00 from Windows Vista):
Note that several of these interfaces are acquired by aggregating a RegFolder object.
As a registry folder, the ShellDesktop object has its namespace built from a standard pattern. There are first the following required items:
Other items for the desktop’s namespace are loaded from registry keys in the following order:
in which session is a decimal representation of the current session ID.
Some, but certainly not all, of the required items are also registry folders. All are implemented in SHELL32 except for the Internet object, which is of course a construction of Internet Explorer. Several of the required items have their hard-coded properties revised according to shell restrictions or Windows policies.
In particular, the MyComputer object has its SFGAO_HASPROPSHEET attribute cleared if the following registry value (in either of two keys, listed below in decreasing order of precedence) has non-zero data:
Key: | HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer |
Value: | NoPropertiesMyComputer |
The value
Key: | HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer |
Value: | NoPropertiesRecycleBin |
acts similarly on the RecycleBin object. These two policies have user-interface support through the Group Policy Object Editor, as “Remove Properties from the Computer icon context menu” and “Remove Properties from the Recycle Bin context menu” in the Desktop administrative template.
Either of the following values
Key: | HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer |
Values: | NoControlPanel NoSetFolders |
causes the ControlPanel and ControlPanelCategory objects to acquire the SFGAO_NONENUMERATED attribute, which makes the Control Panel appear for most practical purposes to have been deleted from the desktop’s namespace. Both policies have user-interface support through the Group Policy Object Editor, as “Prohibit access to the Control Panel” in the Control Panel administrative template, and as “Remove programs on Settings menu” in the “Start Menu and Taskbar” template.
The same simulated deletion applies to the Internet object both as the restriction
Key: | HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer |
Value: | NoInternetIcon |
and also as an application compatibility flag. Provided that the current process is marked in its executable header as supporting Windows versions from earlier than Windows 2000, the Internet object becomes non-enumerated if any of the following registry values exist:
Key: | HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\ShellCompatibility\Applications\filename |
Value: | CORELINTERNETENUM OLDCREATEVIEWWND WIN95DEFVIEW |
Data for the value is immaterial. The values are also recognised in any subkey of the one given. For detail, and also for a hard-coded list of processes that have this compatibility flag without needing it to be specified in the registry, see the notes on SHGetAppCompatFlags.
The compatibility mechanism does not affect the Internet Explorer icon on the desktop but can be seen at work in common dialogs when browsing the shell namespace. Of course, most programs distributed with Windows require at least version 5.00 and are therefore exempt from the provisions for application compabitility. Moreover, the common dialogs are typically filtered so that only folder objects are shown. The Internet object is not ordinarily a folder, but can be made into one by browsing for an FTP site.
The NoInternetIcon restriction has user-interface support through the Group Policy Object Editor, as “Hide Internet Explorer icon on desktop” in the Desktop administrative template.
These mechanisms for preventing enumeration of the Control Panel and Internet Explorer as desktop items are not known to the user-interface support for choosing desktop icons. In the case of the Control Panel, this is understandable: if the Control Panel is not enumerated, the user-interface support for choosing desktop icons is not accessible. The Internet Explorer icon is dropped from this user interface in Windows Vista. In earlier versions however, the Desktop Items dialog gives the appearance of letting you enable or disable the Internet Explorer icon even though the choice made there is made ineffective by the NoInternetIcon value.
The ShellDesktop class is implemented in SHELL32 version 4.00 and higher.