Vista样式的“文件"对话框中的自定义预览 [英] Custom preview in Vista style File Dialog

查看:46
本文介绍了Vista样式的“文件"对话框中的自定义预览的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

是否有人设法将自定义预览图像传递给Vista样式对话框?我成功地使预览窗格始终在打开的FileDialog中可见,也可以通过我自己的IFileDialogEvents处理程序在文件列表中获取选定的文件路径(非常感谢Michael Dunn的

Hello,

Has anyone managed to pass custom preview image to Vista style dialog? I succeded to force preview pane visible always in opened FileDialog, also I could get selected file path in the files list passing my own IFileDialogEvents handlers (big thank you to Michael Dunn for his article[^]) but cannot find solution how to pass picture to preview pane.

Thanks in advance
marukas

推荐答案

使用IFileDialogCustomize,IFileDialogEvents和IFileDialogControlEvents定制Win7打开文件对话框是一回事.
自定义Shell命名空间-您在对话框(以及Windows资源管理器)中浏览的背景数据(包括预览)是另一回事...

IPreviewHandler允许您定义预览,并且FileOpenDialog将显示它,因为它最终会调用它...
但是IPreviewHandler实现未注册到FileOpenDialog-它是Shell命名空间接口(...欢迎来到地狱:)).
参见:
http://msdn.microsoft.com/zh-cn/library/bb776867(v=vs.85).aspx
http://msdn.microsoft.com/zh-CN/library/bb266530(v=vs.85).aspx

类似的内容对于您可以定义的Shell命名空间扩展有效,您可以使用自己的项目子树来丰富Shell项目(文件夹,文件,打印机等)的浏览树的内容...
在这里,也没有机会直接要求文件对话框"更改树的内容.


但是,恐怕无法仅在您的文件对话框"实例中为文件定义特定的预览.
我建议使用:My非常特殊的预览添加按钮:使用特殊预览打开一个对话框,该对话框最终将响应IFileDialogEvents中触发的选择更改.我知道这不是一个真正的解决方案,对不起,我不得不说我找不到更好的方法了……
Customizing Win7 Open File Dialog with IFileDialogCustomize, IFileDialogEvents and IFileDialogControlEvents is one thing.
Customizing Shell Namespace - the data on background you browse with the dialog (and also with Windows Explorer), including their preview, is another story...

IPreviewHandler allows you to define the preview and FileOpenDialog will show it because it finally will call it...
But IPreviewHandler implementation is not registered to FileOpenDialog - it is a Shell Namespace interface (... welcome to hell :)).
See:
http://msdn.microsoft.com/en-us/library/bb776867(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/bb266530(v=vs.85).aspx

The similar is valid for Shell Namespace Extensions you can define to enrich content of the browsed tree of Shell Items (folders, files, printers etc.) with your own subtree of your own items...
Here there is also no chance to ask File Dialog directly to alter content of the the tree.


However, I am afraid there is NO WAY to define specific preview only for a file in your instance of File Dialog.
I would suggest to add button with :My very special preview: opening a dialog with your special preview that eventually would respond to selection change triggered in IFileDialogEvents. I know it is not a real solution and am sorry I have to say I cannot find any better...


似乎是一个非常棘手的问题.在这个主题上,您是我的领先者.
我不认为这些界面中的任何一个都引起了您的注意?

IPreviewHandler接口
IPreviewItem接口
Seems like quite the curly problem. You''re way, way ahead of me on this topic.
I don''t suppose that either of these interfaces have escaped your attention?

IPreviewHandler Interface
IPreviewItem Interface


这篇关于Vista样式的“文件"对话框中的自定义预览的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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