Index: src/chext/ShellExtControl.cpp =================================================================== diff -u -N --- src/chext/ShellExtControl.cpp (revision 0) +++ src/chext/ShellExtControl.cpp (revision d3f78bbf9677c239814dae1041f24f0bbc821db9) @@ -0,0 +1,30 @@ +/*************************************************************************** +* Copyright (C) 2001-2008 by J�zef Starosczyk * +* ixen@copyhandler.com * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Library General Public License * +* (version 2) as published by the Free Software Foundation; * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU Library General Public * +* License along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ +#include "stdafx.h" +#include "chext.h" +#include "ShellExtControl.h" +#include "../common/version.h" + +STDMETHODIMP CShellExtControl::GetVersion(LONG* plVersion) +{ + if(!plVersion) + return E_INVALIDARG; + (*plVersion) = PRODUCT_VERSION1 << 24 | PRODUCT_VERSION2 << 16 | PRODUCT_VERSION3 << 8 | PRODUCT_VERSION4; + return S_OK; +} Index: src/chext/ShellExtControl.h =================================================================== diff -u -N --- src/chext/ShellExtControl.h (revision 0) +++ src/chext/ShellExtControl.h (revision d3f78bbf9677c239814dae1041f24f0bbc821db9) @@ -0,0 +1,47 @@ +/*************************************************************************** +* Copyright (C) 2001-2008 by J�zef Starosczyk * +* ixen@copyhandler.com * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Library General Public License * +* (version 2) as published by the Free Software Foundation; * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU Library General Public * +* License along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ +#ifndef __SHELLEXTCONTROL_H_ +#define __SHELLEXTCONTROL_H_ + +#include "resource.h" // main symbols + +///////////////////////////////////////////////////////////////////////////// +// CDropMenuExt +class ATL_NO_VTABLE CShellExtControl : + public CComObjectRootEx, + public CComCoClass, + public IShellExtControl +{ +public: + CShellExtControl() { } + ~CShellExtControl() { } + + STDMETHOD(GetVersion)(LONG* plVersion); + +DECLARE_REGISTRY_RESOURCEID(IDR_SHELLEXTCONTROL) + +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CShellExtControl) + COM_INTERFACE_ENTRY(IUnknown) + COM_INTERFACE_ENTRY(IShellExtControl) +END_COM_MAP() +}; + +#endif //__SHELLEXTCONTROL_H_ Index: src/chext/ShellExtControl.rgs =================================================================== diff -u -N --- src/chext/ShellExtControl.rgs (revision 0) +++ src/chext/ShellExtControl.rgs (revision d3f78bbf9677c239814dae1041f24f0bbc821db9) @@ -0,0 +1,26 @@ +HKCR +{ + chext.ShellExtControl.1 = s 'ShellExtControl Class' + { + CLSID = s '{317E503A-9D2F-4f42-995E-D314CB9D89B0}' + } + chext.ShellExtControl = s 'ShellExtControl Class' + { + CLSID = s '{317E503A-9D2F-4f42-995E-D314CB9D89B0}' + CurVer = s 'chext.MenuExt.1' + } + NoRemove CLSID + { + ForceRemove {317E503A-9D2F-4f42-995E-D314CB9D89B0} = s 'ShellExtControl Class' + { + ProgID = s 'chext.ShellExtControl.1' + VersionIndependentProgID = s 'chext.ShellExtControl' + ForceRemove 'Programmable' + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Neutral' + } + 'TypeLib' = s '{68FAFC14-8EB8-4DA1-90EB-6B3D22010505}' + } + } +} Index: src/chext/chext.cpp =================================================================== diff -u -N -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -rd3f78bbf9677c239814dae1041f24f0bbc821db9 --- src/chext/chext.cpp (.../chext.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/chext/chext.cpp (.../chext.cpp) (revision d3f78bbf9677c239814dae1041f24f0bbc821db9) @@ -28,6 +28,7 @@ #include "chext_i.c" #include "MenuExt.h" #include "DropMenuExt.h" +#include "ShellExtControl.h" CComModule _Module; Index: src/chext/chext.idl =================================================================== diff -u -N -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -rd3f78bbf9677c239814dae1041f24f0bbc821db9 --- src/chext/chext.idl (.../chext.idl) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/chext/chext.idl (.../chext.idl) (revision d3f78bbf9677c239814dae1041f24f0bbc821db9) @@ -54,6 +54,19 @@ // [id(1), helpstring("method InvokeCommand")] HRESULT InvokeCommand(LPCMINVOKECOMMANDINFO lpici); }; + [ + object, + uuid(317E503A-9D2F-4f42-995E-D314CB9D89B0), + dual, + helpstring("IShellExtControl Interface"), + pointer_default(unique) + ] + interface IShellExtControl : IDispatch + { + [helpstring("Retrieves the extension version information")] + HRESULT GetVersion([out]LONG* plVersion); + }; + [ uuid(68FAFC14-8EB8-4DA1-90EB-6B3D22010505), version(1.0), @@ -80,4 +93,12 @@ { [default] interface IDropMenuExt; }; + [ + uuid(3D855ACA-8274-4f1f-94E9-6BEF4FC2A2AF), + helpstring("CShellExtControl Class") + ] + coclass CShellExtControl + { + [default] interface IShellExtControl; + }; }; Index: src/chext/chext.rc =================================================================== diff -u -N -r7c612814a43eb389fa1ac27ccd8f621fd4ff37e8 -rd3f78bbf9677c239814dae1041f24f0bbc821db9 --- src/chext/chext.rc (.../chext.rc) (revision 7c612814a43eb389fa1ac27ccd8f621fd4ff37e8) +++ src/chext/chext.rc (.../chext.rc) (revision d3f78bbf9677c239814dae1041f24f0bbc821db9) @@ -59,6 +59,7 @@ IDR_MENUEXT REGISTRY "MenuExt.rgs" IDR_DROPMENUEXT REGISTRY "DropMenuExt.rgs" +IDR_SHELLEXTCONTROL REGISTRY "ShellExtControl.rgs" #endif // Polish resources ///////////////////////////////////////////////////////////////////////////// Index: src/chext/chext.vc90.vcproj =================================================================== diff -u -N -r9541872ea40cb4a5418162e61090ebaa3d7e2121 -rd3f78bbf9677c239814dae1041f24f0bbc821db9 --- src/chext/chext.vc90.vcproj (.../chext.vc90.vcproj) (revision 9541872ea40cb4a5418162e61090ebaa3d7e2121) +++ src/chext/chext.vc90.vcproj (.../chext.vc90.vcproj) (revision d3f78bbf9677c239814dae1041f24f0bbc821db9) @@ -502,6 +502,10 @@ > + + + + @@ -631,6 +639,10 @@ RelativePath="MenuExt.rgs" > + + Index: src/chext/resource.h =================================================================== diff -u -N -r47da0c5883b1bf97972b1bcd3dc70b2d64024969 -rd3f78bbf9677c239814dae1041f24f0bbc821db9 --- src/chext/resource.h (.../resource.h) (revision 47da0c5883b1bf97972b1bcd3dc70b2d64024969) +++ src/chext/resource.h (.../resource.h) (revision d3f78bbf9677c239814dae1041f24f0bbc821db9) @@ -14,6 +14,7 @@ #define IDS_PASTEBYCHSPECDESC_STRING 10 #define IDR_MENUEXT 102 #define IDR_DROPMENUEXT 103 +#define IDR_SHELLEXTCONTROL 104 // Next default values for new objects //