Author: dquintana
Date: Mon Mar 10 12:01:37 2014
New Revision: 62469
URL:
http://svn.reactos.org/svn/reactos?rev=62469&view=rev
Log:
[RSHELL]
* 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
Modified:
branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Mon Mar 10
12:01:37 2014
@@ -622,18 +622,22 @@
{
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;
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Mon Mar 10
12:01:37 2014
@@ -549,17 +549,17 @@
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 };
Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] Mon Mar
10 12:01:37 2014
@@ -24,6 +24,8 @@
*/
#include "precomp.h"
+
+#define USE_CUSTOM_MENUBAND 1
// navigation controls and menubar just send a message to parent window
/*
@@ -374,7 +376,7 @@
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 @@
HWND ownerWindow;
HRESULT hResult;
-#if 1
+#if USE_CUSTOM_MENUBAND
HMODULE hrs = LoadLibraryW(L"rshell.dll");
if (!hrs)