2 * Open With Context Menu extension
4 * Copyright 2007 Johannes Anderwald <johannes.anderwald@reactos.org>
5 * Copyright 2009 Andrew Hill
6 * Copyright 2012 Rafal Harabien
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #ifndef _SHE_OCMENU_H_
24 #define _SHE_OCMENU_H_
29 public CComCoClass
<COpenWithMenu
, &CLSID_OpenWithMenu
>,
30 public CComObjectRootEx
<CComMultiThreadModelNoCS
>,
35 UINT m_idCmdFirst
, m_idCmdLast
;
36 WCHAR m_wszPath
[MAX_PATH
];
38 COpenWithList
*m_pAppList
;
40 HBITMAP
IconToBitmap(HICON hIcon
);
41 VOID
AddChooseProgramItem();
42 VOID
AddApp(PVOID pApp
);
49 virtual HRESULT WINAPI
QueryContextMenu(HMENU hMenu
, UINT indexMenu
, UINT idCmdFirst
, UINT idCmdLast
, UINT uFlags
);
50 virtual HRESULT WINAPI
InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi
);
51 virtual HRESULT WINAPI
GetCommandString(UINT_PTR idCommand
, UINT uFlags
, UINT
*lpReserved
, LPSTR lpszName
, UINT uMaxNameLen
);
54 virtual HRESULT WINAPI
HandleMenuMsg(UINT uMsg
, WPARAM wParam
, LPARAM lParam
);
57 virtual HRESULT STDMETHODCALLTYPE
Initialize(LPCITEMIDLIST pidlFolder
, IDataObject
*pdtobj
, HKEY hkeyProgID
);
59 DECLARE_REGISTRY_RESOURCEID(IDR_OPENWITHMENU
)
60 DECLARE_NOT_AGGREGATABLE(COpenWithMenu
)
62 DECLARE_PROTECT_FINAL_CONSTRUCT()
64 BEGIN_COM_MAP(COpenWithMenu
)
65 COM_INTERFACE_ENTRY_IID(IID_IContextMenu2
, IContextMenu2
)
66 COM_INTERFACE_ENTRY_IID(IID_IContextMenu
, IContextMenu
)
67 COM_INTERFACE_ENTRY_IID(IID_IShellExtInit
, IShellExtInit
)
71 #endif /* _SHE_OCMENU_H_ */