Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Windows Shell
Shell Reference
Shell Functions
 SHCreateShellFolderView Function
SHCreateShellFolderView Function

Creates a new instance of the default Shell folder view object.

Syntax

HRESULT SHCreateShellFolderView(      
    const SFV_CREATE *pcsfv,     IShellView **ppsv );

Parameters

pcsfv
[in] Pointer to a SFV_CREATE structure that describes the particulars used in creating this instance of the Shell folder view object.
ppsv
[out] When this function returns successfully, contains an interface pointer to the new IShellView object. On failure, this value is NULL.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

SHCreateShellFolderView is recommended over SHCreateShellFolderViewEx because of the greater flexibility of its elements to participate in various scenarios, provide new functionality to the view, and interact with other objects.

When dealing with several instances of IShellView, you might want to verify which is the default Shell folder view object. To do so, call QueryInterface on the object using the IID_CDefView IID. This call succeeds only when made on the default Shell folder view object.

Function Information

Minimum DLL Versionshell32.dll version 5.0 or later
Custom ImplementationNo
Headershlobj.h
Import libraryshell32.lib
Minimum operating systems Windows 2000

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
IShellFolder2 is required      alamaison   |   Edit   |   Show History
It's not stated here but under Vista (and perhaps also in earlier versions) SHCreateShellFolderView will return E_NOINTERFACE if the folder passed in the SFV_CREATE doesn't implement IShellFolder2. This blog post mentions this: http://shellrevealed.com/blogs/shellblog/archive/2007/03/15/Shell-Namespace-Extension_3A00_-Creating-and-Using-the-System-Folder-View-Object.aspx
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker