SHCreateShellFolderView function

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

Syntax

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

Parameters

pcsfv

Type: const SFV_CREATE*

Pointer to a SFV_CREATE structure that describes the particulars used in creating this instance of the Shell folder view object.

ppsv

Type: IShellView**

When this function returns successfully, contains an interface pointer to the new IShellView object. On failure, this value is NULL.

Return Value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

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.

Data sources that use the default Shell folder view object must implement these interfaces:

Optionally, they can also implement IPersistFolder3.

Requirements

   
Windows version Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shlobj_core.h (include Shlobj.h)
Library Shell32.lib
DLL Shell32.dll (version 5.0 or later)

See Also

SFV_CREATE

SHCreateShellFolderViewEx