Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

280 lines
7.9 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. nwshext.h
  5. Abstract:
  6. All C++ classes used in implementing shell extensions.
  7. Author:
  8. Yi-Hsin Sung (yihsins) 20-Oct-1995
  9. Revision History:
  10. --*/
  11. #ifndef _NWSHEXT_H_
  12. #define _NWSHEXT_H_
  13. BOOL
  14. GetNetResourceFromShell(
  15. LPDATAOBJECT pDataObj,
  16. LPNETRESOURCE pBuffer,
  17. UINT dwBufferSize
  18. );
  19. /******************************************************************************/
  20. // this class factory object creates context menu handlers for netware objects
  21. class CNWObjContextMenuClassFactory : public IClassFactory
  22. {
  23. protected:
  24. ULONG _cRef;
  25. public:
  26. CNWObjContextMenuClassFactory();
  27. ~CNWObjContextMenuClassFactory();
  28. // IUnknown members
  29. STDMETHODIMP QueryInterface( REFIID, LPVOID FAR *);
  30. STDMETHODIMP_(ULONG) AddRef();
  31. STDMETHODIMP_(ULONG) Release();
  32. // IClassFactory members
  33. STDMETHODIMP CreateInstance( LPUNKNOWN, REFIID, LPVOID FAR *);
  34. STDMETHODIMP LockServer( BOOL);
  35. };
  36. typedef CNWObjContextMenuClassFactory *LPCNWOBJCONTEXTMENUCLASSFACTORY;
  37. typedef struct _NWMENUITEM
  38. {
  39. UINT idResourceString;
  40. UINT idCommand;
  41. } NWMENUITEM, *LPNWMENUITEM;
  42. // this is the actual context menu handler for netware objects
  43. class CNWObjContextMenu : public IContextMenu,
  44. IShellExtInit,
  45. IShellPropSheetExt
  46. {
  47. protected:
  48. ULONG _cRef;
  49. LPDATAOBJECT _pDataObj;
  50. NWMENUITEM *_pIdTable;
  51. BYTE _buffer[MAX_ONE_NETRES_SIZE];
  52. public:
  53. BOOL _fGotClusterInfo;
  54. DWORD _dwTotal;
  55. DWORD _dwFree;
  56. DWORD *_paHelpIds;
  57. CNWObjContextMenu();
  58. ~CNWObjContextMenu();
  59. // IUnknown members
  60. STDMETHODIMP QueryInterface( REFIID, LPVOID FAR *);
  61. STDMETHODIMP_(ULONG) AddRef();
  62. STDMETHODIMP_(ULONG) Release();
  63. // IShellContextMenu members
  64. STDMETHODIMP QueryContextMenu( HMENU hMenu,
  65. UINT indexMenu,
  66. UINT idCmdFirst,
  67. UINT idCmdLast,
  68. UINT uFlags);
  69. STDMETHODIMP InvokeCommand( LPCMINVOKECOMMANDINFO lpcmi);
  70. STDMETHODIMP GetCommandString( UINT_PTR idCmd,
  71. UINT uFlags,
  72. UINT FAR *reserved,
  73. LPSTR pszName,
  74. UINT cchMax);
  75. // IShellExtInit methods
  76. STDMETHODIMP Initialize( LPCITEMIDLIST pIDFolder,
  77. LPDATAOBJECT pDataObj,
  78. HKEY hKeyID);
  79. // IShellPropSheetExt methods
  80. STDMETHODIMP AddPages( LPFNADDPROPSHEETPAGE lpfnAddPage,
  81. LPARAM lParam);
  82. STDMETHODIMP ReplacePage( UINT uPageID,
  83. LPFNADDPROPSHEETPAGE lpfnReplaceWith,
  84. LPARAM lParam);
  85. VOID FillAndAddPage( LPFNADDPROPSHEETPAGE lpfnAddPage,
  86. LPARAM lParam,
  87. DLGPROC pfnDlgProc,
  88. LPWSTR pszTemplate );
  89. // Other misc methods
  90. LPNETRESOURCE QueryNetResource()
  91. { return ( LPNETRESOURCE ) _buffer; }
  92. };
  93. typedef CNWObjContextMenu *LPCNWOBJCONTEXTMENU;
  94. /******************************************************************************/
  95. // this class factory object creates context menu handlers for netware folders
  96. class CNWFldContextMenuClassFactory : public IClassFactory
  97. {
  98. protected:
  99. ULONG _cRef;
  100. public:
  101. CNWFldContextMenuClassFactory();
  102. ~CNWFldContextMenuClassFactory();
  103. // IUnknown members
  104. STDMETHODIMP QueryInterface( REFIID, LPVOID FAR *);
  105. STDMETHODIMP_(ULONG) AddRef();
  106. STDMETHODIMP_(ULONG) Release();
  107. // IClassFactory members
  108. STDMETHODIMP CreateInstance( LPUNKNOWN, REFIID, LPVOID FAR *);
  109. STDMETHODIMP LockServer( BOOL);
  110. };
  111. typedef CNWFldContextMenuClassFactory *LPCNWFLDCONTEXTMENUCLASSFACTORY;
  112. // this is the actual context menu handler for netware objects
  113. class CNWFldContextMenu : public IContextMenu,
  114. IShellExtInit
  115. {
  116. protected:
  117. ULONG _cRef;
  118. LPDATAOBJECT _pDataObj;
  119. BYTE _buffer[MAX_ONE_NETRES_SIZE];
  120. public:
  121. CNWFldContextMenu();
  122. ~CNWFldContextMenu();
  123. // IUnknown members
  124. STDMETHODIMP QueryInterface( REFIID, LPVOID FAR *);
  125. STDMETHODIMP_(ULONG) AddRef();
  126. STDMETHODIMP_(ULONG) Release();
  127. // IShellContextMenu members
  128. STDMETHODIMP QueryContextMenu( HMENU hMenu,
  129. UINT indexMenu,
  130. UINT idCmdFirst,
  131. UINT idCmdLast,
  132. UINT uFlags);
  133. STDMETHODIMP InvokeCommand( LPCMINVOKECOMMANDINFO lpcmi);
  134. STDMETHODIMP GetCommandString( UINT_PTR idCmd,
  135. UINT uFlags,
  136. UINT FAR *reserved,
  137. LPSTR pszName,
  138. UINT cchMax);
  139. // IShellExtInit methods
  140. STDMETHODIMP Initialize( LPCITEMIDLIST pIDFolder,
  141. LPDATAOBJECT pDataObj,
  142. HKEY hKeyID);
  143. BOOL IsNetWareObject( VOID );
  144. HRESULT GetFSObject( LPWSTR pszPath, UINT cbMaxPath );
  145. };
  146. typedef CNWFldContextMenu *LPCNWFLDCONTEXTMENU;
  147. // this class factory object creates context menu handlers
  148. // for Network Neighborhood
  149. class CNWHoodContextMenuClassFactory : public IClassFactory
  150. {
  151. protected:
  152. ULONG _cRef;
  153. public:
  154. CNWHoodContextMenuClassFactory();
  155. ~CNWHoodContextMenuClassFactory();
  156. // IUnknown members
  157. STDMETHODIMP QueryInterface( REFIID, LPVOID FAR *);
  158. STDMETHODIMP_(ULONG) AddRef();
  159. STDMETHODIMP_(ULONG) Release();
  160. // IClassFactory members
  161. STDMETHODIMP CreateInstance( LPUNKNOWN, REFIID, LPVOID FAR *);
  162. STDMETHODIMP LockServer( BOOL);
  163. };
  164. typedef CNWHoodContextMenuClassFactory *LPCNWHOODCONTEXTMENUCLASSFACTORY;
  165. // this is the actual context menu handler for network neighborhood
  166. class CNWHoodContextMenu : public IContextMenu,
  167. IShellExtInit
  168. {
  169. protected:
  170. ULONG _cRef;
  171. LPDATAOBJECT _pDataObj;
  172. public:
  173. CNWHoodContextMenu();
  174. ~CNWHoodContextMenu();
  175. // IUnknown members
  176. STDMETHODIMP QueryInterface( REFIID, LPVOID FAR *);
  177. STDMETHODIMP_(ULONG) AddRef();
  178. STDMETHODIMP_(ULONG) Release();
  179. // IShellContextMenu members
  180. STDMETHODIMP QueryContextMenu( HMENU hMenu,
  181. UINT indexMenu,
  182. UINT idCmdFirst,
  183. UINT idCmdLast,
  184. UINT uFlags);
  185. STDMETHODIMP InvokeCommand( LPCMINVOKECOMMANDINFO lpcmi);
  186. STDMETHODIMP GetCommandString( UINT_PTR idCmd,
  187. UINT uFlags,
  188. UINT FAR *reserved,
  189. LPSTR pszName,
  190. UINT cchMax);
  191. // IShellExtInit methods
  192. STDMETHODIMP Initialize( LPCITEMIDLIST pIDFolder,
  193. LPDATAOBJECT pDataObj,
  194. HKEY hKeyID);
  195. };
  196. typedef CNWHoodContextMenu *LPCNWHOODCONTEXTMENU;
  197. #endif // _NWSHEXT_H_