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:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user