PathYetAnotherMakeUniqueName function

Creates a unique filename based on an existing filename.

Syntax

BOOL PathYetAnotherMakeUniqueName(
  PWSTR  pszUniqueName,
  PCWSTR pszPath,
  PCWSTR pszShort,
  PCWSTR pszFileSpec
);

Parameters

pszUniqueName

Type: PWSTR

A string buffer that receives a null-terminated Unicode string that contains the fully qualified path of the unique file name. This buffer should be at least MAX_PATH characters long to avoid causing a buffer overrun.

pszPath

Type: PCWSTR

A null-terminated Unicode string that contains the fully qualified path of folder that will contain the new file. If pszShort is set to NULL, this string must contain a full destination path, ending with the long file name that the new file name will be base on.

pszShort

Type: PCWSTR

A null-terminated Unicode string that contains the short file name that the unique name will be based on. Set this value to NULL to create a name based on the long file name.

pszFileSpec

Type: PCWSTR

A null-terminated Unicode string that contains the long file name that the unique name will be based on.

Return Value

Type: BOOL

Returns TRUE if a unique name was successfully created; otherwise FALSE.

Remarks

If the generated path exceeds MAX_PATH characters, this function may return a truncated string in PathYetAnotherMakeUniqueName. In that case, the function returns FALSE.

Requirements

   
Windows version Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shlobj_core.h (include Shlobj.h)
Library Shell32.lib
DLL Shell32.dll (version 5.0 or later)

See Also

PathMakeUniqueName