简体   繁体   中英

Acquire IPropertySetStorage for File in Recycle Bin

I'm attempting to enumerate file properties from files (Title, Author, etc) and have found that enumerating files in the Recycle Bin in particular are being problematic. However, having identified what I believe to be the problem, I am sure that other folders might exhibit the same issues.

I have found that the ITEMIDLIST s created via methods such as ILCreateFromPath or ParseDisplayName are affected(see below) by the desktop.ini's located in certain special folders, which will result in an ITEMIDLIST that fails when used in the BindToObject (or SHBindToObject ) that I have used to acquire the IPropertySetStorage interface for a file, which I am using to enumerate file properties.

To describe what I mean by "affected by desktop.ini's", what I have found is that it returns a path that is altered in name by the desktop.ini, such as by translating the "LocalizedResourceName" in the desktop.ini and the path returned in the ITEMIDLIST is no longer consistent with the actual path on disk. This causes the Bind methods to fail with HRESULT 0x80070002.

Based on the debugging and research I have done, I presume there are two possible solutions to my problem. However, I do not currently know how to do either, or in fact if either is possible. This brings me to this set of questions:

1) Is it possible to obtain an ITEMIDLIST through some method which is NOT affected by the desktop.ini's that may be located in a folder?

2) Is there some way to obtain a file's IPropertySetStorage interface without the use of an ITEMIDLIST ?

Alternatively, if anyone has a better method for acquiring this information about files in general, I'd appreciate the advice.

Shell属性页面也不适用于Windows资源管理器中回收站中的文件,因此我想答案是否定的。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM