From: William A. Rowe Jr Date: Thu, 16 Aug 2001 18:12:46 +0000 (+0000) Subject: Fix the 'never disappearing' popup menu - anchor it to our (hidden) X-Git-Tag: 2.0.24~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0324327ffbf9578ea0731d0c1dcdc45307f5c367;p=apache 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 --- diff --git a/support/win32/ApacheMonitor.c b/support/win32/ApacheMonitor.c index 1916e10d04..ed438fa474 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); } }