From 34a7fd0eb2a93b0768cdca689d7e18ba2790da60 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Mon, 30 Aug 2021 08:20:10 +0300 Subject: [PATCH] Bug fix: restore focus to previous window after archive menu dismiss --- ExplorerPatcherLibrary/dllmain.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ExplorerPatcherLibrary/dllmain.c b/ExplorerPatcherLibrary/dllmain.c index 48841aa..ac6fe6b 100644 --- a/ExplorerPatcherLibrary/dllmain.c +++ b/ExplorerPatcherLibrary/dllmain.c @@ -476,6 +476,7 @@ LRESULT CALLBACK CLauncherTipContextMenu_WndProc( POINT pt; GetCursorPos(&pt); + HWND prevhWnd = GetForegroundWindow(); SetForegroundWindow(hWnd); HMENU hMenu = CreatePopupMenu(); @@ -517,6 +518,7 @@ LRESULT CALLBACK CLauncherTipContextMenu_WndProc( &(pt) ); free(unknown_array); + SetForegroundWindow(prevhWnd); if (res == 1 || res == 2) {