Export (0) Print
Expand All
0 out of 2 rated this helpful - Rate this topic

PathCompactPathEx function

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

Syntax


BOOL PathCompactPathEx(
  _Out_       LPTSTR pszOut,
  _In_        LPCTSTR pszSrc,
  _In_        UINT cchMax,
  _Reserved_  DWORD dwFlags
);

Parameters

pszOut [out]

Type: LPTSTR

The address of the string that has been altered.

pszSrc [in]

Type: LPCTSTR

A pointer to a null-terminated string of length MAX_PATH that contains the path to be altered.

cchMax [in]

Type: UINT

The maximum number of characters to be contained in the new string, including the terminating null character. For example, if cchMax = 8, the resulting string can contain a maximum of 7 characters plus the terminating null character.

dwFlags [in]

Type: DWORD

Return value

Type: BOOL

Returns TRUE if successful, or FALSE otherwise.

Remarks

The '/' separator will be used instead of '\' if the original string used it. If pszSrc points to a file name that is too long, instead of a path, the file name will be truncated to cchMax characters, including the ellipsis and the terminating NULL character. For example, if the input file name is "My Filename" and cchMax is 10, PathCompactPathEx will return "My Fil...".

Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shlwapi.h

Library

Shlwapi.lib

DLL

Shlwapi.dll (version 4.71 or later)

Unicode and ANSI names

PathCompactPathExW (Unicode) and PathCompactPathExA (ANSI)

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.