Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygennewmenu.h
Go to the documentation of this file.
00001 /* 00002 * provides new shell item service 00003 * 00004 * Copyright 2007 Johannes Anderwald (janderwald@reactos.org) 00005 * Copyright 2009 Andrew Hill 00006 * Copyright 2012 Rafal Harabien 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public 00010 * License as published by the Free Software Foundation; either 00011 * version 2.1 of the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00021 */ 00022 00023 #ifndef _SHV_ITEM_NEW_H_ 00024 #define _SHV_ITEM_NEW_H_ 00025 00026 class CNewMenu : 00027 public CComCoClass<CNewMenu, &CLSID_NewMenu>, 00028 public CComObjectRootEx<CComMultiThreadModelNoCS>, 00029 public IObjectWithSite, 00030 public IContextMenu2, 00031 public IShellExtInit 00032 { 00033 private: 00034 enum SHELLNEW_TYPE 00035 { 00036 SHELLNEW_TYPE_INVALID = -1, 00037 SHELLNEW_TYPE_COMMAND = 1, 00038 SHELLNEW_TYPE_DATA = 2, 00039 SHELLNEW_TYPE_FILENAME = 4, 00040 SHELLNEW_TYPE_NULLFILE = 8 00041 }; 00042 00043 struct SHELLNEW_ITEM 00044 { 00045 SHELLNEW_TYPE Type; 00046 LPWSTR pwszExt; 00047 PBYTE pData; 00048 ULONG cbData; 00049 LPWSTR pwszDesc; 00050 HBITMAP hBitmap; 00051 SHELLNEW_ITEM *pNext; 00052 }; 00053 00054 LPWSTR m_wszPath; 00055 SHELLNEW_ITEM *m_pItems; 00056 SHELLNEW_ITEM *m_pLinkItem; 00057 IUnknown *m_pSite; 00058 HMENU m_hSubMenu; 00059 HBITMAP m_hbmFolder, m_hbmLink; 00060 00061 SHELLNEW_ITEM *LoadItem(LPCWSTR pwszExt); 00062 void UnloadItem(SHELLNEW_ITEM *pItem); 00063 void UnloadAllItems(); 00064 BOOL LoadAllItems(); 00065 UINT InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu); 00066 SHELLNEW_ITEM *FindItemFromIdOffset(UINT IdOffset); 00067 HRESULT CreateNewFolder(IShellView *psv); 00068 HRESULT CreateNewItem(SHELLNEW_ITEM *pItem, LPCMINVOKECOMMANDINFO lpcmi, IShellView *psv); 00069 00070 public: 00071 CNewMenu(); 00072 ~CNewMenu(); 00073 00074 // IObjectWithSite 00075 virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite); 00076 virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, void **ppvSite); 00077 00078 // IContextMenu 00079 virtual HRESULT WINAPI QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); 00080 virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi); 00081 virtual HRESULT WINAPI GetCommandString(UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen); 00082 00083 // IContextMenu2 00084 virtual HRESULT WINAPI HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam); 00085 00086 // IShellExtInit 00087 virtual HRESULT STDMETHODCALLTYPE Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID); 00088 00089 DECLARE_REGISTRY_RESOURCEID(IDR_NEWMENU) 00090 DECLARE_NOT_AGGREGATABLE(CNewMenu) 00091 00092 DECLARE_PROTECT_FINAL_CONSTRUCT() 00093 00094 BEGIN_COM_MAP(CNewMenu) 00095 COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite) 00096 COM_INTERFACE_ENTRY_IID(IID_IContextMenu2, IContextMenu2) 00097 COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu) 00098 COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit) 00099 END_COM_MAP() 00100 }; 00101 00102 #endif // _SHV_ITEM_NEW_H_ Generated on Sun May 27 2012 04:26:23 for ReactOS by
1.7.6.1
|