IConsole2::SelectScopeItem method

The IConsole2::SelectScopeItem method selects the given scope item.

Syntax

HRESULT SelectScopeItem(
  [in] HSCOPEITEM hScopeItem
);

Parameters

  • hScopeItem [in]
    A handle to the item in the scope pane to be selected.

Return value

This method can return one of these values.

  • S_OK
    The specified scope item was selected.

  • E_UNEXPECTED
    An unexpected error occurred.

  • E_FAIL
    hScopeItem is not a valid scope item belonging to the current snap-in.

Remarks

Use this method to reselect the currently selected scope item or to select another scope item.

You can have a single scope item with several different views available, for example, several OLE custom control (OCX) views and the default list view. When the user selects a different view from a menu, the snap-in receives the command and should then call SelectScopeItem to reselect the item. IComponent::GetResultViewType can then return the new view type.

If SelectScopeItem is called by the snap-in in its MMCN_EXPAND notification handler, MMC will not select the specified scope item, even though SelectScopeItem may return S_OK.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Mmc.h

DLL

Mmcndmgr.dll

See also

IConsole3

IComponent

IConsole2