IShellBrowser::GetViewStateStream method (shobjidl_core.h)

Gets an IStream interface that can be used for storage of view-specific state information.

Syntax

HRESULT GetViewStateStream(
  DWORD   grfMode,
  IStream **ppStrm
);

Parameters

grfMode

Type: DWORD

Read/write access of the IStream interface. This may be one of the following values.

STGM_READ

Requests an IStream suitable for reading.

STGM_WRITE

Requests an IStream suitable for writing.

STGM_READWRITE

Requests an IStream suitable for reading and writing.

ppStrm

Type: IStream**

The address that receives the IStream interface pointer.

Return value

Type: HRESULT

Returns S_OK if successful, or a COM-defined error value otherwise.

Remarks

This method is used to save and restore the persistent state for a view (the icon positions, the column widths, and the current scroll position, for example).

Notes to Calling Applications

Use GetViewStateStream when the view is being created to read in the saved view state and also when the view is being closed to save any changes to the view state. Typically, the view calls this method with STGM_READ when creating a view window and with STGM_WRITE when the SaveViewState method of its IShellView interface is called.

Notes to Implementers

Each Shell view should have its own view stream. Windows Explorer implements a most recently used (MRU) list of view streams that are stored on a per-user basis in the registry.

See also IShellBrowser

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)
DLL Shell32.dll (version 4.0 or later)