如何在自己的应用程序中像“探索"中那样创建“打开方式"列表 [英] How can I create a “Open with” list as in Explore in my own application

查看:48
本文介绍了如何在自己的应用程序中像“探索"中那样创建“打开方式"列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,用户可以选择对文件的引用,例如图像文件.我想使用带有箭头的按钮来打开一个列表,其中包含安装在系统上的程序,巫婆可以打开此文件类型.

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.

我知道我可以从注册表"HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ FileExts"中获取程序名称,但是如何过滤出没有意义的条目-"DllHost.exe,miaui.exe等."以及如何使用用户选择的程序打开文件?

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如果我在注册表"HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ FileExts \"中查找,然后在扩展名".jpg"中查找"OpenWithList",则将看到更多条目,如果使用rigt单击jpg文件,然后选择打开方式"(请参阅​​我的第一张图片),我只想要那些.是的,我已经正确添加了程序的条目,但这些条目对jpg文件没有任何意义.Windows可以将它们过滤掉,我也可以.

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

推荐答案

我认为您可以使用此

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

这篇关于如何在自己的应用程序中像“探索"中那样创建“打开方式"列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆