How can I create a “Open with” list as in Explore in my own application

試著忘記壹切 提交于 2019-11-30 15:42:21

问题


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?

@ 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.


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/8758150/how-can-i-create-a-open-with-list-as-in-explore-in-my-own-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!