如何在 shell 扩展中外部调用 IShellFolder::EnumObjects

发布于 2024-07-17 13:09:42 字数 352 浏览 10 评论 0原文

我创建了一个类似于 Google 的 GDrive 的 Windows Shell 扩展。 现在我想向继承自IShellView的ListView添加不同的视图。 添加了新的上下文菜单以显示 3 个视图(详细信息、小图标、大图标)。 当使用上下文菜单更改视图时,需要刷新/创建当前窗口才能显示更改后的视图。 在我的 IShellFolder::EnumObjects 中,创建一个新的 ListView 对象并自动调用 OnCreate。 当我还使用上下文菜单更改视图时,我需要调用此方法。 我猜想可能有一些像 SHChangeNotify() 这样的 API 可以自动执行所有 EnumObjects() 操作,并且将使用更改后的视图创建一个新的 IShellView 窗口。

I have created a Windows Shell Extension similar to Google's GDrive. Now I want to add different views to the ListView that inherits from IShellView. A new context menu has been added to to display 3 views (Details, Small Icon, Large Icon). When a view is changed using the context menu, the current window needs to be refreshed/created to display the changed view.
In my IShellFolder::EnumObjects, a new ListView object is created and OnCreate is called automatically. I need to call this method when I change view using the context menu also. I guess there might be some API like SHChangeNotify() that can all the EnumObjects() automatically and a new IShellView window will be created with the changed view.

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

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

发布评论

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

评论(1

濫情▎り 2024-07-24 13:09:42

正如我从您的问题中了解到的,您需要在列表视图中查看相同的内容,但使用新视图。

选择新的视图模式后,不需要重新创建Listview对象,只需将ListView的样式设置为LVS_REPORTLVS_SMALLICONLVS_ICON

SHChangeNotify 是用于反映树窗格而不是 ListView 的更改。

As i understood from your question, you need the same contents to be viewed in listview but with the new view.

You don't need to recreate the Listview object after the new view mode selection, Just set the ListView's style to LVS_REPORT, LVS_SMALLICON, or LVS_ICON.

SHChangeNotify is used to reflect the change to the tree pane not the ListView.

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