protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); const string userRoot = "HKEY_CURRENT_USER"; const string subkey = @"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; const string keyName = userRoot + "\\" + subkey; Registry.SetValue(keyName, "Hidden", FilesHidden.ToString(culture), RegistryValueKind.DWord); Registry.SetValue(keyName, "ShowSuperHidden", FilesSHidden.ToString(culture), RegistryValueKind.DWord); ExplorerRefresh.RefreshWindowsExplorer(); }
private void ShowSystemFilesBox_CheckedChanged(object sender, EventArgs e) { const string userRoot = "HKEY_CURRENT_USER"; const string subkey = @"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; const string keyName = userRoot + "\\" + subkey; if (ShowSystemFilesBox.Checked) { Registry.SetValue(keyName, "Hidden", 1.ToString(culture), RegistryValueKind.DWord); Registry.SetValue(keyName, "ShowSuperHidden", 1.ToString(culture), RegistryValueKind.DWord); } else { Registry.SetValue(keyName, "Hidden", FilesHidden.ToString(culture), RegistryValueKind.DWord); Registry.SetValue(keyName, "ShowSuperHidden", FilesSHidden.ToString(culture), RegistryValueKind.DWord); } ExplorerRefresh.RefreshWindowsExplorer(); }