gpt4 book ai didi

c++ - 使用搜索-ms : or search: protocols to retrieve search results as an IShellItem

转载 作者:行者123 更新时间:2023-11-30 05:30:15 24 4
gpt4 key购买 nike

我正在尝试在 Windows 中检索全局文件搜索结果,但 Windows 搜索文档非常复杂,我宁愿不处理 SQL 来获得如此简单的功能。在将 search:query=%s 作为 IShellFolderIShellItem 运行后,是否有可能在 Windows 资源管理器中显示搜索结果,以便我可以处理我的应用程序中的结果项?

最佳答案

如果你想弹出一个额外的窗口,你可以创建一个 Internet Explorer 窗口,导航到 search-ms url , 从 IWebBrowser2 的 IServiceProvider 实现查询 IShellBrowser 服务,然后 get the active shell view and enumerate items in the view .

如果不需要额外的窗口,可以使用 ISearchFolderItemFactory 并使用运算符 COP_VALUE_CONTAINS 设置 PKEY_FileName 的条件。您还可以使用 IConditionFactory2::CreateCompoundFromArray 来创建复合条件,在 SQL 术语中它可能类似于

其中 fileName 包含“ABC”或 fileAuthor 包含“ABC”或 fileFullText 包含“ABC”或 fileTitle 包含“ABC”

然后您可以调用 ISearchFolderItemFactory::GetShellItem 来获取搜索文件夹对象的 IShellItem 接口(interface),从中您可以 call BindToHandler with BHID_EnumItems to return a shell item enumerator .

关于c++ - 使用搜索-ms : or search: protocols to retrieve search results as an IShellItem,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36049579/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com