A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z



PathCompactPath

Truncates a file path to fit within a given pixel width by replacing path components with ellipses.

VB4-32,5,6
Declare Function PathCompactPath Lib "shlwapi.dll" Alias "PathCompactPathA" (ByVal hDC As Long, ByVal pszPath As String, ByVal dx As Long) As Long

Operating Systems Supported
Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 4.0 or later); Requires Windows 98 (or Windows 95 with Internet Explorer 4.0 or later)

Library
Shlwapi

Parameter Information
- hDC
Handle to the device context used for font metrics.

- lpszPath
Address of a buffer containing the path string to be modified. The buffer must be at least MAX_PATH characters long. On return, this buffer will contain the modified string.

- dx
Width, in pixels, within which the string will be forced to fit.

Return Values
Returns TRUE if the path was successfully compacted to the specified width. Returns FALSE on failure, or if the base portion of the path would not fit the specified width

Last update: 07 April 2006