Open all files when user right clicks and selects “Open With”

后端 未结 2 686
悲哀的现实
悲哀的现实 2020-12-20 23:12

I have an application written in WPF/C# that can take multiple files as command line arguments. When I run it from the command line with multiple files it opens all of them

相关标签:
2条回答
  • 2020-12-20 23:57

    The shell actually tries to start a separate instance of your application for each file selected. Your app will need to (a) ensure that only the first instance actually shows its UI, and (b) do some inter-process communication to pass the files from the later instances to the first instance. You might already be doing (a), but not (b), which would explain why you only see one file get opened. See the second question (the part about "Single-Instance Apps") on Stephen Toub's post about this. You also may want to read about Dynamic Data Exchange (DDE), which is a common way to pass information between instances of an application.

    0 讨论(0)
  • 2020-12-21 00:00

    Thats a problem with windows explorer, only operating on the last file selected. Maybe this might help: http://social.technet.microsoft.com/Forums/en-US/w7itproui/thread/1d2e6a3b-6abb-4be9-82ac-447ecdbce201

    0 讨论(0)
提交回复
热议问题