* Give TrackPopupMenuEx the top-level window. Need to figure out how Windows does this, it probably does not simply use the top-level window that way.
* Give TrackPopupMenuEx better flags and a better exclude rect.
CORE-7586
svn path=/branches/shell-experiments/; revision=62469
{
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;
if (!SendMessage(m_hwndToolbar, TB_GETITEMRECT, index, reinterpret_cast<LPARAM>(&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 };
#include "precomp.h"
+#define USE_CUSTOM_MENUBAND 1
+
// navigation controls and menubar just send a message to parent window
/*
TODO:
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");
HWND ownerWindow;
HRESULT hResult;
-#if 1
+#if USE_CUSTOM_MENUBAND
HMODULE hrs = LoadLibraryW(L"rshell.dll");
if (!hrs)