IThumbnailProvider 和 IInitializeWithItem

发布于 2024-08-11 03:45:45 字数 505 浏览 1 评论 0原文

我正在尝试开发一个在 Windows 7 中使用的 IThumbnailProvider。由于这个特定的缩略图也依赖于同一目录中的其他一些文件,因此我需要使用 IInitializeWithStream 以外的其他文件code> 到要使用的路径,这是 IInitializeWithItem。 (或者,我可以使用 IInitializeWithFile,但这显然更令人不悦。)

无论我做什么,我都无法让它工作。我有微软的 FileTypeVerifier.exe 工具,它为使用 IInitializeWithItem 开了绿灯,但是当资源管理器调用它时,它似乎只尝试 IInitializeWithStream,曾经。 (这是通过临时实现所述接口进行测试的,并在其 Initialize() 中发出 Beep() 声)我是否忘记配置某些内容?

简而言之:我如何让它发挥作用?

I am trying to develop an IThumbnailProvider for use in Windows 7. Since this particular thumbnail would also be dependant on some other files in the same directory, I need to use something other than IInitializeWithStream to a path to work with, this being IInitializeWithItem. (Alternatively, I could use IInitializeWithFile, but that is even more frowned upon apparently.)

No matter what I do, I cannot get it to work. I have Microsoft's FileTypeVerifier.exe tool which gives the green light on using IInitializeWithItem, but when explorer calls it, it only seems to try IInitializeWithStream, ever. (This was tested by temporarily implementing said interface, and Beep()ing away in its Initialize()) Did I forget to configure something?

In short: how do I get this to work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人│生佛魔见 2024-08-18 03:45:45

好吧,我终于知道是怎么回事了。引用 MSDN 网站上的构建缩略图提供程序链接:

在某些情况下,无法使用流进行初始化。在缩略图提供程序未实现 IInitializeWithStream 的情况下,它必须选择退出在隔离进程中运行,当流发生更改时,系统索引器默认将其放置在该隔离进程中。要选择退出进程隔离功能,请设置以下注册表值。

  • HKEY_CLASSES_ROOT

    • CLSID
    • {66742402-F9B9-11D1-A202-0000F81FEDEE}

      禁用进程隔离 = 1

我知道我的进程已经耗尽,因为我在其他地方读到缩略图提供程序总是耗尽进程。但由于该特定片段几乎位于所有 shell 扩展处理程序上,因此我将其解释为一项非常愉快的复制粘贴工作,因为它需要按照我理解的方式在进程内运行。

我错了。我希望这会在不久的将来对其他人有所帮助。 :)

Okay, I finally found out what is the matter. To quote the Building Thumbnail Providers link on the MSDN website:

There are cases where initialization with streams is not possible. In scenarios where your thumbnail provider does not implement IInitializeWithStream, it must opt out of running in the isolated process where the system indexer places it by default when there is a change to the stream. To opt out of the process isolation feature, set the following registry value.

  • HKEY_CLASSES_ROOT

    • CLSID
    • {66742402-F9B9-11D1-A202-0000F81FEDEE}

      DisableProcessIsolation = 1

I knew I was running out of process since I read elsewhere that thumbnailproviders ALWAYS ran out of process. But since that particular snippet is on almost -all- shell extension handlers, I interpreted it to be a overly happy copy-paste job, since it was -required- to run in-process the way I understood it.

And I was wrong. I hope this will help someone else in the near future. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文