Skip to content

Latest commit

 

History

History
85 lines (69 loc) · 3.06 KB

nf-shlwapi-pathrenameextensiona.md

File metadata and controls

85 lines (69 loc) · 3.06 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:shlwapi.PathRenameExtensionA
PathRenameExtensionA function (shlwapi.h)
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. (ANSI)
PathRenameExtensionA
shlwapi/PathRenameExtensionA
shell\PathRenameExtension.htm
shell
3d94f67c-e3ee-4b64-b0b9-8f771423bdc5
12/05/2018
PathRenameExtension, PathRenameExtension function [Windows Shell], PathRenameExtensionA, PathRenameExtensionW, _win32_PathRenameExtension, shell.PathRenameExtension, shlwapi/PathRenameExtension, shlwapi/PathRenameExtensionA, shlwapi/PathRenameExtensionW
shlwapi.h
Windows
Windows 2000 Professional, Windows XP [desktop apps only]
Windows 2000 Server [desktop apps only]
PathRenameExtensionW (Unicode) and PathRenameExtensionA (ANSI)
Shlwapi.lib
Shlwapi.dll (version 4.71 or later)
Windows
19H1
PathRenameExtensionA
shlwapi/PathRenameExtensionA
c++
APIRef
kbSyntax
DllExport
Shlwapi.dll
API-MS-Win-Core-shlwapi-legacy-l1-1-0.dll
KernelBase.dll
API-MS-Win-DownLevel-shlwapi-l1-1-0.dll
API-MS-Win-DownLevel-shlwapi-l1-1-1.dll
PathRenameExtension
PathRenameExtensionA
PathRenameExtensionW

PathRenameExtensionA function

-description

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.

Note  Misuse of this function can lead to a buffer overrun. We recommend the use of the safer PathCchRenameExtension function in its place.
 

-parameters

-param pszPath [in, out]

Type: LPTSTR

Pointer to a null-terminated string of length MAX_PATH in which to replace the extension.

-param pszExt [in]

Type: LPCTSTR

Pointer to a character buffer that contains a '.' character followed by the new extension.

-returns

Type: BOOL

Returns nonzero if successful, or zero if the new path and extension would exceed MAX_PATH characters.

-remarks

Note

The shlwapi.h header defines PathRenameExtension as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.