diff --git a/base/shell/rshell/CMenuBand.cpp b/base/shell/rshell/CMenuBand.cpp index 23222fe608d..5a1ba6e766d 100644 --- a/base/shell/rshell/CMenuBand.cpp +++ b/base/shell/rshell/CMenuBand.cpp @@ -622,18 +622,22 @@ HRESULT CMenuBand::_TrackSubMenuUsingTrackPopupMenu(HMENU popup, INT x, INT y, R { HWND sendTo = m_menuOwner; - // FIXME: use? - //TPMPARAMS params = { sizeof(TPMPARAMS), rcExclude }; + TPMPARAMS params = { sizeof(TPMPARAMS), rcExclude }; + + UINT flags = TPM_VERPOSANIMATION | TPM_VERTICAL | TPM_LEFTALIGN; if (sendTo) { - ::TrackPopupMenuEx(popup, 0, x, y, sendTo, NULL); // ¶ms); + ::TrackPopupMenuEx(popup, flags, x, y, sendTo, ¶ms); } else { + // FIXME: Windows uses the top-level window when calling TrackPopupMenuEx, + // but this is probably not the means by which it obtains that HWND. + // Meanwhile, this works. GetWindow(&sendTo); - ::TrackPopupMenuEx(popup, TPM_RETURNCMD, x, y, sendTo, NULL); // ¶ms); - // TODO: use the result somehow + sendTo = GetAncestor(sendTo, GA_ROOT); + ::TrackPopupMenuEx(popup, flags, x, y, sendTo, ¶ms); } return S_OK; diff --git a/base/shell/rshell/CMenuToolbars.cpp b/base/shell/rshell/CMenuToolbars.cpp index 526f722c408..197055ce066 100644 --- a/base/shell/rshell/CMenuToolbars.cpp +++ b/base/shell/rshell/CMenuToolbars.cpp @@ -549,17 +549,17 @@ HRESULT CMenuToolbarBase::PopupSubMenu(UINT uItem, UINT index, HMENU menu) if (!SendMessage(m_hwndToolbar, TB_GETITEMRECT, index, reinterpret_cast(&rc))) return E_FAIL; - GetWindowRect(m_hwnd, &rcx); + GetClientRect(m_hwndToolbar, &rcx); POINT a = { rc.left, rc.top }; POINT b = { rc.right, rc.bottom }; - POINT c = { rcx.left, rcx.top }; - POINT d = { rcx.right, rcx.bottom }; + POINT c = { rc.left, rc.top }; + POINT d = { rc.right, rc.bottom }; ClientToScreen(m_hwndToolbar, &a); ClientToScreen(m_hwndToolbar, &b); - ClientToScreen(m_hwnd, &c); - ClientToScreen(m_hwnd, &d); + ClientToScreen(m_hwndToolbar, &c); + ClientToScreen(m_hwndToolbar, &d); POINT pt = { a.x, b.y }; RECT rcl = { c.x, c.y, d.x, d.y }; diff --git a/dll/win32/browseui/internettoolbar.cpp b/dll/win32/browseui/internettoolbar.cpp index 3541c56b64b..99ca61942d4 100644 --- a/dll/win32/browseui/internettoolbar.cpp +++ b/dll/win32/browseui/internettoolbar.cpp @@ -25,6 +25,8 @@ toolbar, and address band for an explorer window #include "precomp.h" +#define USE_CUSTOM_MENUBAND 1 + // navigation controls and menubar just send a message to parent window /* TODO: @@ -374,7 +376,7 @@ HRESULT STDMETHODCALLTYPE CMenuCallback::GetObject(LPSMDATA psmd, REFIID riid, v favoritesHMenu = GetSubMenu(parentHMenu, 3); if (favoritesHMenu == NULL) return E_FAIL; -#if 1 +#if USE_CUSTOM_MENUBAND HMODULE hrs = LoadLibrary(L"rshell.dll"); PMENUBAND_CONSTRUCTOR func = (PMENUBAND_CONSTRUCTOR) GetProcAddress(hrs, "CMenuBand_Constructor"); @@ -553,7 +555,7 @@ HRESULT CInternetToolbar::CreateMenuBar(IShellMenu **menuBar) HWND ownerWindow; HRESULT hResult; -#if 1 +#if USE_CUSTOM_MENUBAND HMODULE hrs = LoadLibraryW(L"rshell.dll"); if (!hrs)