Shell32PathMakeUniqueName Method

Creates a unique path name from a template.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Shell32.dll", CharSet = CharSet.Auto, BestFitMapping = false, 
	ExactSpelling = true, ThrowOnUnmappableChar = true, SetLastError = true)]
public static bool PathMakeUniqueName(
	StringBuilder uniqueName,
	uint uniqueNameMax,
	string shortTemplate,
	string longTemplate,
	string dir
)

Parameters

uniqueName  StringBuilder
A buffer that receives a null-terminated Unicode string that contains the unique path name.

It should be at least MAX_PATH characters in length.

uniqueNameMax  UInt32
The number of characters in the buffer pointed to by uniqueName.
shortTemplate  String
A null-terminated Unicode string that contains a template that is used to construct the unique name.

This template is used for drives that require file names with the 8.3 format.

This string should be no more than MAX_PATH characters in length, including the terminating null character.

longTemplate  String
A null-terminated Unicode string that contains a template that is used to construct the unique name.

This template is used for drives that support long file names.

This string should be no more than MAX_PATH characters in length, including the terminating null character.

dir  String
A null-terminated string that contains the directory in which the new file resides.

This string should be no more than MAX_PATH characters in length, including the terminating null character.

Return Value

Boolean
Returns if successful; otherwise, .

Remarks

See Also