PathRenameExtension function
Replaces the extension of a file name with a new extension. If the file name does not contain an extension, the extension will be attached to the end of the string.
Syntax
BOOL PathRenameExtension( _Inout_ LPTSTR pszPath, _In_ LPCTSTR pszExt );
Parameters
- pszPath [in, out]
-
Type: LPTSTR
Pointer to a null-terminated string of length MAX_PATH in which to replace the extension.
- pszExt [in]
-
Type: LPCTSTR
Pointer to a character buffer that contains a '.' character followed by the new extension.
Return value
Type: BOOL
Returns nonzero if successful, or zero if the new path and extension would exceed MAX_PATH characters.
Requirements
|
Minimum supported client |
Windows 2000 Professional, Windows XP [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows 2000 Server [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
PathRenameExtensionW (Unicode) and PathRenameExtensionA (ANSI) |