Skip to content

Latest commit

 

History

History
91 lines (71 loc) · 2.97 KB

nf-shlwapi-pathcommonprefixa.md

File metadata and controls

91 lines (71 loc) · 2.97 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.PathCommonPrefixA
PathCommonPrefixA function (shlwapi.h)
Compares two paths to determine if they share a common prefix. A prefix is one of these types:\_"C:\\", ".", "..", "..\\". (ANSI)
PathCommonPrefixA
shlwapi/PathCommonPrefixA
shell\PathCommonPrefix.htm
shell
13c32b32-8541-41c4-82d8-48d3b2439f0c
12/05/2018
PathCommonPrefix, PathCommonPrefix function [Windows Shell], PathCommonPrefixA, PathCommonPrefixW, _win32_PathCommonPrefix, shell.PathCommonPrefix, shlwapi/PathCommonPrefix, shlwapi/PathCommonPrefixA, shlwapi/PathCommonPrefixW
shlwapi.h
Windows
Windows 2000 Professional, Windows XP [desktop apps only]
Windows 2000 Server [desktop apps only]
PathCommonPrefixW (Unicode) and PathCommonPrefixA (ANSI)
Shlwapi.lib
Shlwapi.dll (version 4.71 or later)
Windows
19H1
PathCommonPrefixA
shlwapi/PathCommonPrefixA
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
PathCommonPrefix
PathCommonPrefixA
PathCommonPrefixW

PathCommonPrefixA function

-description

Compares two paths to determine if they share a common prefix. A prefix is one of these types: "C:\", ".", "..", "..\".

-parameters

-param pszFile1 [in]

Type: LPCTSTR

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

-param pszFile2 [in]

Type: LPCTSTR

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

-param achPath [out, optional]

Type: LPTSTR

A pointer to a buffer that receives the common prefix. This buffer must be at least MAX_PATH characters in size. If there is no common prefix, it is set to NULL.

-returns

Type: int

Returns the count of common prefix characters in the path. If the output buffer pointer is not NULL, then these characters are copied to the output buffer.

-remarks

Note

The shlwapi.h header defines PathCommonPrefix 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.