Overview
In my earlier post, I showed how to create a Shell Namespace Extension using the default IShellView implementation (also known as DefView). One thing you might have noticed from the sample is that the Commands Module is void of even the default items such as “Organize” and “Views”.

If you are developing your own Namespace and want to include the default buttons and/or add your own elements to the Commands Module as well, how do you accomplish this? The answer: you must implement the IExplorerCommand, IExplorerCommandProvider and IEnumExplorerCommand interfaces.
Below I describe what each of the interfaces is used for and what you need to do to properly implement them in your code.
IExplorerCommandProvider
After your Namespace is loaded, the Shell will ask your Namespace for an instance of an IExplorerCommandProvider. This interface exposes two methods: GetCommand and GetCommands. The Shell calls the GetCommand method to retrieve a specific IExplorerCommand object that matches the supplied GUID (Each command is identified by a GUID). The GetCommands method is called to retrieve an IEnumExplorerCommand instance. This object enumerates all the IExplorerCommand instances for the namespace.
You Namespace is queried for its implementation of IExplorerCommandProvider via its IShellFolder's implementation of CreateViewObject. The REFIID passed to CreateViewObject will be IID_IExplorerCommandProvider. The Shell will then use this interface
...