IShellView2::GetView method (shobjidl_core.h)
Requests the current or default Shell view, together with all other valid view identifiers (VIDs) supported by this implementation of IShellView2.
HRESULT GetView( SHELLVIEWID *pvid, ULONG uView );
A pointer to the GUID of the requested view. The following views are defined in Shlguid.h.
The type of view requested.
Current Shell view.
Default Shell view.
Returns S_OK if successful, or a standard COM error code otherwise.
IShellView2::GetView retrieves a "viewset", which is the requested view (default or current) together with all other valid views for this instance of IShellView2. Calling IShellView2::GetView with the SV2GV_CURRENTVIEW returns a GUID representing the current view and also iterates through the valid VIDs. This information is stored for later use in validating a new view before it is displayed.
The view can also be affected by other factors. A global user default VID and view mode is set when the user presses the Apply to All Folders button in the Folder Options window. The VID is determined from IShellView2::GetView with the SV2GV_CURRENTVIEW flag and the view mode is determined from GetCurrentInfo. The view can also be affected by the persisted folder default. Windows Explorer saves the VID and view mode of a folder if the user has previously visited it. In some cases, the folder you are navigating from also can influence the view mode created for the new view that you are entering.
The priority of these assorted views can be generally said to be the following:
- Persisted folder default
- Global user default
- Default view (SV2GV_DEFAULTVIEW)
- Previous view
|Minimum supported client||Windows 2000 Professional, 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.71 or later)|