2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Handle foreign instance in COM toast activator.

This commit is contained in:
John Preston
2021-10-08 13:46:52 +04:00
parent 8d0ff1b61d
commit 8cca75da5c
3 changed files with 26 additions and 12 deletions

View File

@@ -146,14 +146,6 @@ void DeleteMyModules() {
void psActivateProcess(uint64 pid) {
if (pid) {
::EnumWindows((WNDENUMPROC)_ActivateProcess, (LPARAM)&pid);
} else if (Core::IsAppLaunched()) {
if (const auto window = Core::App().activeWindow()) {
if (const auto handle = window->widget()->windowHandle()) {
if (const auto id = handle->winId()) {
SetForegroundWindow(HWND(id));
}
}
}
}
}