Close Settings Window on runner exit (#2695)

This commit is contained in:
Tomas Agustin Raies
2020-05-05 14:13:52 -07:00
committed by GitHub
parent d65e2ab2d4
commit 462c17a0c3
3 changed files with 14 additions and 0 deletions

View File

@@ -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);
}
}
}

View File

@@ -1,2 +1,3 @@
#pragma once
void open_settings_window();
void close_settings_window();

View File

@@ -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: