I would like to write some code in Delphi for opening some files (e.g. mp3, png) with the associated program in Windows.
With AssocQueryString, I can find the program for a given extension. With this program, I can start the given file, when only one file was selected. The problem is when I try to start the program with a list of files.
Example 1 - mp3 is associated with AIMP3 and this call works fine
D:\Tools\AIMP3\AIMP3.exe "F:\TestFiles\mp3\file1.mp3" "F:\TestFiles\mp3\file2.mp3"
Example 2 - png is associated with IrfanView and this call fail
D:\Tools\IrfanView\i_view32.exe "F:\TestFiles\png\file1.png" "F:\TestFiles\png\file2.png"
IrfanView does not accept calling it with a list of files, but only with one file.
My question is, how do I find out if a program accepts as parameters just a single file or a list of files?
I have tried to check the Registry but found nothing. In shell->open->command
I can find "%1" for both programs.
I have tried to use the IDropTarget
interface, but this does not work with IrfanView, either (drop multiple files on i_view32.exe doesn't work in Windows Explorer, either).
On the other hand, Windows Explorer (if using Open from the context menu for many png files) opens a new instance of IrfanView for each file. If I had this information, I could also start IrfanView for each file.