A customer was having trouble updating the icon in one of their shortcuts. Here's what they shared with us:
"Changing the icon from the shortcut property sheet works,
but it's not working from our code.
Is the shortcut property sheet using a different API from
In desperation, we added
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
but that didn't help.
Did we get the flags to
The property sheet does use the
method to change the shortcut icon.
What the customer forgot was to save their changes!
i_ is the
IPersistFile that they used to load
or they can use
QueryInterface to get a new pointer.
notification is unnecessary, and in fact it's overkill.
That's like saying,
"I want to change the color of my sofa, so I'm going to
demolish my house,
and then refurnish it with a new sofa."
If you want to send a notification to say, "Hey, I updated this file, please go refresh any data you have cached about it," you can do a
SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH, fullpath, NULL);