mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 19:27:56 +01:00
Close Settings Window on runner exit (#2695)
This commit is contained in:
committed by
GitHub
parent
d65e2ab2d4
commit
462c17a0c3
@@ -390,3 +390,15 @@ void open_settings_window()
|
||||
std::thread(run_settings_window).detach();
|
||||
}
|
||||
}
|
||||
|
||||
void close_settings_window()
|
||||
{
|
||||
if (g_settings_process_id != 0)
|
||||
{
|
||||
HANDLE proc = OpenProcess(PROCESS_TERMINATE, false, g_settings_process_id);
|
||||
if (proc != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
TerminateProcess(proc, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
#pragma once
|
||||
void open_settings_window();
|
||||
void close_settings_window();
|
||||
@@ -67,6 +67,7 @@ LRESULT __stdcall tray_icon_window_proc(HWND window, UINT message, WPARAM wparam
|
||||
Shell_NotifyIcon(NIM_DELETE, &tray_icon_data);
|
||||
tray_icon_created = false;
|
||||
}
|
||||
close_settings_window();
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
case WM_CLOSE:
|
||||
|
||||
Reference in New Issue
Block a user