private void CheckIfRegisterOrUnregisterRequiresExplorerRestart(ISharpShellServer[] servers) { if (servers.Any(server => server.ServerType == ServerType.ShellIconOverlayHandler)) { if (MessageBox.Show(this, "This change will not take effect until Windows Explorer is restarted. Would you " + "like to restart Windows Explorer now?", "Restart Explorer?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ExplorerManager.RestartExplorer(); } } }
public static void InstallServer(string thumbnailFilename, bool osIs32Bit) { if (!string.IsNullOrEmpty(thumbnailFilename)) { if (!File.Exists(thumbnailFilename)) { return; } IEnumerable <ServerEntry> serverEntries = ServerManagerApi.LoadServers(thumbnailFilename); foreach (ServerEntry serverEntry in serverEntries) { SharpShell.ServerRegistration.ServerRegistrationManager.InstallServer(serverEntry.Server, osIs32Bit ? RegistrationType.OS32Bit : RegistrationType.OS64Bit, true); SharpShell.ServerRegistration.ServerRegistrationManager.RegisterServer(serverEntry.Server, osIs32Bit ? RegistrationType.OS32Bit : RegistrationType.OS64Bit); } } ExplorerManager.RestartExplorer(); // Tell explorer the file association has been changed SHChangeNotify(0x08000000, 0x0000, IntPtr.Zero, IntPtr.Zero); }
private void restartExplorerToolStripMenuItem_Click(object sender, EventArgs e) { ExplorerManager.RestartExplorer(); }
public static void RestartExplorer() { ExplorerManager.RestartExplorer(); }