GetViewStateStream

IShellBrowser::GetViewStateStream method

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

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shobjidl.h

IDL

Shobjidl.idl

DLL

Shell32.dll (version 4.0 or later)

 

 

Show:
© 2016 Microsoft