A network volume's name can be changed.
I changed the name to Spinal Disk
To change a network name, I do
It works, but sometimes doesn't work even though I use SHChangeNotify and WM_DEVICECHANGE to be sure. Sometimes, the new name is not applied in Windows Explorer.
But if I terminate Explorer and re-execute, the name applied.
I'm finding an interface having Windows Explorer refreshed.(Is it correct syntax? Sorry, I can't express this sentence well.)
Is there a proper function? Explorer should re-read registry and be refreshed.
Unfortunately, Explorer simply can't refresh every time it is told so. Because way too many apps behave badly and always use SHChangeNotify() with SHCNE_ALLEVENTS
. Imagine if the explorer would really always refreshed everything every time it receives that notification (yes, sometimes several times per second!). That's why it sometimes doesn't work.
But here's how you can 'trick' the explorer:
Send a notification for more than one path, from the bottom up. Usually it's enough to first send a notification for e.g. N:\folder
and then for N:\
to really refresh N:\
.
And you should send the WM_DEVICECHANGE
message first, and only then call SHChangeNotify().
Use SHChangeNotify(). Not actually sure which wEventId you'd use in this particular case. Start with SHCNE_ALLEVENTS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With