Search code examples
windowsarchiveopenfiledialogfilefilter

Filter split archives in an file-open dialog


I'm trying to run an open-file dialog that has a parameter for filtering filetypes.

Despite being a home-made dialog, it can be expected to parse the filter string as with Windows' default dialog.

I can't figure out how to display only files ending in (for example) .xy001, .xy002, etc.

I've tried XY Archive files (*.xy*), but this displays all files and I can't seem to figure out the parsing.

The archives could number from .xy000 to .xy999, so I need a formulaic string to handle the case.

Is there even a way?

Thanks very much!


Solution

  • After a little more filtering I realized that I had my syntax wrong and that my original formula was actually right.

    Here is the final string for filtering a split archive composed of, say, .xy###'s:

    XY Archive Files (*.xy*)|*.xy*
    

    The | delimits the string part (what you read) and the part it actually filters.

    Also worth noting, sometimes workable files don't match the extension you expect.

    For good measure, the last option could always be All Files:

    XY Archive Files (*.xy*)|*.xy*|All Files (*.*)|*.*
    

    This QA has been marked Community Post to benefit the community while preventing me from getting points for posting my own answer.