Enumerate "shell" registry key entries instead of hardcoding a list. Don't enumerate any entries unless all the files have the same type. Pass the correct type to ShellExecuteEx().