IPropertySheetProvider::Show method (mmc.h)

If the type that has been set in IPropertySheetProvider::CreatePropertySheet is a property sheet, IPropertySheetProvider::Show displays a property sheet frame that is parented to a hidden window. If the type that has been set in IPropertySheetProvider::CreatePropertySheet is a wizard, IPropertySheetProvider::Show displays a property sheet frame parented to the handle that is passed to this method.

Syntax

HRESULT Show(
  [in] LONG_PTR window,
  [in] int      page
);

Parameters

[in] window

A value that specifies the handle to the parent window.

[in] page

A value that specifies which page on the property sheet is shown. It is zero-indexed.

Return value

This method can return one of these values.

Remarks

IPropertySheetProvider::Show( –1, 0) returns E_FAIL. This return code can be ignored in this case.

In situations in which the snap-in creates a property sheet in a call to IPropertySheetProvider::CreatePropertySheet, optionally calls IPropertySheetProvider::AddPrimaryPages and IPropertySheetProvider::AddExtensionPages, and then decides not to show the property sheet, it should call IPropertySheetProvider::Show( –1, 0) to delete the property sheet and free its resources. In this case, the snap-in must delete the property page handles that it has created. This can be done before or after the snap-in calls IPropertySheetProvider::Show( –1, 0), because MMC does not use the property page handles.

IPropertySheetProvider::Show( –1, 0) only deletes the current property sheet, that is, one that has been created, but is not yet shown. After a property sheet is shown, the snap-in cannot programmatically close it. Only the user can close a property sheet that is shown. In this case, MMC automatically deletes all associated property pages (PROPSHEETPAGE structures) provided by the snap-in.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header mmc.h
DLL Mmcndmgr.dll

See also

IPropertySheetProvider