1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
// ShellExt.h : Declaration of the CShellExt
#ifndef __SHELLEXT_H_
#define __SHELLEXT_H_
// {EAB841A0-9550-11cf-8C16-00805F1408F3}
#include "resource.h" // main symbols
#include <shlobj.h>
#include <comdef.h>
#include <string>
#include <vector>
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CShellExt
class ATL_NO_VTABLE CShellExt :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CShellExt, &CLSID_ShellExt>,
public IDispatchImpl<IShellExt, &IID_IShellExt, &LIBID_BCSHELLEXTLib>,
public IShellExtInit,
public IContextMenu
{
public:
CShellExt()
{
}
protected:
vector<string> oFileList;
void AnalyzeFiles(void);
public:
// IShellExtInit
STDMETHOD(Initialize)(LPCITEMIDLIST, LPDATAOBJECT, HKEY);
// IContextMenu
STDMETHOD(GetCommandString)(UINT, UINT, UINT*, LPSTR, UINT);
STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO);
STDMETHOD(QueryContextMenu)(HMENU, UINT, UINT, UINT, UINT);
DECLARE_REGISTRY_RESOURCEID(IDR_SHELLEXT)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CShellExt)
COM_INTERFACE_ENTRY(IShellExt)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(IShellExtInit)
COM_INTERFACE_ENTRY(IContextMenu)
END_COM_MAP()
// IShellExt
public:
};
#endif //__SHELLEXT_H_
|