Contents Index Topic Contents | ||
Previous Topic: SHGetMalloc Next Topic: SHGetPathFromIDList |
SHGetNewLinkInfo
BOOL SHGetNewLinkInfo( LPCTSTR pszLinkTo, LPCTSTR pszDir, LPTSTR pszName, BOOL *pfMustCopy, UINT uFlags );Creates the proper name for a new shortcut. This function does not actually create a shortcut.
- Returns non-zero if successful or zero otherwise.
- pszLinkTo
- Specifies the path and file name of the target of the shortcut. If uFlags does not contain the SHGNLI_PIDL value, this parameter is the address of a NULL-terminated string that contains the target. If uFlags contains the SHGNLI_PIDL value, this parameter is a PIDL that represents the target.
- pszDir
- Address of a NULL-terminated string that contains the path of the folder that the shortcut would be created in.
- pszName
- Address of a string that receives the NULL-terminated path and file name for the shortcut. This buffer is assumed to be at least MAX_PATH characters in size.
- pfMustCopy
- Address of a BOOL value that receives a flag that indicates if the shortcut would be copied. When a shortcut to another shortcut is created, the shell simply copies the target shortcut and modifies that copied shortcut appropriately. This value receives a non-zero value if the target specified in pszLinkTo specifies a shortcut that will cause the target shortcut to be copied. This value receives zero if the target does not specify a shortcut that would be copied.
- uFlags
- Specifies the options for the function. This can be zero or a combination of the following values:
SHGNLI_PIDL pszLinkTo is a PIDL that represents the target. If this flag is not included, pszLinkTo is the address of a string that contains the path and file name of the target. SHGNLI_NOUNIQUE The function will not create a unique name within the destination folder. If this flag is not included, the function create the shortcut name and then determine if the name is unique in the destination folder. If a file with the same name exists within the destination folder, the shortcut name will be modified. This process is repeated until a unique name is found. SHGNLI_PREFIXNAME The created name will be preceded by the string "Shortcut to ". SHGetNewLinkInfo will determine the executable type of the target. If pszLinkTo specifies a DOS application, the ".PIF" extension will be used, otherwise the ".LNK" extension will be used for the shortcut.
SHGetNewLinkInfo will also determine if the destination file system supports long file names. If the destination file system does support long file names, then a long file name will be used for the shortcut name. If the destination file system does not support long file names, then the shortcut name will be returned in an 8.3 format.
This function is implemented in shell versions 4.71 and later. In order to maintain backward compatibility with previous shell versions, this function should not be used explicitly. Instead, the LoadLibrary and GetProcAddress functions should be used to obtain the function address.
Version 4.71
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.