i have the following query:
Basically, i'm trying to change overlay icons according to my specific logic on a specific shell item. whenever a shell item needs icon refresh, i'm calling
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_IDLIST | SHCNF_FLUSH, [Item], NULL)
because sadly i can't send any custom data (to tell the item what exactly changed), i will have to do my logic inside the method of:
IShellFolder.ParseDisplayName
https://msdn.microsoft.com/en-us/library/windows/desktop/bb775090(v=vs.85).aspx
This method is called for that specific item that requires the update, and i've noticed the following:
- hwnd is always null
- pszDisplayName is the name of the updated item
the thing is, that i have to return in the ppidl the updated item (which i have to create it again and serialize it all over again).
i have several issues:
- i only have the display name of the item - which is not enough, as there are more serialized attributes for my shell item and i'm losing it when i'm creating the item again (for the refresh purpose) - is it possible to get the current children of the parent folder and find the old shell item? (creating the new one from the old one)
- is there any way to pass custom data that i'll be able to receive in the ParseDisplayName? this way i can tell the item exactly which icon it needs instead of trying to figure it out from a state in the server
- I'm passing the serialized pidl of the item to the SHChangeNotify, and i saw that the parent folder ParseDisplayName is called, does it know to call only my specific folder because i serialize the parent aswell i guess?
- i thought about using the display name for my custom data, for example, if i have an item named "VirtualFile", i can call SHChangeNotify and give the item a new name "VirtualFile--CustomData--ChangeIconToBlue" something like this - this is not recommended i guess right?
any best practice to handle that event?
many thanks!