From 0324327ffbf9578ea0731d0c1dcdc45307f5c367 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 16 Aug 2001 18:12:46 +0000 Subject: [PATCH] Fix the 'never disappearing' popup menu - anchor it to our (hidden) global window, which allows TrackPopupMenu to lose focus when any other window is selected. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90236 13f79535-47bb-0310-9956-ffa450edef68 --- support/win32/ApacheMonitor.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/support/win32/ApacheMonitor.c b/support/win32/ApacheMonitor.c index 1916e10d045..ed438fa474c 100644 --- a/support/win32/ApacheMonitor.c +++ b/support/win32/ApacheMonitor.c @@ -326,9 +326,11 @@ void ShowTryPopupMenu(HWND hWnd) appendMenuItem(hMenu, 0, "", FALSE, TRUE); appendMenuItem(hMenu, IDM_EXIT, g_lpMsg[IDS_MSG_MNUEXIT-IDS_MSG_FIRST], FALSE, TRUE); + if (!SetForegroundWindow(hWnd)) + SetForegroundWindow(NULL); GetCursorPos(&pt); - SetForegroundWindow(NULL); - TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON, pt.x, pt.y, 0, hWnd, NULL); + TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON, + pt.x, pt.y, 0, hWnd, NULL); DestroyMenu(hMenu); } } @@ -350,9 +352,11 @@ void ShowTryServicesMenu(HWND hWnd) } if (i) { + if (!SetForegroundWindow(hWnd)) + SetForegroundWindow(NULL); GetCursorPos(&pt); - SetForegroundWindow(NULL); - TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON, pt.x, pt.y, 0, hWnd, NULL); + TrackPopupMenu(hMenu, TPM_LEFTALIGN|TPM_RIGHTBUTTON, + pt.x, pt.y, 0, hWnd, NULL); DestroyMenu(hMenu); } } -- 2.47.3