mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 04:23:02 +00:00
[BROWSEUI]
* Plug a few menu leaks. In Windows, it brings down the leaked menus from 20 per navigation, to only 1-2. In ReactOS, from 60 to 20. [RSHELL,SHELL32] * Code tweaks that shouldn't change the actual behaviour. svn path=/branches/shell-experiments/; revision=63537
This commit is contained in:
parent
52fc0bf57d
commit
580b89e9b6
5 changed files with 17 additions and 4 deletions
|
@ -1095,6 +1095,10 @@ CMenuStaticToolbar::CMenuStaticToolbar(CMenuBand *menuBand) :
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CMenuStaticToolbar::~CMenuStaticToolbar()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT CMenuStaticToolbar::GetMenu(
|
HRESULT CMenuStaticToolbar::GetMenu(
|
||||||
_Out_opt_ HMENU *phmenu,
|
_Out_opt_ HMENU *phmenu,
|
||||||
_Out_opt_ HWND *phwnd,
|
_Out_opt_ HWND *phwnd,
|
||||||
|
|
|
@ -132,7 +132,7 @@ private:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CMenuStaticToolbar(CMenuBand *menuBand);
|
CMenuStaticToolbar(CMenuBand *menuBand);
|
||||||
virtual ~CMenuStaticToolbar() {}
|
virtual ~CMenuStaticToolbar();
|
||||||
|
|
||||||
HRESULT SetMenu(HMENU hmenu, HWND hwnd, DWORD dwFlags);
|
HRESULT SetMenu(HMENU hmenu, HWND hwnd, DWORD dwFlags);
|
||||||
HRESULT GetMenu(HMENU *phmenu, HWND *phwnd, DWORD *pdwFlags);
|
HRESULT GetMenu(HMENU *phmenu, HWND *phwnd, DWORD *pdwFlags);
|
||||||
|
|
|
@ -1680,6 +1680,8 @@ LRESULT CInternetToolbar::OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam,
|
||||||
SendMessage(fToolbarWindow, TB_CUSTOMIZE, 0, 0);
|
SendMessage(fToolbarWindow, TB_CUSTOMIZE, 0, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DestroyMenu(contextMenuBar);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1571,8 +1571,15 @@ void CShellBrowser::UpdateViewMenu(HMENU theMenu)
|
||||||
DeleteMenu(theMenu, IDM_VIEW_TOOLBARS, MF_BYCOMMAND);
|
DeleteMenu(theMenu, IDM_VIEW_TOOLBARS, MF_BYCOMMAND);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
menuItemInfo.cbSize = sizeof(menuItemInfo);
|
||||||
|
menuItemInfo.fMask = MIIM_SUBMENU;
|
||||||
|
GetMenuItemInfo(theMenu, IDM_VIEW_TOOLBARS, FALSE, &menuItemInfo);
|
||||||
|
DestroyMenu(menuItemInfo.hSubMenu);
|
||||||
|
|
||||||
toolbarMenuBar = LoadMenu(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(IDM_CABINET_CONTEXTMENU));
|
toolbarMenuBar = LoadMenu(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(IDM_CABINET_CONTEXTMENU));
|
||||||
toolbarMenu = GetSubMenu(toolbarMenuBar, 0);
|
toolbarMenu = GetSubMenu(toolbarMenuBar, 0);
|
||||||
|
RemoveMenu(toolbarMenuBar, 0, MF_BYPOSITION);
|
||||||
|
DestroyMenu(toolbarMenuBar);
|
||||||
|
|
||||||
SHCheckMenuItem(toolbarMenu, IDM_TOOLBARS_STANDARDBUTTONS, commandList[0].cmdf);
|
SHCheckMenuItem(toolbarMenu, IDM_TOOLBARS_STANDARDBUTTONS, commandList[0].cmdf);
|
||||||
SHCheckMenuItem(toolbarMenu, IDM_TOOLBARS_ADDRESSBAR, commandList[1].cmdf & OLECMDF_ENABLED);
|
SHCheckMenuItem(toolbarMenu, IDM_TOOLBARS_ADDRESSBAR, commandList[1].cmdf & OLECMDF_ENABLED);
|
||||||
|
@ -1847,6 +1854,8 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::InsertMenusSB(HMENU hmenuShared, LPOLEM
|
||||||
int GCCU(itemCount3) = GetMenuItemCount(hmenuShared);
|
int GCCU(itemCount3) = GetMenuItemCount(hmenuShared);
|
||||||
Unused(itemCount3);
|
Unused(itemCount3);
|
||||||
|
|
||||||
|
DestroyMenu(mainMenu);
|
||||||
|
|
||||||
lpMenuWidths->width[0] = 2;
|
lpMenuWidths->width[0] = 2;
|
||||||
lpMenuWidths->width[2] = 3;
|
lpMenuWidths->width[2] = 3;
|
||||||
lpMenuWidths->width[4] = 1;
|
lpMenuWidths->width[4] = 1;
|
||||||
|
|
|
@ -1383,9 +1383,7 @@ void CDefView::DoActivate(UINT uState)
|
||||||
for (int i = 0; i < mic; i++)
|
for (int i = 0; i < mic; i++)
|
||||||
{
|
{
|
||||||
HMENU submenu = GetSubMenu(m_hMenu, 0);
|
HMENU submenu = GetSubMenu(m_hMenu, 0);
|
||||||
RemoveMenu(m_hMenu, 0, MF_BYPOSITION);
|
DeleteMenu(m_hMenu, 0, MF_BYPOSITION);
|
||||||
if (submenu)
|
|
||||||
DestroyMenu(submenu);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pShellBrowser->InsertMenusSB(m_hMenu, &omw);
|
m_pShellBrowser->InsertMenusSB(m_hMenu, &omw);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue