Share via


IConsole2::NewWindow method

The IConsole2::NewWindow method creates a new multiple-document interface (MDI) child window rooted at the specified scope item.

Syntax

HRESULT NewWindow(
  [in] HSCOPEITEM    hScopeItem,
  [in] unsigned long lOptions
);

Parameters

hScopeItem [in]

The scope item that forms the root of the new window.

lOptions [in]

Options used to create the new window are listed in the following list.

MMC_NW_OPTION_NONE

Display a new window with default window settings. This is the programmatic equivalent to selecting the New Window From Here command from the View context menu.

MMC_NW_OPTION_NOSCOPEPANE

Hide the scope pane (Console Tree pane) in the new window.

MMC_NW_OPTION_NOTOOLBARS

Hide the standard toolbars in the new window. If the snap-in has custom toolbar buttons and menus, they will appear.

If the snap-in has added its own items to standard menus or toolbars, the addition of those items does not force the standard toolbars or menus that contain them to appear.

MMC_NW_OPTION_SHORTTITLE

This option is not supported and its definition exists only for backward compatibility.

MMC_NW_OPTION_CUSTOMTITLE

Use the custom title provided by the snap-in. Title bar text contains the display name specified by the item data object implementation of the CCF_DISPLAY_NAME.

MMC_NW_OPTION_NOPERSIST

Do not save the new window to the .msc file.

Return value

This method can return one of these values.

  • S_OK
    The new window was successfully created.

  • E_FAIL
    The window was not created. One reason for failure is calling this method in a console whose mode is "User Mode - limited access, single window".

  • E_UNEXPECTED
    An unexpected error occurred.

  • E_INVALIDARG
    The parameter is invalid. This may indicate a NULL pointer.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Mmc.h

DLL

Mmcndmgr.dll

See also

IConsole3

IConsole2