IShellFolder::CreateViewObject method (shobjidl_core.h)
Requests an object that can be used to obtain information from or interact with a folder object.
HRESULT CreateViewObject( [in] HWND hwndOwner, [in] REFIID riid, [out] void **ppv );
A handle to the owner window. If you have implemented a custom folder view object, your folder view window should be created as a child of hwndOwner.
A reference to the IID of the interface to retrieve through ppv, typically IID_IShellView.
When this method returns successfully, contains the interface pointer requested in riid. This is typically IShellView. See the Remarks section for more details.
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
To support this request, create an object that exposes the interface indicated by riid and return a pointer to that interface.
The primary purpose of this method is to provide Windows Explorer with the folder object's folder view object. Windows Explorer requests a folder view object by setting riid to IID_IShellView. The folder view object displays the contents of the folder in the Windows Explorer folder view. The folder view object must be independent of the Shell folder object, because Windows Explorer may call this method more than once to create multiple folder view objects. A new view object must be created each time this method is called. Your folder object can respond in one of two ways to this request. It can:
- Create a custom folder view object and return a pointer to its IShellView interface.
- Create a system folder view object and return a pointer to its IShellView interface.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|
|Header||shobjidl_core.h (include Shobjidl.h)|
|DLL||Shell32.dll (version 4.0 or later)|