Export (0) Print
Expand All

PathMatchSpecEx function

Matches a file name from a path against one or more file name patterns.

Syntax


HRESULT PathMatchSpecEx(
  _In_  LPCTSTR pszFile,
  _In_  LPCTSTR pszSpec,
  _In_  DWORD dwFlags
);

Parameters

pszFile [in]

Type: LPCTSTR

A pointer to a null-terminated string of maximum length MAX_PATH that contains the path from which the file name to be matched is taken.

pszSpec [in]

Type: LPCTSTR

A pointer to a null-terminated string of maximum length MAX_PATH that contains the file name pattern for which to search. This can be the exact name, or it can contain wildcard characters. If exactly one pattern is specified, set the PMSF_NORMAL flag in dwFlags. If more than one pattern is specified, separate them with semicolons and set the PMSF_MULTIPLE flag.

dwFlags [in]

Type: DWORD

Modifies the search condition. The following are valid flags.

PMSF_NORMAL (0x00000000)

The pszSpec parameter points to a single file name pattern to be matched.

PMSF_MULTIPLE (0x00000001)

The pszSpec parameter points to a semicolon-delimited list of file name patterns to be matched.

PMSF_DONT_STRIP_SPACES (0x00010000)

If PMSF_NORMAL is used, ignore leading spaces in the string pointed to by pszSpec. If PMSF_MULTIPLE is used, ignore leading spaces in each file type contained in the string pointed to by pszSpec. This flag can be combined with PMSF_NORMAL and PMSF_MULTIPLE.

Return value

Type: HRESULT

Returns one of the following values.

Return codeDescription
S_OK

A file name pattern specified in pszSpec matched the file name found in the string pointed to by pszFile.

S_FALSE

No file name pattern specified in pszSpec matched the file name found in the string pointed to by pszFile.

 

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Shlwapi.h

Library

Shlwapi.lib

DLL

Shlwapi.dll (version 7.0 or later)

Unicode and ANSI names

PathMatchSpecExW (Unicode) and PathMatchSpecExA (ANSI)

See also

PathMatchSpec

 

 

Community Additions

ADD
Show:
© 2014 Microsoft