Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
On win7 i set "nodrives" in registry,then send WM_SETTINGCHANGE refresh windows shell,I found the driver still exist(the driver icon become transparent ). if i restart explorer.exe process, it hide ok. Is there any method to hide drive at once without restart explorer ?
Posted
Updated 27-Dec-12 14:30pm
v3
Comments
Sergey Alexandrovich Kryukov 27-Dec-12 21:39pm    
Why, why?

Did you check up Harmony
With Algebra?
—Salieri1791 :-)
mozart1983 5-Jan-13 1:40am    
Do you mean the Registry set wrong?
I think it's not, because it good on restart explorer.

Sergey Alexandrovich Kryukov 5-Jan-13 1:51am    
I did not see your registry; hard to tell.
—SA
mozart1983 5-Jan-13 3:56am    
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDriveTypeAutoRun"=dword:0000005f
"NoSimpleNetIDList"=dword:00000001
"NoDrives"=dword:00000040

1 solution

What would you mean by "still exists". I don't think this registry option really makes drives (when you wrote "driver" you probably meant "drive", right?) non-existing. It looks like it merely hides drives from the user of the Shell. Besides, the documentation describes that it is related only to drive letters. You can use a drive without a letter, as mounted to a directory. Please see:
http://technet.microsoft.com/en-us/library/cc938267.aspx[^].

To certain extent, it explains why the effect is manifested when you restart the explorer. I would only note that it could be not just explorer, but any other file manager or just the application using Shell API.

Another method? To start with, I would question in what sense would you need to restring the drives (volumes)? Microsoft describes the behavior of "nordives", so, in the same way, you would need to describe the behavior you want, and, importantly, explain why. And sorry, I still cannot guarantee that I would be able to answer.

—SA
 
Share this answer
 
Comments
mozart1983 5-Jan-13 3:39am    
First, thanks a lot!

I want to hide dirve letters on windows shell without restart shell and can access it, this is for my company project requirement.

Follow is my code:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoDrives"=dword:00000040

DWORD dwResult = -1;
LRESULT hRet = ::SendMessageTimeout( HWND_BROADCAST, WM_SETTINGCHANGE, NULL, NULL, SMTO_BLOCK, 1000, &dwResult );

SHChangeNotify( SHCNE_UPDATEITEM, SHCNF_IDLIST, NULL, NULL );
SHChangeNotify( SHCNE_DRIVEREMOVED, SHCNF_PATH, "G:", NULL );
SHChangeNotify( SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL );


The result is: dirve ico become transparent status when refresh shell. I want to hide the drive letter immediately, invisible without restart shell. By the way, it is work good on Winxp.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900