HostContextMenu.h

Go to the documentation of this file.
00001 /*  Declaration of the host object context menu handler
00002 
00003     Copyright (C) 2007  Alexander Lamaison <awl03@doc.ic.ac.uk>
00004 
00005     This program is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation; either version 2 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License along
00016     with this program; if not, write to the Free Software Foundation, Inc.,
00017     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018 */
00019 
00020 #ifndef HOSTCONTEXTMENU_H
00021 #define HOSTCONTEXTMENU_H
00022 
00023 #if _MSC_VER > 1000
00024 #pragma once
00025 #endif // _MSC_VER > 1000
00026 
00027 #include "stdafx.h"
00028 #include "resource.h"       // main symbols
00029 
00030 // IHostContextMenu
00031 [
00032         object,
00033         uuid("b816a83f-5022-11dc-9153-0090f5284f85"),
00034         helpstring("IHostContextMenu Interface"),
00035         pointer_default(unique)
00036 ]
00037 __interface IHostContextMenu : IUnknown
00038 {
00039 };
00040 
00041 
00042 // CHostContextMenu
00043 [
00044         coclass,
00045         default(IHostContextMenu),
00046         threading(apartment),
00047         vi_progid("Swish.HostContextMenu"),
00048         progid("Swish.HostContextMenu.1"),
00049         version(1.0),
00050         uuid("b816a840-5022-11dc-9153-0090f5284f85"),
00051         helpstring("HostContextMenu Class")
00052 ]
00053 class ATL_NO_VTABLE CHostContextMenu :
00054         public IHostContextMenu,
00055         public IContextMenu
00056 {
00057 public:
00058         CHostContextMenu()
00059         {
00060         }
00061 
00062         DECLARE_PROTECT_FINAL_CONSTRUCT()
00063         HRESULT FinalConstruct()
00064         {
00065                 return S_OK;
00066         }
00067         void FinalRelease()
00068         {
00069         }
00070 
00071         STDMETHOD(Initialize) ( PCIDLIST_ABSOLUTE pidl );
00072 
00073         // IContextMenu
00074         IFACEMETHODIMP QueryContextMenu( HMENU hmenu, UINT indexMenu, 
00075                                                                          UINT idCmdFirst, UINT idCmdLast,
00076                                                                          UINT uFlags );        
00077         IFACEMETHODIMP InvokeCommand( CMINVOKECOMMANDINFO *pici );
00078     IFACEMETHODIMP GetCommandString( UINT_PTR idCmd, UINT uType, 
00079                                                                          UINT *pReserved, LPSTR pszName,
00080                                                                          UINT cchMax );
00081 
00082 private:
00083         // Menu command ID offsets for host connection objects context menu
00084         enum MENUOFFSET
00085         {
00086                 MENUOFFSET_NULL = 0,
00087                 MENUOFFSET_FIRST = 1,
00088                 MENUOFFSET_CONNECT = MENUOFFSET_FIRST,
00089                 MENUOFFSET_LAST = MENUOFFSET_CONNECT
00090         };
00091 
00092         // Absolute PIDL to this menu's corresponding remote folder object
00093         // Used to execute ShellExecuteEx on
00094         PIDLIST_ABSOLUTE m_pidl;
00095 };
00096 
00097 #endif // HOSTCONTEXTMENU_H

Generated on Mon Nov 12 22:43:52 2007 for Swish by  doxygen 1.5.3