[ZIPFLDR] Add 'Extract All' menu item to the folder context menu.

This commit is contained in:
Mark Jansen
2018-08-05 11:54:56 +02:00
parent 09719d25c4
commit 875e58d781
+20 -8
View File
@@ -301,10 +301,15 @@ public:
return hr;
}
if (riid == IID_IExplorerCommandProvider)
else if (riid == IID_IExplorerCommandProvider)
{
return _CExplorerCommandProvider_CreateInstance(this, riid, ppvOut);
}
else if (riid == IID_IContextMenu)
{
// Folder context menu
return QueryInterface(riid, ppvOut);
}
if (UnknownIID != riid)
DbgPrint("%s(%S) UNHANDLED\n", __FUNCTION__, guid2string(riid));
return E_NOTIMPL;
@@ -379,6 +384,7 @@ public:
}
else if (riid == IID_IContextMenu && cidl >= 0)
{
// Context menu of an object inside the zip
const ZipPidlEntry* zipEntry = _ZipFromIL(*apidl);
if (zipEntry)
{
@@ -473,9 +479,9 @@ public:
}
STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO pici)
{
if (!pici || pici->cbSize != sizeof(*pici))
if (!pici || (pici->cbSize != sizeof(CMINVOKECOMMANDINFO) && pici->cbSize != sizeof(CMINVOKECOMMANDINFOEX)))
return E_INVALIDARG;
if (pici->lpVerb == MAKEINTRESOURCEA(0) || (HIWORD(pici->lpVerb) && !strcmp(pici->lpVerb, EXTRACT_VERBA)))
{
BSTR ZipFile = m_ZipFile.AllocSysString();
@@ -495,12 +501,18 @@ public:
{
int Entries = 0;
CStringW menuText(MAKEINTRESOURCEW(IDS_MENUITEM));
if (!(uFlags & CMF_DEFAULTONLY))
{
CStringW menuText(MAKEINTRESOURCEW(IDS_MENUITEM));
InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
Entries++;
InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_STRING, idCmdFirst++, menuText);
Entries++;
if (indexMenu)
{
InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
Entries++;
}
InsertMenuW(hmenu, indexMenu++, MF_BYPOSITION | MF_STRING, idCmdFirst++, menuText);
Entries++;
}
return MAKE_HRESULT(SEVERITY_SUCCESS, 0, Entries);
}