Skip to content

Commit 94e1161

Browse files
committed
* Fixed issue #6 : (twice) Right-click on a directory with Windows Explorer in the left panel shows the menus twice.
* Fixed issue #31 : (twice) Error in logs for CContextMenu::GetCommandString()
1 parent cfd99cb commit 94e1161

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Changes for 0.10.0
22

33
* Deprecated support for icons with negative resource id.
4+
* Fixed issue #6 : (twice) Right-click on a directory with Windows Explorer in the left panel shows the menus twice.
5+
* Fixed issue #31 : (twice) Error in logs for CContextMenu::GetCommandString()
46
* Fixed issue #109: Implement default and verbose logging.
57
* Fixed issue #150: ico icon (that do not specifically force index=0) are not working.
68
* Fixed issue #155: Drop support for loading icons from a resource id (icons with a negative index smaller than -1).

src/shellextension/CContextMenu.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
OBJECT_ENTRY_AUTO(CLSID_ShellAnything, CContextMenu)
5353

5454
static const GUID CLSID_UNDOCUMENTED_01 = { 0x924502a7, 0xcc8e, 0x4f60, { 0xae, 0x1f, 0xf7, 0x0c, 0x0a, 0x2b, 0x7a, 0x7c } };
55+
HMENU CContextMenu::m_previousMenu = 0;
5556

5657
void CContextMenu::BuildMenuTree(HMENU hMenu, shellanything::Menu* menu, UINT& insert_pos, bool& next_menu_is_column)
5758
{
@@ -333,7 +334,6 @@ CContextMenu::CContextMenu()
333334
m_FirstCommandId = 0;
334335
m_IsBackGround = false;
335336
m_BuildMenuTreeCount = 0;
336-
m_previousMenu = 0;
337337
}
338338

339339
CContextMenu::~CContextMenu()
@@ -382,7 +382,8 @@ HRESULT STDMETHODCALLTYPE CContextMenu::QueryContextMenu(HMENU hMenu, UINT menu_
382382
//Issue #6 - Right-click on a directory with Windows Explorer in the left panel shows the menus twice.
383383
//Issue #31 - Error in logs for CContextMenu::GetCommandString().
384384
//Using a static variable is a poor method for solving the issue but it is a "good enough" strategy.
385-
SA_LOG(INFO) << "Skipped, QueryContextMenu() called twice and menu is already populated once.";
385+
SA_LOG(INFO) << "Skipped, QueryContextMenu() called twice and menu is already populated once. "
386+
"A call to QueryContextMenu() from another instance has already run and populated the menu.";
386387
return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, 0); //nothing inserted
387388
}
388389

src/shellextension/CContextMenu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ class ATL_NO_VTABLE CContextMenu :
8989
int m_BuildMenuTreeCount; //number of times that BuildMenuTree() was called
9090
shellanything::BitmapCache m_BitmapCache;
9191
IconMap m_FileExtensionCache;
92-
HMENU m_previousMenu;
92+
static HMENU m_previousMenu; // issue #6. Field must be static
9393
shellanything::SelectionContext m_Context;
9494
};

0 commit comments

Comments
 (0)