ReactOS  0.4.15-dev-1177-g6cb3b62
drvdefext.h
Go to the documentation of this file.
1 /*
2  * Provides default drive shell extension
3  *
4  * Copyright 2012 Rafal Harabien
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #ifndef _DRV_DEF_EXT_H_
22 #define _DRV_DEF_EXT_H_
23 
24 class CDrvDefExt :
25  public CComCoClass<CDrvDefExt, &CLSID_ShellDrvDefExt>,
26  public CComObjectRootEx<CComMultiThreadModelNoCS>,
27  public IShellExtInit,
28  public IContextMenu,
29  public IShellPropSheetExt,
30  public IObjectWithSite
31 {
32 private:
33  VOID PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT pDrawItem);
34  VOID InitGeneralPage(HWND hwndDlg);
38 
41 
42 public:
43  CDrvDefExt();
44  ~CDrvDefExt();
45 
46  // IShellExtInit
47  virtual HRESULT STDMETHODCALLTYPE Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pDataObj, HKEY hkeyProgID);
48 
49  // IContextMenu
50  virtual HRESULT WINAPI QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
52  virtual HRESULT WINAPI GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax);
53 
54  // IShellPropSheetExt
56  virtual HRESULT WINAPI ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam);
57 
58  // IObjectWithSite
59  virtual HRESULT WINAPI SetSite(IUnknown *punk);
60  virtual HRESULT WINAPI GetSite(REFIID iid, void **ppvSite);
61 
64 
66 
68  COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit)
69  COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu)
70  COM_INTERFACE_ENTRY_IID(IID_IShellPropSheetExt, IShellPropSheetExt)
73 };
74 
75 #endif /* _DRV_DEF_EXT_H_ */
static INT_PTR CALLBACK ExtraPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drvdefext.cpp:581
#define REFIID
Definition: guiddef.h:118
static HMENU hmenu
Definition: win.c:66
static INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drvdefext.cpp:492
virtual HRESULT WINAPI GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax)
Definition: drvdefext.cpp:727
#define CALLBACK
Definition: compat.h:35
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:611
virtual HRESULT WINAPI ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam)
Definition: drvdefext.cpp:769
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:327
UINT_PTR WPARAM
Definition: windef.h:207
UINT uFlags
Definition: api.c:59
int32_t INT_PTR
Definition: typedefs.h:64
char * LPSTR
Definition: xmlstorage.h:182
virtual HRESULT WINAPI SetSite(IUnknown *punk)
Definition: drvdefext.cpp:776
WPARAM wParam
Definition: combotst.c:138
LONG_PTR LPARAM
Definition: windef.h:208
VOID InitGeneralPage(HWND hwndDlg)
Definition: drvdefext.cpp:381
#define IDR_DRVDEFEXT
Definition: shresdef.h:841
UINT m_FreeSpacePerc
Definition: drvdefext.h:40
VOID PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT pDrawItem)
Definition: drvdefext.cpp:193
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define MAX_PATH
Definition: compat.h:34
#define WINAPI
Definition: msvc.h:6
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
const IID IID_IObjectWithSite
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
UINT cchMax
WCHAR m_wszDrive[MAX_PATH]
Definition: drvdefext.h:39
virtual HRESULT WINAPI AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
Definition: drvdefext.cpp:734
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:605
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
unsigned int UINT
Definition: ndis.h:50
virtual HRESULT WINAPI GetSite(REFIID iid, void **ppvSite)
Definition: drvdefext.cpp:783
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
Definition: drvdefext.cpp:720
virtual HRESULT STDMETHODCALLTYPE Initialize(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pDataObj, HKEY hkeyProgID)
Definition: drvdefext.cpp:678
#define END_COM_MAP()
Definition: atlcom.h:552
virtual HRESULT WINAPI QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
Definition: drvdefext.cpp:713
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
LPARAM lParam
Definition: combotst.c:139
static INT_PTR CALLBACK HardwarePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drvdefext.cpp:643