Lhaz
ShellExt.h
[詳解]
1 /*
2  PTS Sample Files
3 
4  NAME -> ShellExt.h
5  PURPOSE -> インターフェイス関係クラスの宣言
6 
7  Copyright 1999-2000 Daisuke Goto.All rights reserved.
8 
9  http://www.fx.sakura.ne.jp/‾dmgoto/
10 */
11 
12 #include <vector>
13 #include "StdAfx.h"
14 #include "lhazdll.h"
15 #include "mystr.h"
16 
17 using namespace std;
18 
19 #ifndef _SHELLEXT_H
20 #define _SHELLEXT_H
21 
22 // クラスファクトリの作成 (IClassFactoryインターフェイスを継承する)
23 class CShellExtClassFactory : public IClassFactory
24 {
25 protected:
26  // 参照カウント
27  ULONG m_cRef;
28 public:
29  // コンストラクタ・デストラクタ
30  CShellExtClassFactory();
31  ‾CShellExtClassFactory();
32 
33  //IUnknown インターフェイスのメソッド
34  STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
35  STDMETHODIMP_(ULONG) AddRef();
36  STDMETHODIMP_(ULONG) Release();
37 
38  //IClassFactory インターフェイスのメソッド
39  STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID, LPVOID FAR *);
40  STDMETHODIMP LockServer(BOOL);
41 
42 };
43 // ポインタ型を宣言
44 typedef CShellExtClassFactory *LPCSHELLEXTCLASSFACTORY;
45 
46 
47 class CShellExtension : public IPersistFile,
48  IShellExtInit,
49  IContextMenu
50 {
51 private:
52  enum { IDM_CONTEXT_VIEW, IDM_CONTEXT_EXT, IDM_CONTEXT_COMP, IDM_DRAG_AND_DROP_EXT, IDM_DRAG_AND_DROP_COMP };
53  //
54  static const TCHAR LHAZCOMPMENU[];
55  static const TCHAR LHAZVIEWMENU[];
56  static const TCHAR LHAZEXTMENU[];
57  static const char LZHHEADER[];
58  static const char SFXHEADER[];
59  static const char SFXZIPHEADER[];
60  static const char SFXCABHEADER[];
61  static const TCHAR LHAZCMD[];
62  static const TCHAR LHAZEXTSW[];
63  static const TCHAR LHAZVIEWSW[];
64  static const TCHAR LHAZCOMPSW[];
65  void GetFileNames(LPDATAOBJECT);
66  bool AllIsArchive;
67  vector<SEFILE> FileNames;
68  TCHAR DestDir[MAX_PATH];
69  MYSTR ExecCmd;
70 
71 protected:
72  ULONG m_cRef; // オブジェクトの参照カウント
73  LPDATAOBJECT m_pDataObj; // エクスプローラから受け取るデータオブジェクト
74 
75  char m_szFile[MAX_PATH+1]; // 扱うファイル名
76 
77 public:
78  CShellExtension();
79  ‾CShellExtension();
80 
81  // IUnknown インターフェイスのメソッド
82  STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
83  STDMETHODIMP_(ULONG) AddRef();
84  STDMETHODIMP_(ULONG) Release();
85 
86  // IPersistFile インターフェイスのメソッド
87  STDMETHODIMP GetClassID(LPCLSID lpClassID);
88  STDMETHODIMP IsDirty();
89  STDMETHODIMP Load(LPCOLESTR lpszFileName, DWORD grfMode);
90  STDMETHODIMP Save(LPCOLESTR lpszFileName, BOOL fRemember);
91  STDMETHODIMP SaveCompleted(LPCOLESTR lpszFileName);
92  STDMETHODIMP GetCurFile(LPOLESTR FAR* lplpszFileName);
93 
94  // IShellExtInit インターフェイスのメソッド
95  STDMETHODIMP Initialize(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj, HKEY hKeyID);
96 
97  // IContextMenu インターフェイスのメソッド
98  STDMETHODIMP QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst,
99  UINT idCmdLast, UINT uFlags);
100  STDMETHODIMP InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi);
101  STDMETHODIMP GetCommandString(UINT_PTR idCmd, UINT uFlags, UINT FAR *reserved,
102  LPSTR pszName, UINT cchMax);
103 
104 };
105 #endif // _SHELLEXT_H
STDMETHODIMP_(ULONG) CShellExtension
Definition: CShellExt.cpp:83
we sometimes make exceptions for this Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally NO WARRANTY BECAUSE THE LIBRARY IS LICENSED FREE OF THERE IS NO WARRANTY FOR THE TO THE EXTENT PERMITTED BY APPLICABLE LAW EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND OR OTHER PARTIES PROVIDE THE LIBRARY AS IS WITHOUT WARRANTY OF ANY EITHER EXPRESSED OR BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU SHOULD THE LIBRARY PROVE YOU ASSUME THE COST OF ALL NECESSARY REPAIR OR CORRECTION IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT OR ANY OTHER PARTY WHO MAY MODIFY AND OR REDISTRIBUTE THE LIBRARY AS PERMITTED BE LIABLE TO YOU FOR INCLUDING ANY INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new and you want it to be of the greatest possible use to the public
Definition: copying.txt:462