0

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:

  1. 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)
  2. 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
  3. 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?
  4. 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!

ArielB
  • 1,184
  • 2
  • 11
  • 36
  • Your question is unclear. You say you have only the display name of the item and yet you're passing the pidl to SHChangeNotify. Which is it? – Jonathan Potter Aug 04 '15 at 07:47
  • I have the fully PIDL when i'm doing the SHChangeNotify, but then i want to handle it and i see that ParseDisplayName is called, and i lose the pidl in there- it only gives me the display name of the passed item - meaning, all the serialized attributes i had are gone. – ArielB Aug 04 '15 at 07:50
  • Are you saying that SHChangeNotify calls your ParseDisplayName method? That seems odd. – Jonathan Potter Aug 04 '15 at 20:07
  • It doesn't call it, but the OS receives the message and calls it. it calls it with the item's display name, i'm guessing it does that because it wants to update that specific item? after the parse display name is called, the item is sort of "refreshed" - meaning, it calls the get overlay icon again. do you know of other function that suppose to be called after refresh? because the shell item needs to refresh itself and the custom code suppose to be mine – ArielB Aug 05 '15 at 09:48

1 Answers1

0

This is an old one, but if someone looks - ive eventually passed the data in the display name (method 4) and parsed it out when ParseDisplayName was called

ArielB
  • 1,184
  • 2
  • 11
  • 36