Given SHChangeNotifyRegister()
of a folder where a new item is being watched and detected via SHCNE_CREATE
and converting the PIDL
to IShellItem2
using SHCreateItemFromIDList()
the attempt to IShellItem2::GetFileTime(PKEY_DateCreated, &createtime);
fails with ERROR_NOT_FOUND
(Element not found). Same if I try PKEY_DateModified
. How can that be? Is there a way to include the date (break on debug shows the file already exists, can be seen in windows explorer and has a date/time). Is there something else to do or it doesn't pass that information? The IShellItem2::GetDisplayName()
works fine. This is Win10 x64?
TIA!!
When a PIDL only contains the name and no other information you are looking at a simple item. These are generated by SHSimpleIDListFromPath
when the change notifier only knows the path or if the notifier used a empty find info in the bind context when creating the PIDL.
Your only option is to hit the disk and fill in a new PIDL. In generic shell namespace speak this means asking IShellFolder
to parse the display-name. IShellItem2::Update
might do this for you, the documentation does not say if it is valid for simple items.