如何在 shell 扩展中外部调用 IShellFolder::EnumObjects
我创建了一个类似于 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如我从您的问题中了解到的,您需要在列表视图中查看相同的内容,但使用新视图。
选择新的视图模式后,不需要重新创建Listview对象,只需将ListView的样式设置为LVS_REPORT、LVS_SMALLICON或LVS_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.