mirror of
https://github.com/reactos/reactos.git
synced 2025-07-28 02:41:55 +00:00
[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 svn path=/branches/shell-experiments/; revision=62469
This commit is contained in:
parent
2b06cdd40e
commit
6f06c27374
3 changed files with 18 additions and 12 deletions
|
@ -622,18 +622,22 @@ HRESULT CMenuBand::_TrackSubMenuUsingTrackPopupMenu(HMENU popup, INT x, INT y, R
|
||||||
{
|
{
|
||||||
HWND sendTo = m_menuOwner;
|
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)
|
if (sendTo)
|
||||||
{
|
{
|
||||||
::TrackPopupMenuEx(popup, 0, x, y, sendTo, NULL); // ¶ms);
|
::TrackPopupMenuEx(popup, flags, x, y, sendTo, ¶ms);
|
||||||
}
|
}
|
||||||
else
|
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);
|
GetWindow(&sendTo);
|
||||||
::TrackPopupMenuEx(popup, TPM_RETURNCMD, x, y, sendTo, NULL); // ¶ms);
|
sendTo = GetAncestor(sendTo, GA_ROOT);
|
||||||
// TODO: use the result somehow
|
::TrackPopupMenuEx(popup, flags, x, y, sendTo, ¶ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
|
|
@ -549,17 +549,17 @@ HRESULT CMenuToolbarBase::PopupSubMenu(UINT uItem, UINT index, HMENU menu)
|
||||||
if (!SendMessage(m_hwndToolbar, TB_GETITEMRECT, index, reinterpret_cast<LPARAM>(&rc)))
|
if (!SendMessage(m_hwndToolbar, TB_GETITEMRECT, index, reinterpret_cast<LPARAM>(&rc)))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
GetWindowRect(m_hwnd, &rcx);
|
GetClientRect(m_hwndToolbar, &rcx);
|
||||||
|
|
||||||
POINT a = { rc.left, rc.top };
|
POINT a = { rc.left, rc.top };
|
||||||
POINT b = { rc.right, rc.bottom };
|
POINT b = { rc.right, rc.bottom };
|
||||||
POINT c = { rcx.left, rcx.top };
|
POINT c = { rc.left, rc.top };
|
||||||
POINT d = { rcx.right, rcx.bottom };
|
POINT d = { rc.right, rc.bottom };
|
||||||
|
|
||||||
ClientToScreen(m_hwndToolbar, &a);
|
ClientToScreen(m_hwndToolbar, &a);
|
||||||
ClientToScreen(m_hwndToolbar, &b);
|
ClientToScreen(m_hwndToolbar, &b);
|
||||||
ClientToScreen(m_hwnd, &c);
|
ClientToScreen(m_hwndToolbar, &c);
|
||||||
ClientToScreen(m_hwnd, &d);
|
ClientToScreen(m_hwndToolbar, &d);
|
||||||
|
|
||||||
POINT pt = { a.x, b.y };
|
POINT pt = { a.x, b.y };
|
||||||
RECT rcl = { c.x, c.y, d.x, d.y };
|
RECT rcl = { c.x, c.y, d.x, d.y };
|
||||||
|
|
|
@ -25,6 +25,8 @@ toolbar, and address band for an explorer window
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
|
||||||
|
#define USE_CUSTOM_MENUBAND 1
|
||||||
|
|
||||||
// navigation controls and menubar just send a message to parent window
|
// navigation controls and menubar just send a message to parent window
|
||||||
/*
|
/*
|
||||||
TODO:
|
TODO:
|
||||||
|
@ -374,7 +376,7 @@ HRESULT STDMETHODCALLTYPE CMenuCallback::GetObject(LPSMDATA psmd, REFIID riid, v
|
||||||
favoritesHMenu = GetSubMenu(parentHMenu, 3);
|
favoritesHMenu = GetSubMenu(parentHMenu, 3);
|
||||||
if (favoritesHMenu == NULL)
|
if (favoritesHMenu == NULL)
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
#if 1
|
#if USE_CUSTOM_MENUBAND
|
||||||
HMODULE hrs = LoadLibrary(L"rshell.dll");
|
HMODULE hrs = LoadLibrary(L"rshell.dll");
|
||||||
|
|
||||||
PMENUBAND_CONSTRUCTOR func = (PMENUBAND_CONSTRUCTOR) GetProcAddress(hrs, "CMenuBand_Constructor");
|
PMENUBAND_CONSTRUCTOR func = (PMENUBAND_CONSTRUCTOR) GetProcAddress(hrs, "CMenuBand_Constructor");
|
||||||
|
@ -553,7 +555,7 @@ HRESULT CInternetToolbar::CreateMenuBar(IShellMenu **menuBar)
|
||||||
HWND ownerWindow;
|
HWND ownerWindow;
|
||||||
HRESULT hResult;
|
HRESULT hResult;
|
||||||
|
|
||||||
#if 1
|
#if USE_CUSTOM_MENUBAND
|
||||||
HMODULE hrs = LoadLibraryW(L"rshell.dll");
|
HMODULE hrs = LoadLibraryW(L"rshell.dll");
|
||||||
|
|
||||||
if (!hrs)
|
if (!hrs)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue