问题
How can I get an IShellItem object for a non-existent file (or directory)?
- SHCreateItemFromParsingName and SHCreateItemFromRelativeName fail with 0x80070002 (file not found) and
- ILCreateFromPath returns a
NULL
pidl.
First I thought it might be impossible, but for example IFileSaveDialog creates such an IShellItem
for its result (if you specify a new file in the dialog).
回答1:
There is such a thing as a simple pidl and they can represent non-existent files. So I guess you want SHSimpleIDListFromPath and SHCreateItemFromIDList
来源:https://stackoverflow.com/questions/3835350/creating-an-ishellitem-instance-for-a-non-existent-file