Truncates a path to fit within a certain number of characters by replacing path components with ellipses.
#Include <WinAPIEx.au3>
_WinAPI_PathCompactPathEx ( $sPath, $iMax )
$sPath | The path to be modified. |
$iMax | The maximum number of characters to be contained in the modified path. |
Success | The modified path. |
Failure | The original $sPath parameter and sets the @error flag to non-zero. |
在MSDN中搜索
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $Path = @ScriptFullPath
ConsoleWrite('Before: ' & $Path & @CR)
ConsoleWrite('After : ' & _WinAPI_PathCompactPathEx($Path, 40) & @CR)