Calling SHChangeNotify to update a specific icon?

I have re-assigned a custom .ico to my filetype (.myp) in the registry, and am attempting to update a specific .myp file to display the new .ico. I am looking for this to happen immediately (as quickly as possible).

The icon updates fine when calling:
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
But this updates all icons in the system, regardless of extension and location, causing a strange flickering, not to mention it takes quite a bit of time to accomplish.

I have attempted the following: call SHGetFileInfo to obtain the system icon index of new1.myp's icon (I seem to get the index correctly, under sfi.iIcon a value of 590 when indicating a png, and 271 when indicating one of my .myp files), but the SHChangeNotify has no success in causing that icon to update:

SHFILEINFO sfi;
LPCTSTR display_name = TEXT("C:\\Users\\NKK\\Desktop\\new1.myp");
HRESULT hr = CoInitializeEx(0, NULL);//Initialize the COM library
DWORD_PTR file_info_var = SHGetFileInfo(display_name, -1, &sfi, sizeof(sfi), SHGFI_SYSICONINDEX);
if (file_info_var == 0) { cout << "failed" << endl; }

//update single image using index of changed icon
SHChangeNotify(SHCNE_UPDATEIMAGE, SHCNF_DWORD, (void*)sfi.iIcon, 0);

CoUninitialize();

Any suggestions as to how I may proceed? Is SHCNE_UPDATEIMAGE perhaps not appropriate for icon reloading? Would perhaps SHCNE_ATTRIBUTES do the trick?

Thanks
Topic archived. No new replies allowed.