IPropertySheetProvider::Show method

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,
  [inint      page
);

Parameters

window [in]

A value that specifies the handle to the parent window.

page [in]

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.

S_OK

The property sheet was successfully displayed.

E_UNEXPECTED

There were no pages to display. IPropertySheetProvider::CreatePropertySheet had not been called.

E_FAIL

The sheet could not be created because the window was non-NULL and invalid or the thread could not be created.

E_INVALIDARG

The page was less than zero.

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

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Mmc.h

DLL

Mmcndmgr.dll

See also

IPropertySheetProvider

 

 

Show: