IKnownFolder::SetPath method
Assigns a new path to a known folder.
Syntax
HRESULT SetPath( [in] DWORD dwFlags, [in] LPCWSTR pszPath );
Parameters
- dwFlags [in]
-
Type: DWORD
Either zero or the following value:
- pszPath [in]
-
Type: LPCWSTR
Pointer to the folder's new path. This is a null-terminated Unicode string of length MAX_PATH. This path cannot be of zero length. If this value is NULL, the IKnownFolder::SetPath sets the path to the default value.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
This method cannot be called on folders of type KF_CATEGORY_FIXED or KF_CATEGORY_VIRTUAL.
To call this method on a folder of type KF_CATEGORY_COMMON, the calling application must be running with elevated privileges.
This method is equivalent to SHSetKnownFolderPath.
Requirements
|
Minimum supported client |
Windows Vista [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2008 [desktop apps only] |
|
Header |
|
|
IDL |
|
|
DLL |
|
See also