chore: initial commit (extracted from Launchers monorepo)
Plugin: ns7zip v2.0.0 Architectures: x86-ansi, x86-unicode, amd64-unicode License: LGPL-2.1-or-later
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"><assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="7-Zip.7-Zip.7-zip" type="win32"/><description>7-Zip Extension.</description><dependency> <dependentAssembly><assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/></dependentAssembly></dependency></assembly>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,85 @@
|
||||
// ContextMenu.h
|
||||
|
||||
#ifndef __CONTEXT_MENU_H
|
||||
#define __CONTEXT_MENU_H
|
||||
|
||||
#include "../../../Common/MyWindows.h"
|
||||
|
||||
#include <ShlObj.h>
|
||||
|
||||
#include "../../../Common/MyString.h"
|
||||
|
||||
#include "../FileManager/MyCom2.h"
|
||||
|
||||
class CZipContextMenu:
|
||||
public IContextMenu,
|
||||
public IShellExtInit,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
public:
|
||||
|
||||
enum ECommandInternalID
|
||||
{
|
||||
kCommandNULL,
|
||||
kOpen,
|
||||
kExtract,
|
||||
kExtractHere,
|
||||
kExtractTo,
|
||||
kTest,
|
||||
kCompress,
|
||||
kCompressEmail,
|
||||
kCompressTo7z,
|
||||
kCompressTo7zEmail,
|
||||
kCompressToZip,
|
||||
kCompressToZipEmail,
|
||||
kHash_CRC32,
|
||||
kHash_CRC64,
|
||||
kHash_SHA1,
|
||||
kHash_SHA256,
|
||||
kHash_All
|
||||
};
|
||||
|
||||
MY_UNKNOWN_IMP2_MT(IContextMenu, IShellExtInit)
|
||||
|
||||
// IShellExtInit
|
||||
STDMETHOD(Initialize)(LPCITEMIDLIST pidlFolder, LPDATAOBJECT dataObject, HKEY hkeyProgID);
|
||||
|
||||
// IContextMenu
|
||||
STDMETHOD(QueryContextMenu)(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
|
||||
STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO lpici);
|
||||
STDMETHOD(GetCommandString)(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax);
|
||||
|
||||
HRESULT InitContextMenu(const wchar_t *folder, const wchar_t * const *names, unsigned numFiles);
|
||||
|
||||
CZipContextMenu();
|
||||
~CZipContextMenu();
|
||||
|
||||
private:
|
||||
|
||||
struct CCommandMapItem
|
||||
{
|
||||
ECommandInternalID CommandInternalID;
|
||||
UString Verb;
|
||||
UString HelpString;
|
||||
UString Folder;
|
||||
UString ArcName;
|
||||
UString ArcType;
|
||||
};
|
||||
|
||||
bool _isMenuForFM;
|
||||
UStringVector _fileNames;
|
||||
bool _dropMode;
|
||||
UString _dropPath;
|
||||
CObjectVector<CCommandMapItem> _commandMap;
|
||||
|
||||
HBITMAP _bitmap;
|
||||
|
||||
CBoolPair _elimDup;
|
||||
|
||||
HRESULT GetFileNames(LPDATAOBJECT dataObject, UStringVector &fileNames);
|
||||
int FindVerb(const UString &verb);
|
||||
bool FillCommand(ECommandInternalID id, UString &mainString, CCommandMapItem &commandMapItem);
|
||||
void AddMapItem_ForSubMenu(const char *ver);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,26 @@
|
||||
// ContextMenuFlags.h
|
||||
|
||||
#ifndef __CONTEXT_MENU_FLAGS_H
|
||||
#define __CONTEXT_MENU_FLAGS_H
|
||||
|
||||
namespace NContextMenuFlags
|
||||
{
|
||||
const UInt32 kExtract = 1 << 0;
|
||||
const UInt32 kExtractHere = 1 << 1;
|
||||
const UInt32 kExtractTo = 1 << 2;
|
||||
|
||||
const UInt32 kTest = 1 << 4;
|
||||
const UInt32 kOpen = 1 << 5;
|
||||
const UInt32 kOpenAs = 1 << 6;
|
||||
|
||||
const UInt32 kCompress = 1 << 8;
|
||||
const UInt32 kCompressTo7z = 1 << 9;
|
||||
const UInt32 kCompressEmail = 1 << 10;
|
||||
const UInt32 kCompressTo7zEmail = 1 << 11;
|
||||
const UInt32 kCompressToZip = 1 << 12;
|
||||
const UInt32 kCompressToZipEmail = 1 << 13;
|
||||
|
||||
const UInt32 kCRC = (UInt32)1 << 31;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,216 @@
|
||||
// DLLExports.cpp
|
||||
//
|
||||
// Notes:
|
||||
// Win2000:
|
||||
// If I register at HKCR\Folder\ShellEx then DLL is locked.
|
||||
// otherwise it unloads after explorer closing.
|
||||
// but if I call menu for desktop items it's locked all the time
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "../../../Common/MyWindows.h"
|
||||
|
||||
#include <OleCtl.h>
|
||||
|
||||
#include "../../../Common/MyInitGuid.h"
|
||||
|
||||
#include "../../../Common/ComTry.h"
|
||||
|
||||
#include "../../../Windows/DLL.h"
|
||||
#include "../../../Windows/ErrorMsg.h"
|
||||
#include "../../../Windows/NtCheck.h"
|
||||
#include "../../../Windows/Registry.h"
|
||||
|
||||
#include "../FileManager/IFolder.h"
|
||||
|
||||
#include "ContextMenu.h"
|
||||
|
||||
static LPCTSTR const k_ShellExtName = TEXT("7-Zip Shell Extension");
|
||||
static LPCTSTR const k_Approved = TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved");
|
||||
|
||||
// {23170F69-40C1-278A-1000-000100020000}
|
||||
static LPCTSTR const k_Clsid = TEXT("{23170F69-40C1-278A-1000-000100020000}");
|
||||
|
||||
DEFINE_GUID(CLSID_CZipContextMenu,
|
||||
k_7zip_GUID_Data1,
|
||||
k_7zip_GUID_Data2,
|
||||
k_7zip_GUID_Data3_Common,
|
||||
0x10, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00);
|
||||
|
||||
using namespace NWindows;
|
||||
|
||||
HINSTANCE g_hInstance = 0;
|
||||
HWND g_HWND = 0;
|
||||
|
||||
LONG g_DllRefCount = 0; // Reference count of this DLL.
|
||||
|
||||
|
||||
// #define ODS(sz) OutputDebugString(L#sz)
|
||||
|
||||
class CShellExtClassFactory:
|
||||
public IClassFactory,
|
||||
public CMyUnknownImp
|
||||
{
|
||||
public:
|
||||
CShellExtClassFactory() { InterlockedIncrement(&g_DllRefCount); }
|
||||
~CShellExtClassFactory() { InterlockedDecrement(&g_DllRefCount); }
|
||||
|
||||
MY_UNKNOWN_IMP1_MT(IClassFactory)
|
||||
|
||||
STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, void**);
|
||||
STDMETHODIMP LockServer(BOOL);
|
||||
};
|
||||
|
||||
STDMETHODIMP CShellExtClassFactory::CreateInstance(LPUNKNOWN pUnkOuter,
|
||||
REFIID riid, void **ppvObj)
|
||||
{
|
||||
// ODS("CShellExtClassFactory::CreateInstance()\r\n");
|
||||
*ppvObj = NULL;
|
||||
if (pUnkOuter)
|
||||
return CLASS_E_NOAGGREGATION;
|
||||
|
||||
CZipContextMenu *shellExt;
|
||||
try
|
||||
{
|
||||
shellExt = new CZipContextMenu();
|
||||
}
|
||||
catch(...) { return E_OUTOFMEMORY; }
|
||||
if (!shellExt)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
HRESULT res = shellExt->QueryInterface(riid, ppvObj);
|
||||
if (res != S_OK)
|
||||
delete shellExt;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
STDMETHODIMP CShellExtClassFactory::LockServer(BOOL /* fLock */)
|
||||
{
|
||||
return S_OK; // Check it
|
||||
}
|
||||
|
||||
|
||||
#define NT_CHECK_FAIL_ACTION return FALSE;
|
||||
|
||||
extern "C"
|
||||
BOOL WINAPI DllMain(
|
||||
#ifdef UNDER_CE
|
||||
HANDLE hInstance
|
||||
#else
|
||||
HINSTANCE hInstance
|
||||
#endif
|
||||
, DWORD dwReason, LPVOID)
|
||||
{
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
g_hInstance = (HINSTANCE)hInstance;
|
||||
// ODS("In DLLMain, DLL_PROCESS_ATTACH\r\n");
|
||||
NT_CHECK
|
||||
}
|
||||
else if (dwReason == DLL_PROCESS_DETACH)
|
||||
{
|
||||
// ODS("In DLLMain, DLL_PROCESS_DETACH\r\n");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
// Used to determine whether the DLL can be unloaded by OLE
|
||||
|
||||
STDAPI DllCanUnloadNow(void)
|
||||
{
|
||||
// ODS("In DLLCanUnloadNow\r\n");
|
||||
return (g_DllRefCount == 0 ? S_OK : S_FALSE);
|
||||
}
|
||||
|
||||
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
|
||||
{
|
||||
// ODS("In DllGetClassObject\r\n");
|
||||
*ppv = NULL;
|
||||
if (IsEqualIID(rclsid, CLSID_CZipContextMenu))
|
||||
{
|
||||
CShellExtClassFactory *cf;
|
||||
try
|
||||
{
|
||||
cf = new CShellExtClassFactory;
|
||||
}
|
||||
catch(...) { return E_OUTOFMEMORY; }
|
||||
if (!cf)
|
||||
return E_OUTOFMEMORY;
|
||||
HRESULT res = cf->QueryInterface(riid, ppv);
|
||||
if (res != S_OK)
|
||||
delete cf;
|
||||
return res;
|
||||
}
|
||||
return CLASS_E_CLASSNOTAVAILABLE;
|
||||
// return _Module.GetClassObject(rclsid, riid, ppv);
|
||||
}
|
||||
|
||||
|
||||
static BOOL RegisterServer()
|
||||
{
|
||||
FString modulePath;
|
||||
if (!NDLL::MyGetModuleFileName(modulePath))
|
||||
return FALSE;
|
||||
const UString modulePathU = fs2us(modulePath);
|
||||
|
||||
CSysString s ("CLSID\\");
|
||||
s += k_Clsid;
|
||||
|
||||
{
|
||||
NRegistry::CKey key;
|
||||
if (key.Create(HKEY_CLASSES_ROOT, s, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE) != NOERROR)
|
||||
return FALSE;
|
||||
key.SetValue(NULL, k_ShellExtName);
|
||||
NRegistry::CKey keyInproc;
|
||||
if (keyInproc.Create(key, TEXT("InprocServer32"), NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE) != NOERROR)
|
||||
return FALSE;
|
||||
keyInproc.SetValue(NULL, modulePathU);
|
||||
keyInproc.SetValue(TEXT("ThreadingModel"), TEXT("Apartment"));
|
||||
}
|
||||
|
||||
#if !defined(_WIN64) && !defined(UNDER_CE)
|
||||
if (IsItWindowsNT())
|
||||
#endif
|
||||
{
|
||||
NRegistry::CKey key;
|
||||
if (key.Create(HKEY_LOCAL_MACHINE, k_Approved, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE) == NOERROR)
|
||||
key.SetValue(k_Clsid, k_ShellExtName);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
STDAPI DllRegisterServer(void)
|
||||
{
|
||||
return RegisterServer() ? S_OK: SELFREG_E_CLASS;
|
||||
}
|
||||
|
||||
static BOOL UnregisterServer()
|
||||
{
|
||||
CSysString s ("CLSID\\");
|
||||
s += k_Clsid;
|
||||
|
||||
RegDeleteKey(HKEY_CLASSES_ROOT, s + TEXT("\\InprocServer32"));
|
||||
RegDeleteKey(HKEY_CLASSES_ROOT, s);
|
||||
|
||||
#if !defined(_WIN64) && !defined(UNDER_CE)
|
||||
if (IsItWindowsNT())
|
||||
#endif
|
||||
{
|
||||
HKEY hKey;
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, k_Approved, 0, KEY_SET_VALUE, &hKey) == NOERROR)
|
||||
{
|
||||
RegDeleteValue(hKey, k_Clsid);
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
STDAPI DllUnregisterServer(void)
|
||||
{
|
||||
return UnregisterServer() ? S_OK: SELFREG_E_CLASS;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
; 7-zip.def
|
||||
|
||||
LIBRARY "7-zip"
|
||||
|
||||
EXPORTS
|
||||
DllCanUnloadNow PRIVATE
|
||||
DllGetClassObject PRIVATE
|
||||
DllRegisterServer PRIVATE
|
||||
DllUnregisterServer PRIVATE
|
||||
@@ -0,0 +1,559 @@
|
||||
# Microsoft Developer Studio Project File - Name="Explorer" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=Explorer - Win32 DebugU
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Explorer.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Explorer.mak" CFG="Explorer - Win32 DebugU"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Explorer - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "Explorer - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "Explorer - Win32 ReleaseU" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "Explorer - Win32 DebugU" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "Explorer - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W4 /WX /GX /O1 /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
# ADD RSC /l 0x419 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /dll /machine:I386 /out:"C:\Program Files\7-ZIP\7-Zip.dll" /opt:NOWIN98
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "Explorer - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MTd /W4 /WX /Gm /GX /ZI /Od /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "_DEBUG"
|
||||
# ADD RSC /l 0x419 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /dll /debug /machine:I386 /out:"C:\Program Files\7-ZIP\7-Zip.dll" /pdbtype:sept
|
||||
|
||||
!ELSEIF "$(CFG)" == "Explorer - Win32 ReleaseU"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "ReleaseU"
|
||||
# PROP BASE Intermediate_Dir "ReleaseU"
|
||||
# PROP BASE Ignore_Export_Lib 1
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "ReleaseU"
|
||||
# PROP Intermediate_Dir "ReleaseU"
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "_MBCS" /Yu"StdAfx.h" /FD /c
|
||||
# ADD CPP /nologo /Gz /MD /W4 /WX /GX /O1 /D "NDEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /Yu"StdAfx.h" /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /dll /machine:I386 /out:"C:\Program Files\7-ZIP\7-Zip.dll" /opt:NOWIN98
|
||||
# SUBTRACT BASE LINK32 /pdb:none
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /dll /machine:I386 /out:"C:\Program Files\7-ZIP\7-Zipn.dll" /opt:NOWIN98
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "Explorer - Win32 DebugU"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "DebugU"
|
||||
# PROP BASE Intermediate_Dir "DebugU"
|
||||
# PROP BASE Ignore_Export_Lib 1
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "DebugU"
|
||||
# PROP Intermediate_Dir "DebugU"
|
||||
# PROP Ignore_Export_Lib 1
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /D "_MBCS" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD CPP /nologo /Gz /MTd /W4 /WX /Gm /GX /ZI /Od /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /D "EXPLORER_EXPORTS" /D "LANG" /Yu"StdAfx.h" /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x419 /d "_DEBUG"
|
||||
# ADD RSC /l 0x419 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /dll /debug /machine:I386 /out:"C:\Program Files\7-ZIP\7-Zip.dll" /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /dll /debug /machine:I386 /out:"C:\Program Files\7-ZIP\7-Zip.dll" /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "Explorer - Win32 Release"
|
||||
# Name "Explorer - Win32 Debug"
|
||||
# Name "Explorer - Win32 ReleaseU"
|
||||
# Name "Explorer - Win32 DebugU"
|
||||
# Begin Group "Spec"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\DllExportsExplorer.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Explorer.def
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\resource.rc
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.cpp
|
||||
# ADD CPP /Yc"StdAfx.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\StdAfx.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "UI Common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\ArchiveName.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\ArchiveName.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\CompressCall.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\CompressCall.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\ExtractingFilePath.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\ExtractingFilePath.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\ZipRegistry.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\Common\ZipRegistry.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Engine"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ContextMenu.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ContextMenu.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MyMessages.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MyMessages.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "FileManager"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\FormatUtils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\FormatUtils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\HelpUtils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\HelpUtils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\IFolder.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\LangUtils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\LangUtils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\ProgramLocation.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\ProgramLocation.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\RegistryUtils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\FileManager\RegistryUtils.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "C"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\CpuArch.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Threads.c
|
||||
# SUBTRACT CPP /YX /Yc /Yu
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\..\C\Threads.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Common"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\IntToString.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\IntToString.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\Lang.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\Lang.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\MyCom.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\MyString.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\MyString.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\MyVector.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\MyVector.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\NewHandler.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\NewHandler.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\Random.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\Random.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StringConvert.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StringConvert.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StringToInt.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\StringToInt.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\Types.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\UTFConvert.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\UTFConvert.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\Wildcard.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Common\Wildcard.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Windows"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Group "Control"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Control\Dialog.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Control\Dialog.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Control\ListView.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Control\ListView.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Control\PropertyPage.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Control\PropertyPage.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\DLL.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\DLL.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\ErrorMsg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\ErrorMsg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\FileDir.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\FileDir.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\FileFind.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\FileFind.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\FileIO.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\FileIO.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\FileMapping.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\FileName.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\FileName.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\MemoryGlobal.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\MemoryGlobal.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\MemoryLock.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\MemoryLock.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Menu.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Menu.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\ProcessUtils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\ProcessUtils.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Registry.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Registry.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\ResourceString.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\ResourceString.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Shell.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Shell.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Synchronization.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Window.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\Window.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\7-zip.dll.manifest"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ContextMenuFlags.h
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "Explorer"=".\Explorer.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 114 B |
@@ -0,0 +1,37 @@
|
||||
// MyMessages.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "MyMessages.h"
|
||||
|
||||
#include "../../../Windows/ErrorMsg.h"
|
||||
#include "../../../Windows/ResourceString.h"
|
||||
|
||||
#include "../FileManager/LangUtils.h"
|
||||
|
||||
using namespace NWindows;
|
||||
|
||||
void ShowErrorMessage(HWND window, LPCWSTR message)
|
||||
{
|
||||
::MessageBoxW(window, message, L"7-Zip", MB_OK | MB_ICONSTOP);
|
||||
}
|
||||
|
||||
void ShowErrorMessageHwndRes(HWND window, UINT resID)
|
||||
{
|
||||
ShowErrorMessage(window, LangString(resID));
|
||||
}
|
||||
|
||||
void ShowErrorMessageRes(UINT resID)
|
||||
{
|
||||
ShowErrorMessageHwndRes(0, resID);
|
||||
}
|
||||
|
||||
void ShowErrorMessageDWORD(HWND window, DWORD errorCode)
|
||||
{
|
||||
ShowErrorMessage(window, NError::MyFormatMessage(errorCode));
|
||||
}
|
||||
|
||||
void ShowLastErrorMessage(HWND window)
|
||||
{
|
||||
ShowErrorMessageDWORD(window, ::GetLastError());
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// MyMessages.h
|
||||
|
||||
#ifndef __MY_MESSAGES_H
|
||||
#define __MY_MESSAGES_H
|
||||
|
||||
#include "../../../Common/MyString.h"
|
||||
|
||||
void ShowErrorMessage(HWND window, LPCWSTR message);
|
||||
inline void ShowErrorMessage(LPCWSTR message) { ShowErrorMessage(0, message); }
|
||||
|
||||
void ShowErrorMessageHwndRes(HWND window, UInt32 langID);
|
||||
void ShowErrorMessageRes(UInt32 langID);
|
||||
|
||||
void ShowLastErrorMessage(HWND window = 0);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,224 @@
|
||||
// RegistryContextMenu.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "../../../Common/StringConvert.h"
|
||||
|
||||
#include "../../../Windows/Registry.h"
|
||||
|
||||
#include "RegistryContextMenu.h"
|
||||
|
||||
using namespace NWindows;
|
||||
using namespace NRegistry;
|
||||
|
||||
#ifndef UNDER_CE
|
||||
|
||||
// does extension can work, if Approved is removed ?
|
||||
// CLISID (and Approved ?) items are separated for 32-bit and 64-bit code.
|
||||
// shellex items shared by 32-bit and 64-bit code?
|
||||
|
||||
#define k_Clsid_A "{23170F69-40C1-278A-1000-000100020000}"
|
||||
|
||||
static LPCTSTR const k_Clsid = TEXT(k_Clsid_A);
|
||||
static LPCTSTR const k_ShellExtName = TEXT("7-Zip Shell Extension");
|
||||
|
||||
static LPCTSTR const k_Approved = TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved");
|
||||
static LPCTSTR const k_Inproc = TEXT("InprocServer32");
|
||||
|
||||
static LPCSTR const k_KeyPostfix_ContextMenu = "\\shellex\\ContextMenuHandlers\\7-Zip";
|
||||
static LPCSTR const k_KeyPostfix_DragDrop = "\\shellex\\DragDropHandlers\\7-Zip";
|
||||
|
||||
static LPCSTR const k_KeyName_File = "*";
|
||||
static LPCSTR const k_KeyName_Folder = "Folder";
|
||||
static LPCSTR const k_KeyName_Directory = "Directory";
|
||||
static LPCSTR const k_KeyName_Drive = "Drive";
|
||||
|
||||
static LPCSTR const k_shellex_Prefixes[] =
|
||||
{
|
||||
k_KeyName_File,
|
||||
k_KeyName_Folder,
|
||||
k_KeyName_Directory,
|
||||
k_KeyName_Drive
|
||||
};
|
||||
|
||||
static const bool k_shellex_Statuses[2][4] =
|
||||
{
|
||||
{ true, true, true, false },
|
||||
{ false, false, true, true }
|
||||
};
|
||||
|
||||
|
||||
// can we use static RegDeleteKeyExW in _WIN64 mode?
|
||||
// is it supported by Windows 2003 x64?
|
||||
|
||||
/*
|
||||
#ifdef _WIN64
|
||||
|
||||
#define INIT_REG_WOW
|
||||
|
||||
#else
|
||||
*/
|
||||
|
||||
typedef WINADVAPI LONG (APIENTRY *Func_RegDeleteKeyExW)(HKEY hKey, LPCWSTR lpSubKey, REGSAM samDesired, DWORD Reserved);
|
||||
static Func_RegDeleteKeyExW func_RegDeleteKeyExW;
|
||||
|
||||
static void Init_RegDeleteKeyExW()
|
||||
{
|
||||
if (!func_RegDeleteKeyExW)
|
||||
func_RegDeleteKeyExW = (Func_RegDeleteKeyExW)
|
||||
GetProcAddress(GetModuleHandleW(L"advapi32.dll"), "RegDeleteKeyExW");
|
||||
}
|
||||
|
||||
#define INIT_REG_WOW if (wow != 0) Init_RegDeleteKeyExW();
|
||||
|
||||
// #endif
|
||||
|
||||
static LONG MyRegistry_DeleteKey(HKEY parentKey, LPCTSTR name, UInt32 wow)
|
||||
{
|
||||
if (wow == 0)
|
||||
return RegDeleteKey(parentKey, name);
|
||||
|
||||
/*
|
||||
#ifdef _WIN64
|
||||
return RegDeleteKeyExW
|
||||
#else
|
||||
*/
|
||||
if (!func_RegDeleteKeyExW)
|
||||
return E_NOTIMPL;
|
||||
return func_RegDeleteKeyExW
|
||||
// #endif
|
||||
(parentKey, GetUnicodeString(name), wow, 0);
|
||||
}
|
||||
|
||||
static LONG MyRegistry_DeleteKey_HKCR(LPCTSTR name, UInt32 wow)
|
||||
{
|
||||
return MyRegistry_DeleteKey(HKEY_CLASSES_ROOT, name, wow);
|
||||
}
|
||||
|
||||
// static NSynchronization::CCriticalSection g_CS;
|
||||
|
||||
static AString Get_ContextMenuHandler_KeyName(LPCSTR keyName)
|
||||
{ return (AString)keyName + k_KeyPostfix_ContextMenu; }
|
||||
|
||||
/*
|
||||
static CSysString Get_DragDropHandler_KeyName(LPCTSTR keyName)
|
||||
{ return (AString)keyName + k_KeyPostfix_DragDrop); }
|
||||
*/
|
||||
|
||||
static bool CheckHandlerCommon(const AString &keyName, UInt32 wow)
|
||||
{
|
||||
CKey key;
|
||||
if (key.Open(HKEY_CLASSES_ROOT, (CSysString)keyName, KEY_READ | wow) != ERROR_SUCCESS)
|
||||
return false;
|
||||
CSysString value;
|
||||
if (key.QueryValue(NULL, value) != ERROR_SUCCESS)
|
||||
return false;
|
||||
return StringsAreEqualNoCase_Ascii(value, k_Clsid_A);
|
||||
}
|
||||
|
||||
bool CheckContextMenuHandler(const UString &path, UInt32 wow)
|
||||
{
|
||||
// NSynchronization::CCriticalSectionLock lock(g_CS);
|
||||
|
||||
CSysString s ("CLSID\\");
|
||||
s += k_Clsid_A;
|
||||
s += "\\InprocServer32";
|
||||
|
||||
{
|
||||
NRegistry::CKey key;
|
||||
if (key.Open(HKEY_CLASSES_ROOT, s, KEY_READ | wow) != ERROR_SUCCESS)
|
||||
return false;
|
||||
UString regPath;
|
||||
if (key.QueryValue(NULL, regPath) != ERROR_SUCCESS)
|
||||
return false;
|
||||
if (!path.IsEqualTo_NoCase(regPath))
|
||||
return false;
|
||||
}
|
||||
|
||||
return
|
||||
CheckHandlerCommon(Get_ContextMenuHandler_KeyName(k_KeyName_File), wow);
|
||||
/*
|
||||
&& CheckHandlerCommon(Get_ContextMenuHandler_KeyName(k_KeyName_Directory), wow)
|
||||
// && CheckHandlerCommon(Get_ContextMenuHandler_KeyName(k_KeyName_Folder))
|
||||
|
||||
&& CheckHandlerCommon(Get_DragDropHandler_KeyName(k_KeyName_Directory), wow)
|
||||
&& CheckHandlerCommon(Get_DragDropHandler_KeyName(k_KeyName_Drive), wow);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
static LONG MyCreateKey(CKey &key, HKEY parentKey, LPCTSTR keyName, UInt32 wow)
|
||||
{
|
||||
return key.Create(parentKey, keyName, REG_NONE,
|
||||
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS | wow);
|
||||
}
|
||||
|
||||
LONG SetContextMenuHandler(bool setMode, const UString &path, UInt32 wow)
|
||||
{
|
||||
// NSynchronization::CCriticalSectionLock lock(g_CS);
|
||||
|
||||
INIT_REG_WOW
|
||||
|
||||
LONG res;
|
||||
|
||||
{
|
||||
CSysString s ("CLSID\\");
|
||||
s += k_Clsid_A;
|
||||
|
||||
if (setMode)
|
||||
{
|
||||
{
|
||||
CKey key;
|
||||
res = MyCreateKey(key, HKEY_CLASSES_ROOT, s, wow);
|
||||
if (res == ERROR_SUCCESS)
|
||||
{
|
||||
key.SetValue(NULL, k_ShellExtName);
|
||||
CKey keyInproc;
|
||||
res = MyCreateKey(keyInproc, key, k_Inproc, wow);
|
||||
if (res == ERROR_SUCCESS)
|
||||
{
|
||||
res = keyInproc.SetValue(NULL, path);
|
||||
keyInproc.SetValue(TEXT("ThreadingModel"), TEXT("Apartment"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
CKey key;
|
||||
if (MyCreateKey(key, HKEY_LOCAL_MACHINE, k_Approved, wow) == ERROR_SUCCESS)
|
||||
key.SetValue(k_Clsid, k_ShellExtName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CSysString s2 (s);
|
||||
s2 += "\\InprocServer32";
|
||||
|
||||
MyRegistry_DeleteKey_HKCR(s2, wow);
|
||||
res = MyRegistry_DeleteKey_HKCR(s, wow);
|
||||
}
|
||||
}
|
||||
|
||||
// shellex items probably are shared beween 32-bit and 64-bit apps. So we don't delete items for delete operation.
|
||||
if (setMode)
|
||||
for (unsigned i = 0; i < 2; i++)
|
||||
{
|
||||
for (unsigned k = 0; k < ARRAY_SIZE(k_shellex_Prefixes); k++)
|
||||
{
|
||||
CSysString s (k_shellex_Prefixes[k]);
|
||||
s += (i == 0 ? k_KeyPostfix_ContextMenu : k_KeyPostfix_DragDrop);
|
||||
if (k_shellex_Statuses[i][k])
|
||||
{
|
||||
CKey key;
|
||||
MyCreateKey(key, HKEY_CLASSES_ROOT, s, wow);
|
||||
key.SetValue(NULL, k_Clsid);
|
||||
}
|
||||
else
|
||||
MyRegistry_DeleteKey_HKCR(s, wow);
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,13 @@
|
||||
// RegistryContextMenu.h
|
||||
|
||||
#ifndef __REGISTRY_CONTEXT_MENU_H
|
||||
#define __REGISTRY_CONTEXT_MENU_H
|
||||
|
||||
#ifndef UNDER_CE
|
||||
|
||||
bool CheckContextMenuHandler(const UString &path, UInt32 wow = 0);
|
||||
LONG SetContextMenuHandler(bool setMode, const UString &path, UInt32 wow = 0);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,3 @@
|
||||
// StdAfx.cpp
|
||||
|
||||
#include "stdafx.h"
|
||||
@@ -0,0 +1,14 @@
|
||||
// StdAfx.h
|
||||
|
||||
#ifndef __STDAFX_H
|
||||
#define __STDAFX_H
|
||||
|
||||
// #define _WIN32_WINNT 0x0400
|
||||
#define _WIN32_WINNT 0x0500
|
||||
#define WINVER _WIN32_WINNT
|
||||
|
||||
#include "../../../Common/Common.h"
|
||||
|
||||
#include <ShlObj.h>
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,74 @@
|
||||
PROG = 7-zip.dll
|
||||
DEF_FILE = Explorer.def
|
||||
CFLAGS = $(CFLAGS) \
|
||||
-DLANG \
|
||||
|
||||
!IFDEF UNDER_CE
|
||||
LIBS = $(LIBS) Commctrl.lib
|
||||
!ELSE
|
||||
LIBS = $(LIBS) htmlhelp.lib comdlg32.lib Mpr.lib Gdi32.lib
|
||||
CFLAGS = $(CFLAGS) -DWIN_LONG_PATH
|
||||
!ENDIF
|
||||
|
||||
EXPLORER_OBJS = \
|
||||
$O\DllExportsExplorer.obj \
|
||||
$O\ContextMenu.obj \
|
||||
$O\MyMessages.obj \
|
||||
|
||||
COMMON_OBJS = \
|
||||
$O\IntToString.obj \
|
||||
$O\Lang.obj \
|
||||
$O\MyString.obj \
|
||||
$O\MyVector.obj \
|
||||
$O\NewHandler.obj \
|
||||
$O\Random.obj \
|
||||
$O\StringConvert.obj \
|
||||
$O\StringToInt.obj \
|
||||
$O\UTFConvert.obj \
|
||||
$O\Wildcard.obj \
|
||||
|
||||
WIN_OBJS = \
|
||||
$O\DLL.obj \
|
||||
$O\ErrorMsg.obj \
|
||||
$O\FileDir.obj \
|
||||
$O\FileFind.obj \
|
||||
$O\FileIO.obj \
|
||||
$O\FileName.obj \
|
||||
$O\MemoryLock.obj \
|
||||
$O\Menu.obj \
|
||||
$O\ProcessUtils.obj \
|
||||
$O\Registry.obj \
|
||||
$O\ResourceString.obj \
|
||||
$O\Shell.obj \
|
||||
$O\Synchronization.obj \
|
||||
$O\Window.obj \
|
||||
|
||||
!IFDEF UNDER_CE
|
||||
|
||||
WIN_OBJS = $(WIN_OBJS) \
|
||||
$O\CommonDialog.obj \
|
||||
|
||||
!ENDIF
|
||||
|
||||
WIN_CTRL_OBJS = \
|
||||
$O\Dialog.obj \
|
||||
$O\ListView.obj \
|
||||
|
||||
UI_COMMON_OBJS = \
|
||||
$O\ArchiveName.obj \
|
||||
$O\CompressCall.obj \
|
||||
$O\ExtractingFilePath.obj \
|
||||
$O\ZipRegistry.obj \
|
||||
|
||||
FM_OBJS = \
|
||||
$O\FormatUtils.obj \
|
||||
$O\HelpUtils.obj \
|
||||
$O\LangUtils.obj \
|
||||
$O\ProgramLocation.obj \
|
||||
$O\RegistryUtils.obj \
|
||||
|
||||
C_OBJS = \
|
||||
$O\CpuArch.obj \
|
||||
$O\Threads.obj \
|
||||
|
||||
!include "../../7zip.mak"
|
||||
@@ -0,0 +1,13 @@
|
||||
#define IDS_CONTEXT_FOLDER 2320
|
||||
#define IDS_CONTEXT_ARCHIVE 2321
|
||||
#define IDS_CONTEXT_OPEN 2322
|
||||
#define IDS_CONTEXT_EXTRACT 2323
|
||||
#define IDS_CONTEXT_COMPRESS 2324
|
||||
#define IDS_CONTEXT_TEST 2325
|
||||
#define IDS_CONTEXT_EXTRACT_HERE 2326
|
||||
#define IDS_CONTEXT_EXTRACT_TO 2327
|
||||
#define IDS_CONTEXT_COMPRESS_TO 2328
|
||||
#define IDS_CONTEXT_COMPRESS_EMAIL 2329
|
||||
#define IDS_CONTEXT_COMPRESS_TO_EMAIL 2330
|
||||
|
||||
#define IDB_MENU_LOGO 190
|
||||
@@ -0,0 +1,8 @@
|
||||
#include "../../MyVersionInfo.rc"
|
||||
#include "resource2.rc"
|
||||
|
||||
MY_VERSION_INFO_DLL("7-Zip Shell Extension", "7-zip")
|
||||
|
||||
#ifndef UNDER_CE
|
||||
1 24 MOVEABLE PURE "7-zip.dll.manifest"
|
||||
#endif
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "resource.h"
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_CONTEXT_FOLDER "<Folder>"
|
||||
IDS_CONTEXT_ARCHIVE "<Archive>"
|
||||
IDS_CONTEXT_OPEN "Open archive"
|
||||
IDS_CONTEXT_EXTRACT "Extract files..."
|
||||
IDS_CONTEXT_COMPRESS "Add to archive..."
|
||||
IDS_CONTEXT_TEST "Test archive"
|
||||
IDS_CONTEXT_EXTRACT_HERE "Extract Here"
|
||||
IDS_CONTEXT_EXTRACT_TO "Extract to {0}"
|
||||
IDS_CONTEXT_COMPRESS_TO "Add to {0}"
|
||||
IDS_CONTEXT_COMPRESS_EMAIL "Compress and email..."
|
||||
IDS_CONTEXT_COMPRESS_TO_EMAIL "Compress to {0} and email"
|
||||
END
|
||||
|
||||
IDB_MENU_LOGO BITMAP "../../UI/Explorer/MenuLogo.bmp"
|
||||
Reference in New Issue
Block a user