HPFE455
asked on
How to Refresh Windows Explorer Items using SHChangeNotify
I have the path of a folder, I need to refresh that folder to display the new icon on it.
In the below API, I tried different combinations of parameters, but it seems not working:
SHChangeNotify(SHCNE_UPDAT EIMAGE |SHCNE_RENAMEITEM | SHCNE_MKDIR,0, 0, "C:\Watch\Test);
In the below API, I tried different combinations of parameters, but it seems not working:
SHChangeNotify(SHCNE_UPDAT
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
How shell will know which folder icon need to be changed. I am maintaining a list of folders /Files and that need to be refreshed, so the updated icon will be displayed.
The below code is not updating the folde icon.
SHChangeNotify(SHCNE_UPDAT EIMAGE, SHCNF_DWORD, 0, idx);
The below code is not updating the folde icon.
SHChangeNotify(SHCNE_UPDAT
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the QString::utf16 returns const ushort* what is equivalent to const wchar_t * or LPCWSTR (long pointer to "wide" unicode string). unfortunately the third argument of ParseDisplayName is a non-const LPWSTR (or LPOLESTR) though documented as [in] what means read-only. therefore the cast you made which casts from const to non-const is ok.
a solution without cast is like
Sara
a solution without cast is like
wchar_t wszbuf[MAX_PATH+1];
wcscpy(wszbuf, path.utf16());
hr =psfParent->ParseDisplayName(NULL,NULL,wszbuf,0, &pidlSystem,NULL);
Sara
ASKER
I have updated my code after sara's comments and it helped me to resolve the issue
ASKER