winapi - How to refresh Windows Explorer -
a network volume's name can changed.
changed name spinal disk
to change network name, do
- write new name in registry.
- attach network volume using functions definedosdevicew. in timing, windows explorer read registry in guessing.
- shchangenotify(shcne_driveadd, shcnf_path, root, null); // sure.
- sendmessagetimeout(hwnd_broadcast, wm_devicechange, message, (lparam)(&dbv), - smto_abortifhung, 200, &dwresult); // sure again!
it works, doesn't work though use shchangenotify , wm_devicechange sure. sometimes, new name not applied in windows explorer.
if terminate explorer , re-execute, name applied.
i'm finding interface having windows explorer refreshed.(is correct syntax? sorry, can't express sentence well.)
there proper function? explorer should re-read registry , refreshed.
unfortunately, explorer can't refresh every time told so. because way many apps behave badly, , use shchangenotify() shcne_allevents. imagine if explorer refresh every time receives notification (yes, several times per second!).
that's why doesn't work.
but here's how can 'trick' explorer: send notification more 1 path, bottom up. it's enough first send notification e.g. n:\folder
, n:\
refresh n:\
.
and should send wm_devicechange message first, call shchangenotify().
Comments
Post a Comment