Gordon Pan
2010-04-22 00:20:01 UTC
Hi all,
I would like to change label to a drive letter.
I find a guide in msdn:
'http://msdn.microsoft.com/en-us/library/aa969356.aspx'
The following example specifies label for the E: drive.
For Windows 2000:
‧HKEY_CLASSES_ROOT\Applications\Explorer.exe\Drives\E\DefaultLabel\(Default)
= MyDrive
....
Finally, call SHChangeNotify to notify the Shell to update its cache.
I modify the registry as above guide, it works for changing the label of the
drive letter. However, it can't update immediately.
I have to open another 'Explorer', then the new label will be updated.
I have tried following codes, but it seems no effect:
SHChangeNotify(SHCNE_ALLEVENTS, SHCNF_FLUSH, NULL,NULL);
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST + SHCNF_FLUSH, NULL,
NULL);
SendMessageTimeout(HWND_BROADCAST,WM_SETTINGCHANGE,NULL,NULL,SMTO_NORMAL,1000,&dwResult);
Does anyone know how to notify the Shell to update its cache?
Any suggestion is highly appreciated.
Thanks!
Best Regards,
Gordon
I would like to change label to a drive letter.
I find a guide in msdn:
'http://msdn.microsoft.com/en-us/library/aa969356.aspx'
The following example specifies label for the E: drive.
For Windows 2000:
‧HKEY_CLASSES_ROOT\Applications\Explorer.exe\Drives\E\DefaultLabel\(Default)
= MyDrive
....
Finally, call SHChangeNotify to notify the Shell to update its cache.
I modify the registry as above guide, it works for changing the label of the
drive letter. However, it can't update immediately.
I have to open another 'Explorer', then the new label will be updated.
I have tried following codes, but it seems no effect:
SHChangeNotify(SHCNE_ALLEVENTS, SHCNF_FLUSH, NULL,NULL);
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST + SHCNF_FLUSH, NULL,
NULL);
SendMessageTimeout(HWND_BROADCAST,WM_SETTINGCHANGE,NULL,NULL,SMTO_NORMAL,1000,&dwResult);
Does anyone know how to notify the Shell to update its cache?
Any suggestion is highly appreciated.
Thanks!
Best Regards,
Gordon