从 ITEMIDLIST 获取索引?
Get Index from ITEMIDLIST?
给定从 IEnumIDList::Next()
获得的 ITEMID_CHILD
(ITEMIDLIST
),它是 IFolderView::Items()
的枚举,如何将 ITEMIDLIST 转换为索引IFolderView::SelectItem()
?
之类的东西需要
P.S。我知道 IFolderView::SelectAndPositionItems() 存在,但这个问题特定于获取索引(我找不到 ::IndexOf()
存在的位置)
TIA!!
IFolderView
没有直接 方法来获取给定子项 ITEMIDLIST
的索引。在使用 IEnumIDList
枚举文件夹的项目时,您必须手动记住索引。或者,您可以使用 IFolderView::Item()
遍历项目,直到找到 returns 匹配 ITEMIDLIST
的索引。
一种解决方法是使用 IShellFolderView::UpdateObject
, passing in the pidl as the first two arguments. IShellFolderView::RefreshObject
看起来也是一种选择,但对我来说 returns E_NOTIMPL
.
给定从 IEnumIDList::Next()
获得的 ITEMID_CHILD
(ITEMIDLIST
),它是 IFolderView::Items()
的枚举,如何将 ITEMIDLIST 转换为索引IFolderView::SelectItem()
?
P.S。我知道 IFolderView::SelectAndPositionItems() 存在,但这个问题特定于获取索引(我找不到 ::IndexOf()
存在的位置)
TIA!!
IFolderView
没有直接 方法来获取给定子项 ITEMIDLIST
的索引。在使用 IEnumIDList
枚举文件夹的项目时,您必须手动记住索引。或者,您可以使用 IFolderView::Item()
遍历项目,直到找到 returns 匹配 ITEMIDLIST
的索引。
一种解决方法是使用 IShellFolderView::UpdateObject
, passing in the pidl as the first two arguments. IShellFolderView::RefreshObject
看起来也是一种选择,但对我来说 returns E_NOTIMPL
.