ShlwApiPathCompactPathEx Method
Truncates a path to fit within a certain number of characters by replacing path components with ellipses.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("ShlwApi.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function PathCompactPathEx (
buffer As StringBuilder,
sourcePath As String,
width As UInteger,
Optional flags As UInteger = 0
) As Boolean
Dim buffer As StringBuilder
Dim sourcePath As String
Dim width As UInteger
Dim flags As UInteger
Dim returnValue As Boolean
returnValue = ShlwApi.PathCompactPathEx(buffer,
sourcePath, width, flags)
public:
[DllImportAttribute(L"ShlwApi.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static bool PathCompactPathEx(
StringBuilder^ buffer,
String^ sourcePath,
unsigned int width,
unsigned int flags = 0
)
[<DllImportAttribute("ShlwApi.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member PathCompactPathEx :
buffer : StringBuilder *
sourcePath : string *
width : uint32 *
?flags : uint32
(* Defaults:
let _flags = defaultArg flags 0
*)
-> bool
No code example is currently available or this language may not be supported.
- 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).
Boolean
Returns
if successful, or
otherwise.