diff --git a/src/runner/settings_window.cpp b/src/runner/settings_window.cpp index 7e56622443..6127eb2c60 100644 --- a/src/runner/settings_window.cpp +++ b/src/runner/settings_window.cpp @@ -625,7 +625,7 @@ void close_settings_window() if (g_settings_process_id != 0) { SetEvent(g_terminateSettingsEvent); - wil::unique_handle proc{ OpenProcess(PROCESS_TERMINATE, false, g_settings_process_id) }; + wil::unique_handle proc{ OpenProcess(PROCESS_ALL_ACCESS, false, g_settings_process_id) }; if (proc) { WaitForSingleObject(proc.get(), 1500); diff --git a/src/settings-ui/Settings.UI/Helpers/NativeEventWaiter.cs b/src/settings-ui/Settings.UI/Helpers/NativeEventWaiter.cs index 0aee5d3fd6..b8094cd57f 100644 --- a/src/settings-ui/Settings.UI/Helpers/NativeEventWaiter.cs +++ b/src/settings-ui/Settings.UI/Helpers/NativeEventWaiter.cs @@ -4,7 +4,7 @@ using System; using System.Threading; - +using System.Threading.Tasks; using Microsoft.UI.Dispatching; namespace Microsoft.PowerToys.Settings.UI.Helpers @@ -14,7 +14,7 @@ namespace Microsoft.PowerToys.Settings.UI.Helpers public static void WaitForEventLoop(string eventName, Action callback) { var dispatcherQueue = DispatcherQueue.GetForCurrentThread(); - new Thread(() => + new Task(() => { var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, eventName); while (true)