PathFindSuffixArrayW function (shlwapi.h)

Determines whether a given file name has one of a list of suffixes.

Syntax

LPCWSTR PathFindSuffixArrayW(
  [in] LPCWSTR       pszPath,
  [in] const LPCWSTR *apszSuffix,
  [in] int           iArraySize
);

Parameters

[in] pszPath

Type: LPCTSTR

A pointer to a null-terminated string of maximum length MAX_PATH that contains the file name to be tested. A full path can be used.

[in] apszSuffix

Type: const LPCTSTR*

An array of iArraySize string pointers. Each string pointed to is null-terminated and contains one suffix. The strings can be of variable lengths.

[in] iArraySize

Type: int

The number of elements in the array pointed to by apszSuffix.

Return value

Type: LPCTSTR

Returns a pointer to a string with the matching suffix if successful, or NULL if pszPath does not end with one of the specified suffixes.

Remarks

This function uses a case-sensitive comparison. The suffix must match exactly.

Note

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

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shlwapi.h
Library Shlwapi.lib
DLL Shlwapi.dll (version 5.0 or later)