在我的WPF应用程序中托管Windows Shell Explorer [英] Hosting Windows Shell Explorer in my WPF App

查看:65
本文介绍了在我的WPF应用程序中托管Windows Shell Explorer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在WPF或WinForms窗口中嵌入Windows资源管理器文件/文件夹浏览器视图?

Is it possible to embed the Windows Explorer file/folder browser view in a WPF or a WinForms window?

我基本上想将文件/文件夹浏览器托管为我的应用程序窗口的一部分我不想重新实现外壳程序提供的功能,尤其是外壳程序扩展,例如TortoiseSVN。

I basically want to host the file/folder browser as part of my app window. I don't want to re-implement what the shell provides, especially the shell extensions such as TortoiseSVN.

推荐答案

Windows Vista的外壳程序引入了一个新控件,该控件实现了IExplorerBrowser接口;这是在应用程序中托管Windows Shell文件系统视图的推荐方法。使用.NET构建应用程序的开发人员可以使用Windows API CodePack for .NET中可用的ExplorerBrowser控件的包装版本。

Windows Vista’s Shell introduced a new control which implements the IExplorerBrowser interface; this is the recommended method of hosting a Windows Shell filesystem view within your application. Developers building applications using .NET can use the wrapped version of the ExplorerBrowser control available in the Windows API CodePack for .NET.

请注意,此界面仅在Windows Vista和更高版本上可用。如果您的应用程序需要在较早的Windows版本上运行,则需要使用这些平台上的旧WebOC实现。

Please note that this interface is only available on Windows Vista and later. If your application needs to run on earlier Windows versions, you will need to fallback to the old WebOC implementation on those platforms.

http://msdn.microsoft.com/zh-CN/library/bb761909(VS.85).aspx
http://code.msdn.microsoft.com/WindowsAPICodePack

由于托管Web浏览器控件,建议您这样做此处描述的Win7问题: http://blogs.msdn.com/ieinternals/archive/2009/12/30/Windows-7-Web-Browser-Control-will-not-browse-file-system。 aspx

This is recommended over hosting the web browser control due to a Win7 issue described here: http://blogs.msdn.com/ieinternals/archive/2009/12/30/Windows-7-Web-Browser-Control-will-not-browse-file-system.aspx

这篇关于在我的WPF应用程序中托管Windows Shell Explorer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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