IOpenControlPanel::GetPath method (shobjidl_core.h)

Gets the path of a specified Control Panel item.

Syntax

HRESULT GetPath(
  [in]  LPCWSTR pszName,
  [out] LPWSTR  pszPath,
  [in]  UINT    cchPath
);

Parameters

[in] 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.

[out] pszPath

Type: LPWSTR

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

[in] 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

Requirement Value
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