private void UnregisterForRichActivation()
        {
            // Unregister one or more registered filetypes.
            try
            {
                string[] myFileTypes = { ".foo", ".foo2", ".foo3" };
                ActivationRegistrationManager.UnregisterForFileTypeActivation(
                    myFileTypes,
                    executablePath
                    );
            }
            catch (Exception ex)
            {
                OutputMessage($"Error unregistering file types {ex.Message}");
            }

            // Unregister a protocol scheme.
            ActivationRegistrationManager.UnregisterForProtocolActivation(
                "foo",
                "");

            // Unregister for startup activation.
            ActivationRegistrationManager.UnregisterForStartupActivation(
                "ContosoStartupId");
        }
        private void UnregisterButton_Click(object sender, RoutedEventArgs e)
        {
            OutputMessage("Unregistering for rich activation");

            // Unregister one or more registered filetypes.
            try
            {
                string[] myFileTypes = { ".foo", ".foo2", ".foo3" };
                ActivationRegistrationManager.UnregisterForFileTypeActivation(
                    myFileTypes,
                    executablePath
                );
            }
            catch (Exception ex)
            {
                OutputMessage($"Error unregistering file types {ex.Message}");
            }

            // Unregister a protocol scheme.
            ActivationRegistrationManager.UnregisterForProtocolActivation(
                "foo",
                "");

            // Unregister for startup activation.
            ActivationRegistrationManager.UnregisterForStartupActivation(
                "ContosoStartupId");
        }
 public static void UnregisterForFileActivation()
 {
     // Unregister one or more registered filetypes.
     try
     {
         string[] myFileTypes = { ".moo" };
         ActivationRegistrationManager.UnregisterForFileTypeActivation(
             myFileTypes,
             executablePath
             );
     }
     catch (Exception ex)
     {
         ReportInfo($"Error unregistering file types {ex.Message}");
     }
 }
        private static void UnregisterForActivation()
        {
            // BUG Unregistering a filetype removes the
            // [HKEY_CURRENT_USER\Software\Classes\App.5761a1850f7033ad.File]
            // entry, and the value under [HKEY_CURRENT_USER\Software\Classes\.foo\OpenWithProgids]
            // but not the [HKEY_CURRENT_USER\Software\Classes\.foo] key.

            // Unregister one or more registered filetypes.
            try
            {
                string[] myFileTypes = { ".foo", ".foo2", ".foo3" };
                ActivationRegistrationManager.UnregisterForFileTypeActivation(
                    myFileTypes,
                    executablePath
                    );
            }
            catch (Exception ex)
            {
                OutputMessage($"Error unregistering file types {ex.Message}");
            }

            // BUG Unregistering a protocol removes the
            // [HKEY_CURRENT_USER\Software\Classes\App.5761a1850f7033ad.Protocol]
            // entry, but not the [HKEY_CURRENT_USER\Software\Classes\foo] key.

            // Unregister a protocol scheme.
            ActivationRegistrationManager.UnregisterForProtocolActivation(
                "foo",
                "");

            // Unregister for startup activation.
            ActivationRegistrationManager.UnregisterForStartupActivation(
                "ContosoStartupId");

            OutputMessage("Unregistered for rich activation");
        }