Export (0) Print
Expand All

IOpenControlPanel::Open method

Opens a Control Panel item specified by its canonical name. You can also optionally open the item to a specific page in some cases.

Syntax


HRESULT Open(
  [in]  LPCWSTR pszName,
  [in]  LPCWSTR pszPage,
  [in]  IUnknown *punkSite
);

Parameters

pszName [in]

Type: LPCWSTR

A pointer to the item's canonical name as a Unicode string. This parameter is optional and can be NULL, in which case the Control Panel itself opens. For a list of Control Panel item canonical names, see Canonical Names of Control Panel Items. Note that not all Control Panel items have a canonical name.

pszPage [in]

Type: LPCWSTR

A pointer to the name of the item's page to display. Not every Control Panel item this. This is the same string that is appended to the end of the path for Shell folder Control Panel items or appended as a command-line parameter for .cpl file items. This parameter can be NULL, in which case the first or main page is shown.

The following table lists available page names:

Control Panel ItemPage StringPage OpenedNotes
Microsoft.ActionCenterMaintenanceSettingsAutomatic MaintenanceThis page is reached manually by selecting the Change maintenance settings option under the Maintenance category in the Action Center.
Microsoft.ActionCenterpageProblemsProblem Reports
Microsoft.ActionCenterpageReliabilityViewReliability MonitorThis page is reached manually by selecting the View reliability history option under the Maintenance category in the Action Center.
Microsoft.ActionCenterpageResponseArchiveArchived MessagesThis page is reached manually by selecting the View archived messages option found on the main page of the Action Center.
Microsoft.ActionCenterpageSettingsProblem Reporting SettingsThis page is reached manually by selecting the Settings option under the Check for solutions to problem reports section of the Maintenance category in the Action Center.
Microsoft.CredentialManager?SelectedVault=CredmanVault

 

punkSite [in]

Type: IUnknown*

A pointer to the site for navigating in-frame for Shell folder Control Panel items. This parameter can be NULL.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Examples

This code shows the creation of the IOpenControlPanel object and a call to its Open method. This call displays the Ease of Access Center's "Make it easier to focus on tasks" page.



const WCHAR* szItemName = L"Microsoft.EaseOfAccessCenter";
const WCHAR* szPageName = L"pageEasierToReadAndWrite";
HRESULT hr = S_OK;

hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (SUCCEEDED(hr))
{
    IOpenControlPanel *pocp;

    hr = CoCreateInstance(CLSID_OpenControlPanel, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pocp));
    if (SUCCEEDED(hr))
    {
        hr = pocp->Open(szItemName, szPageName, NULL);
    }
    
    pocp->Release();
}

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Shobjidl.h

IDL

Shobjidl.idl

See also

IOpenControlPanel
Developing for the Control Panel

 

 

Community Additions

ADD
Show:
© 2014 Microsoft