1c2c66affSColin Finck /* 2c2c66affSColin Finck * Provides default drive shell extension 3c2c66affSColin Finck * 4c2c66affSColin Finck * Copyright 2012 Rafal Harabien 5c2c66affSColin Finck * 6c2c66affSColin Finck * This library is free software; you can redistribute it and/or 7c2c66affSColin Finck * modify it under the terms of the GNU Lesser General Public 8c2c66affSColin Finck * License as published by the Free Software Foundation; either 9c2c66affSColin Finck * version 2.1 of the License, or (at your option) any later version. 10c2c66affSColin Finck * 11c2c66affSColin Finck * This library is distributed in the hope that it will be useful, 12c2c66affSColin Finck * but WITHOUT ANY WARRANTY; without even the implied warranty of 13c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14c2c66affSColin Finck * Lesser General Public License for more details. 15c2c66affSColin Finck * 16c2c66affSColin Finck * You should have received a copy of the GNU Lesser General Public 17c2c66affSColin Finck * License along with this library; if not, write to the Free Software 18c2c66affSColin Finck * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19c2c66affSColin Finck */ 20c2c66affSColin Finck 21c2c66affSColin Finck #ifndef _DRV_DEF_EXT_H_ 22c2c66affSColin Finck #define _DRV_DEF_EXT_H_ 23c2c66affSColin Finck 24c2c66affSColin Finck class CDrvDefExt : 25c2c66affSColin Finck public CComCoClass<CDrvDefExt, &CLSID_ShellDrvDefExt>, 26c2c66affSColin Finck public CComObjectRootEx<CComMultiThreadModelNoCS>, 27c2c66affSColin Finck public IShellExtInit, 28c2c66affSColin Finck public IContextMenu, 29c2c66affSColin Finck public IShellPropSheetExt, 30c2c66affSColin Finck public IObjectWithSite 31c2c66affSColin Finck { 32c2c66affSColin Finck private: 33c2c66affSColin Finck VOID PaintStaticControls(HWND hwndDlg, LPDRAWITEMSTRUCT pDrawItem); 34c2c66affSColin Finck VOID InitGeneralPage(HWND hwndDlg); 35c2c66affSColin Finck static INT_PTR CALLBACK GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); 36c2c66affSColin Finck static INT_PTR CALLBACK ExtraPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); 37c2c66affSColin Finck static INT_PTR CALLBACK HardwarePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); 38c2c66affSColin Finck 39c2c66affSColin Finck WCHAR m_wszDrive[MAX_PATH]; 40c2c66affSColin Finck UINT m_FreeSpacePerc; 41c2c66affSColin Finck 42c2c66affSColin Finck public: 43c2c66affSColin Finck CDrvDefExt(); 44c2c66affSColin Finck ~CDrvDefExt(); 45c2c66affSColin Finck 46c2c66affSColin Finck // IShellExtInit 47*49b2b1daSKatayama Hirofumi MZ STDMETHOD(Initialize)(PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pDataObj, HKEY hkeyProgID) override; 48c2c66affSColin Finck 49c2c66affSColin Finck // IContextMenu 50*49b2b1daSKatayama Hirofumi MZ STDMETHOD(QueryContextMenu)(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override; 51*49b2b1daSKatayama Hirofumi MZ STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO lpici) override; 52*49b2b1daSKatayama Hirofumi MZ STDMETHOD(GetCommandString)(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax) override; 53c2c66affSColin Finck 54c2c66affSColin Finck // IShellPropSheetExt 55*49b2b1daSKatayama Hirofumi MZ STDMETHOD(AddPages)(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam) override; 56*49b2b1daSKatayama Hirofumi MZ STDMETHOD(ReplacePage)(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam) override; 57c2c66affSColin Finck 58c2c66affSColin Finck // IObjectWithSite 59*49b2b1daSKatayama Hirofumi MZ STDMETHOD(SetSite)(IUnknown *punk) override; 60*49b2b1daSKatayama Hirofumi MZ STDMETHOD(GetSite)(REFIID iid, void **ppvSite) override; 61c2c66affSColin Finck 62c2c66affSColin Finck DECLARE_REGISTRY_RESOURCEID(IDR_DRVDEFEXT) 63c2c66affSColin Finck DECLARE_NOT_AGGREGATABLE(CDrvDefExt) 64c2c66affSColin Finck 65c2c66affSColin Finck DECLARE_PROTECT_FINAL_CONSTRUCT() 66c2c66affSColin Finck 67c2c66affSColin Finck BEGIN_COM_MAP(CDrvDefExt) 68c2c66affSColin Finck COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit) 69c2c66affSColin Finck COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu) 70c2c66affSColin Finck COM_INTERFACE_ENTRY_IID(IID_IShellPropSheetExt, IShellPropSheetExt) 71c2c66affSColin Finck COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite) 72c2c66affSColin Finck END_COM_MAP() 73c2c66affSColin Finck }; 74c2c66affSColin Finck 75c2c66affSColin Finck #endif /* _DRV_DEF_EXT_H_ */ 76