IShellLinkA::GetPath method (shobjidl_core.h)
Gets the path and file name of the target of a Shell link object.
HRESULT GetPath( [out] LPSTR pszFile, [in] int cch, [in, out] WIN32_FIND_DATAA *pfd, [in] DWORD fFlags );
The address of a buffer that receives the path and file name of the target of the Shell link object.
The size, in characters, of the buffer pointed to by the pszFile parameter, including the terminating null character. The maximum path size that can be returned is MAX_PATH. This parameter is commonly set by calling ARRAYSIZE(pszFile). The ARRAYSIZE macro is defined in Winnt.h.
[in, out] pfd
A pointer to a WIN32_FIND_DATA structure that receives information about the target of the Shell link object. If this parameter is NULL, then no additional information is returned.
Flags that specify the type of path information to retrieve. This parameter can be a combination of the following values.
Retrieves the standard short (8.3 format) file name.
Unsupported; do not use.
Retrieves the raw path name. A raw path is something that might not exist and may include environment variables that need to be expanded.
Windows Vista and later. Retrieves the path, if possible, of the shortcut's target relative to the path set by a previous call to IShellLink::SetRelativePath.
Returns S_OK if the operation is successful and a valid path is retrieved. If the operation is successful but no path is retrieved, it returns S_FALSE and pszFile will be empty. Otherwise, it returns one of the standard HRESULT error values.
|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)|