Sets the relative path to the Shell link object.
HRESULT SetRelativePath( LPCSTR pszPathRel, DWORD dwReserved );
The address of a buffer that contains the fully-qualified path of the shortcut file, relative to which the shortcut resolution should be performed. It should be a file name, not a folder name.
Reserved. Set this parameter to zero.
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Clients commonly define a relative link when it may be moved along with its target, causing the absolute path to become invalid. The SetRelativePath method can be used to help the link resolution process find its target based on a common path prefix between the target and the relative path. To assist in the resolution process, clients should set the relative path as part of the link creation process.
Consider the following scenario:
- You have a link: c:\MyLink.lnk.
- The link target is c:\MyDocs\MyFile.txt.
- You want to move the link and MyDocs\MyFile.txt to d:\.
Before the shortcut is resolved, set a new relative path, and the Resolve code will find the file in its new location.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|
|DLL||Shell32.dll (version 4.0 or later)|