IOpenControlPanel::GetPath method

Gets the path of a specified Control Panel item.

Syntax

HRESULT GetPath(
  LPCWSTR pszName,
  LPWSTR  pszPath,
  UINT    cchPath
);

Parameters

pszName

Type: LPCWSTR

A pointer to the item's canonical name or its GUID. This value can be NULL. See Remarks for further details. For a complete list of Control Panel item canonical names, see Canonical Names of Control Panel Items.

pszPath

Type: LPWSTR

When this method returns, contains the path of the specified Control Panel item as a Unicode string.

cchPath

Type: UINT

The size of the buffer pointed to by pszPath, in WCHARs.

Return Value

Type: HRESULT

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

Remarks

If pszName points to the item's canonical name or GUID, then the path returned is in one of these two forms, depending on the most recent Control Panel view (Classic View or Category View):

::{CLSID_ControlPanel}\::{item guid}
::{CLSID_ControlPanelCategory}\categoryId\::{item guid}

If pszName is NULL then one of these two values is returned:

::{CLSID_ControlPanel}
::{CLSID_ControlPanelCategory}

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)

See Also

Developing for the Control Panel

IOpenControlPanel