Shell32

Shell32 library

The shell32 manages the Windows graphicall shell. It implements a lot of the Windows Explorer. Some important shell32 concepts:

  • The Shell Namespace. Like files and directories forms a filesystem hierarchy, the hierarchy displayed by shell32 is called the shell namespace. It contains all the files and directories as descendents of My Computer (and under wine the Unixfs '/' folder) but it contains many more folders (e.g. Control Panel, Network Neighborhood etc.)
  • PIDLs. Like files and directories are identified by paths that are sequences of names separated by '/' or '\', shell namespace items are identified by PIDLs. PIDLs are sequences of binary data structures. These structures should be opaque - that means that only the parent folder knows the binary data means. The user shouldn't try to interpret this data. However there are some applications that accesses this data (as far as I remember Word 97 is an example) so wine tries to make these structures compatible with Windows. A single structure is called an Item ID and a PIDL stands for Pointer to ID List. There are absolute and relative PIDLs - exactly like with paths.
  • Shell objects. In the filesystem we have a given set of operations that we can perform on a file. The shell namespace items are so diverse that there is no single set of operations. Instead we can query for COM objects associated with a given shell item. The most important interface is the IShellFolder. It allows to query for objects for it's subitems. Starting from the desktop folder obtained with SHGetDesktopFolder() we can obtain any folder in the shell namespace. Most folders implements also IShellFolder2. Some other important interfaces are IContextMenu, IDataObject (returns the path or PIDL of the item - used e.g. during Copy/Paste, when createing a link etc), IExtractIcon
  • Shell views. Every IShellFolder can create a special IShellView object that manages a control that displays the contents of the folder. Shell32 allows to use any control to show the contents if one writes a custom IShellView. However usually the SHCreateShellFolderView functions is used that create an IShellView with the listview that is well known to any Explorer folders.
  • Shell browsers. A program that wants to display a shell view implements a shell browser. This interface is implemented by the Windows Explorer and by the Open/Save As common dialog.

To view the namespace I've written a small program shellinfo (source code). It can be used to learn something about the shell32. It works under Windows XP and Windows 98 but doesn't work under wine (I haven't yet checked why. We can check wine implementation in the source code so that's not a priority). Note that the program is written in C++Builder 5 so it must be compiled with a Borland compiler.

Shell32 (last edited 2008-05-03 02:13:56 by nathan.n)