views:

213

answers:

1

What would be the best way to be able to toggle hidden folder and files system wide? I would prefer to do it in C#. I know I would use the global keyboard hook but I am not sure how I would toggle folders/files to be hidden and then visible when the shortcut key is pressed. Any help is appreciated. Thanks.

+2  A: 

Unhide it with the registry:

User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\
Advanced]
Value Name: Hidden
Data Type: REG_DWORD (DWORD Value)
Value Data: (1 = show hidden, 2 = do not show)

Then send a SHChangeNotify event to the desktop.

lod3n