6

In my application the user can select reference to file, for example a image file. I would like to make button with a arrow that opens a list with the programs installed on the system witch can open this file type.

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

enter image description here

@ Lars Tech If I look in registry "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\" and then "OpenWithList" for the extension ".jpg" I see more entries that if if rigt click on jpg file and choose Open With ( see my first images) and I only want those. And yes there is program's entries that I properly self have added, but that have no meaning to a jpg file. And Windows can filter them out so will I. enter image description here

Anders Pedersen
  • 1,034
  • 1
  • 9
  • 20
  • Why not just host the standard context menu? – Raymond Chen Jan 06 '12 at 13:27
  • Could work - I think, but how do I implement that? – Anders Pedersen Jan 06 '12 at 14:24
  • 1
    [Start here](http://blogs.msdn.com/b/oldnewthing/archive/2004/09/20/231739.aspx) and work through the 11-part series. – Raymond Chen Jan 06 '12 at 14:26
  • How do you define "entries that have no meaning"? At some point, you (or the user) must have selected those files to open that file type. – LarsTech Jan 06 '12 at 14:44
  • @ Raymond Chen - Sorry this C++ stuff goes beyond my capacity. – Anders Pedersen Jan 09 '12 at 10:19
  • @RaymondChen - the link is dead – Simon Mourier Apr 03 '23 at 15:27
  • 1
    @SimonMourier Fortunately [still in the Internet Archive](http://web.archive.org/web/20110317020339/http://blogs.msdn.com/b/oldnewthing/archive/2004/09/20/231739.aspx). – Raymond Chen Apr 03 '23 at 15:45
  • @RaymondChen - once we know the title we can get to the "reborn" version https://devblogs.microsoft.com/oldnewthing/20040920-00/?p=37823 but inner links are still dead. It's a pity your blog has been so broken apart over the years... it has info nowhere else to be found (not even mentioning the official doc). Just saying... – Simon Mourier Apr 03 '23 at 15:50
  • 1
    @SimonMourier That's why I use the Internet Archive links. The inner links also work there. But you can translate from old to new: blogs.msdn.com/b/oldnewthing/archive/yyyy/mm/dd/#### becomes devblogs.microsoft.com/oldnetwhing/yyyy/mm/dd -- I fix intrablog links when I can, but there are thousands of articles and only one me. I vaguely recall that the migration team tells me that they can create case-by-case redirects if you ask for them via the Feedback link. But alas there is no bulk redirector. – Raymond Chen Apr 03 '23 at 19:26

2 Answers2

0

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

Jens
  • 77
  • 2
0

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

ExistMe
  • 509
  • 6
  • 18
  • Thanks Jan Its show me that it's more complex than I had hoped. For now the feature is put back in the backlog. But thanks any way. – Anders Pedersen Jan 27 '12 at 12:32