See the question and my original answer on StackOverflow

When you're called on IShellFolder::CreateViewObject for IID_IShellView, you can return a custom IShellView implementation (you must also implement IOleWindow), instead of the default one (usually got from calling the SHCreateShellFolderView function).

Your custom implementation only needs to implement CreateViewWindow, DestroyViewWindow, and IOleWindow's GetWindow methods for a start (for other methods, you can return E_NOTIMPL)