PathMatchSpecEx not working as expected

onur sentürk 25 Reputation points
2023-06-25T08:36:39.9833333+00:00

hi, there is a problem in PathMatchSpecEx.

Documentiation says:
if more than one pattern is specified, separate them with semicolons and set the PMSF_MULTIPLE flag.
but Function is only working with comma - here are some c++ examples.

BOOL btest1 = PathMatchSpecEx(L"test.txt",L".jpg;.txt", PMSF_MULTIPLE); //-> not working

BOOL btest2 = PathMatchSpecEx(L"test.txt", L".jpg,.txt", PMSF_MULTIPLE); //-> working version with comma

PathMatchSpec - is working with semicolons but it is not mentioned to support multiple patterens
BOOL bbest3 = PathMatchSpec(L"test.txt", L".jpg;.txt"); //-> working

Regards, onur

Windows development | Windows API - Win32
{count} votes

Answer accepted by question author
  1. Castorix31 91,416 Reputation points
    2023-06-25T09:17:41.7533333+00:00

    See the return value :

    Return value

    Type: HRESULT

    Returns one of the following values.

    Return code Description

    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.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.