是否有适用于 Windows 7 的预览处理程序 VCL?
本文
http://msdn.microsoft.com/en-gb/library/bb776867 .aspx
将 Windows 中的预览处理程序描述为
预览处理程序在以下情况下被调用: 项目被选中以显示 轻量级、丰富、只读预览 视图中文件内容的 阅读窗格。这是在没有 启动文件的关联 应用程序。
和 ...
预览处理程序是托管的 应用。主机包括 Windows 中的 Microsoft Windows 资源管理器 Vista 或 Microsoft Outlook 2007。
是否有一些 Delphi VCL 代码可以用作此类处理程序的起点?
This article
http://msdn.microsoft.com/en-gb/library/bb776867.aspx
describes preview handlers in Windows as
Preview handlers are called when an
item is selected to show a
lightweight, rich, read-only preview
of the file's contents in the view's
reading pane. This is done without
launching the file's associated
application.
and ...
A preview handler is a hosted
application. Hosts include the
Microsoft Windows Explorer in Windows
Vista or Microsoft Outlook 2007.
Is there some Delphi VCL code which can be used as a startingpoint for such a handler?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
@Mjn,正确知道我正在为我的 博客 写一篇文章来实现 Delphi 的预览处理程序,但由于由于时间不够,我不知道什么时候完成,正如其他用户提到的那样,Delphi 中目前不存在 VCL 组件来实现预览处理程序,过去我为客户实现了几个预览处理程序,但使用 Delphi-棱镜和 C#。
作为起点,我留下了一些提示。
IPreviewHandler
,InitializeWithFile,<代码>InitializeWithStream
,IPreviewHandlerFrame
,IPreviewHandlerVisuals 接口。这是这些接口的标头的 Delphi 翻译。
IPreviewHandler
、IInitializeWithStream
派生。像这样的东西
现在您必须为父接口创建自己的方法实现。
这是您需要实现的方法列表。
IPreviewHandler -> DoPreview、SetWindow、SetRect、Unload、SetFocus、TranslateAccelerator、QueryFocus。
IObjectWithSite ->获取站点、设置站点。
IOleWindow ->获取窗口
IPreviewHandlerVisuals - >设置背景颜色、设置字体、设置颜色
InitializeWithStream ->初始化
最后您必须在系统中注册您的 COM 以及将使用 PrevieHandler 类的文件扩展名。
检查此项目作为起点
Windows Preview Handler Pack
(是用 C# 编写)和本文通过我们的托管预览按您的方式查看数据处理程序框架
@Mjn, right know I'm writing an article for my blog to implement Preview Handlers from Delphi, but due to lack of time, I do not know when this is complete, as others users mention by the moment no exist a VCL component in Delphi to implement preview handlers, in the past I implemented a couple of preview handlers for a customer but using Delphi-Prism and C#.
As starting point here I leave some tips.
IPreviewHandler
, InitializeWithFile,InitializeWithStream
,IPreviewHandlerFrame
, IPreviewHandlerVisuals interfaces.This is the Delphi translation of the headers of these interfaces
IPreviewHandler
,IInitializeWithStream
.something like this
Now you must create your own implementation of the methods for the parent interfaces.
this is the list of the methods which you need implement.
IPreviewHandler -> DoPreview, SetWindow, SetRect, Unload, SetFocus, TranslateAccelerator, QueryFocus.
IObjectWithSite -> GetSite, SetSite.
IOleWindow -> GetWindow
IPreviewHandlerVisuals - > SetBackgroundColor, SetFont, SetColor
InitializeWithStream -> Initialize
finally you must register your COM in the system as well as the file extensions which will use you PrevieHandler class.
Check this project as a starting point
Windows Preview Handler Pack
(is written in C#) and this articleView Data Your Way With Our Managed Preview Handler Framework
我已经制作了这个单元来处理所有预览处理程序的内容:
此处显示了基于此单元的示例预览处理程序:
您可能对 我的博客中的这篇文章描述了有关该框架的更多详细信息。
I have made this unit to handle all the preview handler stuff:
A sample preview handler based on this unit is shown here:
You may be interested in this article in my blog describing some more details on that framework.
我从来没有见过这样的事情,但由于整个事情都是在 COM 中构建的,因此您首先要导入类型库,并实现所需的接口,包括 IPreviewHandlerFrame。 [抱歉,没有多大帮助。但这是一个相当模糊的领域,所以我对 Delphi 没有为此提供预构建的组件集并不感到惊讶。]
I have never seen such a thing, but since the whole thing is build in COM, you would start by importing the type library, and implementing the required interfaces, including IPreviewHandlerFrame. [Sorry, not very helpful. But this is a pretty obscure area, so I'm not surprised that Delphi hasn't got a prebuilt component set for this.]
我找不到任何在 Delphi 中使用 IPreviewHandlerFrame 的参考,但确实设法提出了一个 C# 示例 此处 - 也许它会给您一个起点。
I can't find any references to using IPreviewHandlerFrame in Delphi, but did manage to come up with a C# example here - maybe it'll give you a starting point.
我认为你必须自己编写一个 COM 服务器,它提供所描述的 IPreviwHandler 接口。 (没有要导入的类型库...)我对这样的代码也很感兴趣,并且我现在正在搜索很长一段时间。我对 COM 服务器编写不太有经验...如果您发现了什么,请告诉我!因为我也会分享我的代码,如果我得到一些......
安德烈亚斯
I think you have to write a COM-Server yourself, which provides the described IPreviwHandler-Interfacees. (There is no type library to import...) I am very interested in such a code as well and I am searching for quite a while now. I am not very experienced with COM-Server-writing... If you find something, let me know please! As I will share my code also, if I get some...
Andreas