Apply windows explorer settings changing without restarting RRS feed

  • Question

  • Hi all. I need to change windows explorer "show hidden files and folders" property and apply it immediately after changing. It seems the only way to change that property is setting registry "[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden]" key value. But I can't refresh windows explorer so it hide/show hidden files after that. I tried to send broadcast WM_SETTINGCHANGE message, SHChangeNotify function and even enumerating all opened explorer windows using SHDocVw.ShellWindows and refreshing them with SHDocVw.InternetExplorer.Refresh(). With no luck. Strange thing that explorer windows and desktop redraws after using that methods but hidden items are still visible after that. They are also visible after I press F5 key, but if I select "Refresh" in context menu, explorer window updates correctly and hide/show hidden files as I expect.
    I use C# so maybee someone know managed API to make this.
    Any help will be much appreciated.
    • Moved by Zhi-Xin Ye Wednesday, July 22, 2009 3:25 PM (From:.NET Base Class Library)
    Sunday, July 19, 2009 7:41 PM

All replies

  • It's in the menu: Tools + Folder Options, View tab, "Hidden files and folders" option.  Why you'd want to do this in code isn't clear.  You'll have to find a shell programming forum to ask, please use this forum only for BCL questions.
    Hans Passant.
    Sunday, July 19, 2009 7:48 PM