How to create an “Open with” list like in “Explore” in my application

In my application, the user can select a link to a file, such as an image file. I would like to make a button with an arrow that opens a list with programs installed on the system that can open this type of file.

I know that I can get program names from the registry "HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ FileExts", but how can I filter out entries that do not matter - "DllHost.exe, miaui.exe, etc. . " And how can I open the file with the program that the user selects?

enter image description here

@Lars Tech If I look in the registry "HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ FileExts \" and then "OpenWithList" for the extension ".jpg" I see more entries that, if necessary, click on the jpg file and select "Open with" (see my first images), and I only want them. And yes, there are recordings of programs that I actually added to myself, but which do not matter for the jpg file. And Windows can filter them out, so I will. enter image description here

+6
source share
2 answers

I think you can use this article to check and find out which of them are applicable and valid in your application.

0
source

If you are running Vista or higher, you can use 'SHOpenWithDialog' http://msdn.microsoft.com/en-us/library/bb762234(v=vs.85).aspx - it's pretty simple ... Jens

0
source

Source: https://habr.com/ru/post/905310/


All Articles