ShellExecute multiple files

后端 未结 1 1643
孤街浪徒
孤街浪徒 2021-01-15 09:49

I am wondering if it\'s possible to somehow use ShellExecute to open multiple files at once using the default verb handler. For example, if I have multiple mp3 files in a fo

相关标签:
1条回答
  • 2021-01-15 10:31

    No, ShellExecute can't do this. Instead, the way to do it is with IContextMenu.

    Broadly speaking:

    • Bind to the parent folder with SHBindToObject
    • Query for a context menu for the files in question with IShellFolder::GetUIObjectOf
    • Initialise the context menu with IContextMenu::QueryContextMenu, passing the CMF_DEFAULTONLY flag
    • Invoke the default command with IContextMenu::InvokeCommand
    0 讨论(0)
提交回复
热议问题