ShlwApiPathCompactPathEx Method

Truncates a path to fit within a certain number of characters by replacing path components with ellipses.

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("ShlwApi.dll", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static bool PathCompactPathEx(
	StringBuilder buffer,
	string sourcePath,
	uint width,
	uint flags = 0
)

Parameters

buffer  StringBuilder
The address of the string that has been altered.
sourcePath  String
A pointer to a null-terminated string of length MAX_PATH that contains the path to be altered.
width  UInt32
The maximum number of characters to be contained in the new string, including the terminating null character.

For example, if width = 8, the resulting string can contain a maximum of 7 characters plus the terminating null character.

flags  UInt32  (Optional)
(NOT DOCUMENTED).

Return Value

Boolean
Returns if successful, or otherwise.

Remarks

See Also