OSDN Git Service

Updated comments for ShellExtension: added comment about used registry values etc
[winmerge-jp/winmerge-jp.git] / ShellExtension / WinMergeShell.h
1 /////////////////////////////////////////////////////////////////////////////
2 // WinMergeShell.h : declaration file
3 //
4 /////////////////////////////////////////////////////////////////////////////
5 //    License (GPLv2+):
6 //    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
7 //    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.
8 //    You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
9 /////////////////////////////////////////////////////////////////////////////
10 // Look at http://www.codeproject.com/shell/ for excellent guide
11 // to Windows Shell programming by Michael Dunn.
12 // 
13 // $Id$
14
15 #ifndef __WINMERGESHELL_H_
16 #define __WINMERGESHELL_H_
17
18 #include <shlobj.h>
19 #include <comdef.h>
20 #include <atlconv.h>  // for ATL string conversion macros
21 #include "resource.h"       // main symbols
22
23 /////////////////////////////////////////////////////////////////////////////
24 // CWinMergeShell
25 class ATL_NO_VTABLE CWinMergeShell : 
26         public CComObjectRootEx<CComSingleThreadModel>,
27         public CComCoClass<CWinMergeShell, &CLSID_WinMergeShell>,
28         public IDispatchImpl<IWinMergeShell, &IID_IWinMergeShell, &LIBID_SHELLEXTENSIONLib>,
29         public IShellExtInit,
30         public IContextMenu
31 {
32 public:
33         CWinMergeShell();
34
35 DECLARE_REGISTRY_RESOURCEID(IDR_WINMERGESHELL)
36
37 DECLARE_PROTECT_FINAL_CONSTRUCT()
38
39 BEGIN_COM_MAP(CWinMergeShell)
40         COM_INTERFACE_ENTRY(IWinMergeShell)
41         COM_INTERFACE_ENTRY(IDispatch)
42         COM_INTERFACE_ENTRY(IShellExtInit)
43         COM_INTERFACE_ENTRY(IContextMenu)
44 END_COM_MAP()
45
46 // IWinMergeShell
47 protected:
48     CString m_strPaths[2];
49         HBITMAP m_hMergeBmp;
50         UINT    m_nSelectedItems;
51
52         BOOL GetWinMergeDir(CString &strDir);
53
54 public:
55     // IShellExtInit
56     STDMETHOD(Initialize)(LPCITEMIDLIST, LPDATAOBJECT, HKEY);
57
58     // IContextMenu
59     STDMETHOD(GetCommandString)(UINT, UINT, UINT*, LPSTR, UINT);
60     STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO);
61     STDMETHOD(QueryContextMenu)(HMENU, UINT, UINT, UINT, UINT);
62 };
63
64 #endif //__WINMERGESHELL_H_