private void DWSThread()
 {
     if (checkBoxCreateSystemRestorePoint.Checked)
     {
         try
         {
             string restorepoint_name = "DestroyWindowsSpying " + DateTime.Now.ToString();
             logger.output("Creating restore point " + restorepoint_name + "...");
             WindowsUtil.CreateRestorePoint(restorepoint_name);
             logger.output("Restore point " + restorepoint_name + " created.");
         }
         catch (Exception ex)
         {
             logger.output("Error creating restore point. Reason: " + ex.Message);
         }
     }
     progressbaradd(10);
     if (checkBoxKeyLoggerAndTelemetry.Checked)
     {
         destroyWindowsSpying.disableTelemetryAndKeylogger();
     }
     progressbaradd(15); //25
     if (checkBoxAddToHosts.Checked)
     {
         destroyWindowsSpying.disablehostsandaddfirewall();
     }
     progressbaradd(20); //45
     if (checkBoxDisablePrivateSettings.Checked)
     {
         destroyWindowsSpying.SetRegValueHKCU(
             @"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{21157C1F-2651-4CC1-90CA-1F28B02263F6}",
             "Value", "Deny", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(
             @"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{2EEF81BE-33FA-4800-9670-1CD474972C3F}",
             "Value", "Deny", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(
             @"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{7D7E8402-7C54-4821-A34E-AEEFD62DED93}",
             "Value", "Deny", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(
             @"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{992AFA70-6F47-4148-B3E9-3003349C1548}",
             "Value", "Deny", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(
             @"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{9D9E0118-1807-4F2E-96E4-2CE57142E196}",
             "Value", "Deny", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(
             @"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{A8804298-2D5F-42E3-9531-9C8C39EB29CE}",
             "Value", "Deny", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(
             @"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{B19F89AF-E3EB-444B-8DEA-202575A71599}",
             "Value", "Deny", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(
             @"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}",
             "Value", "Deny", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(
             @"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{C1D23ACC-752B-43E5-8448-8D0E519CD6D6}",
             "Value", "Deny", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(
             @"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{D89823BA-7180-4B81-B50C-7E471E6121A3}",
             "Value", "Deny", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(
             @"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{E5323777-F976-4f5b-9B55-B94699C46E44}",
             "Value", "Deny", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(
             @"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{E6AD100E-5F4E-44CD-BE0F-2265D88D14F5}",
             "Value", "Deny", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(
             @"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{E83AF229-8640-4D18-A213-E22675EBB2C3}",
             "Value", "Deny", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(@"SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\LooselyCoupled",
                                              "Value", "Deny", RegistryValueKind.String);
         logger.output("Disable private settings");
         destroyWindowsSpying.SetRegValueHKCU(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Search", "CortanaEnabled", "0",
                                              RegistryValueKind.DWord);
         destroyWindowsSpying.SetRegValueHKCU(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Search", "BingSearchEnabled", "0",
                                              RegistryValueKind.DWord);
     }
     progressbaradd(10); //55
     if (checkBoxDisableWindowsDefender.Checked)
     {
         destroyWindowsSpying.SetRegValueHKLM(@"SOFTWARE\Policies\Microsoft\Windows Defender", "DisableAntiSpyware", "1",
                                              RegistryValueKind.DWord);
         logger.output("Disable Windows Defender.");
     }
     progressbaradd(5); //60
     if (checkBoxSetDefaultPhoto.Checked)
     {
         destroyWindowsSpying.SetRegValueHKCU(@"Software\Classes\.ico", null, "PhotoViewer.FileAssoc.Tiff", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(@"Software\Classes\.tiff", null, "PhotoViewer.FileAssoc.Tiff", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(@"Software\Classes\.bmp", null, "PhotoViewer.FileAssoc.Tiff", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(@"Software\Classes\.png", null, "PhotoViewer.FileAssoc.Tiff", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(@"Software\Classes\.gif", null, "PhotoViewer.FileAssoc.Tiff", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(@"Software\Classes\.jpeg", null, "PhotoViewer.FileAssoc.Tiff", RegistryValueKind.String);
         destroyWindowsSpying.SetRegValueHKCU(@"Software\Classes\.jpg", null, "PhotoViewer.FileAssoc.Tiff", RegistryValueKind.String);
         logger.output("Set Default PhotoViewer");
     }
     progressbaradd(10); //70
     if (checkBoxSPYTasks.Checked)
     {
         destroyWindowsSpying.disableSpyTasks();
     }
     progressbaradd(10); //80
     if (checkBoxDeleteWindows10Apps.Checked)
     {
         RemoveWindows10Apps();
     }
     progressbaradd(20); //100
     EnableOrDisableTab(true);
     try
     {
         Invoke(new MethodInvoker(delegate
         {
             setcompletetext();
         }));
     }
     catch (Exception)
     {
         try
         {
             setcompletetext();
         }
         catch (Exception)
         {
         }
     }
 }