Leaked source code of windows server 2003
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.

314 lines
10 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Copyright (c) Microsoft Corporation 1991-1994
  4. //
  5. // File: shlobj.h
  6. //
  7. // Definitions of IShellUI interface. Eventually this file should be merged
  8. // into COMMUI.H.
  9. //
  10. // History:
  11. // 12-30-92 SatoNa Created.
  12. // 01-06-93 SatoNa Added this comment block.
  13. // 01-13-93 SatoNa Added DragFilesOver & DropFiles
  14. // 01-27-93 SatoNa Created by combining shellui.h and handler.h
  15. // 01-28-93 SatoNa OLE 2.0 beta 2
  16. // 03-12-93 SatoNa Removed IFileDropTarget (we use IDropTarget)
  17. //
  18. //---------------------------------------------------------------------------
  19. #ifndef _SHLOBJ_H_
  20. #define _SHLOBJ_H_
  21. #include <ole2.h>
  22. #include <prsht.h>
  23. #include <shell2.h>
  24. #ifndef INITGUID
  25. #include <shlguid.h>
  26. #endif
  27. typedef void const FAR* LPCVOID;
  28. //----------------------------------------------------------------------------
  29. //
  30. // Shell Extension API
  31. //
  32. //----------------------------------------------------------------------------
  33. //
  34. // Task allocator
  35. //
  36. // All the shell extensions MUST use this allocator when they allocate
  37. // or free memory objects that are passed across any shell interface
  38. // boundary.
  39. //
  40. // REVIEW:
  41. // It would be really nice if we can guarantee that shell's task
  42. // allocator and OLE's task allocator is always the same. it is,
  43. // however, not so easy to do, because:
  44. //
  45. // 1. We don't want to load COMPOBJ unless a shell extension DLL
  46. // loads it. We need to be notified when COMPOBJ is loaded.
  47. // 2. We need to register our task allocator to the COMPOBJ
  48. // if one of shell extension DLLs loads it into the shell
  49. // process.
  50. // 3. We need to get the task allocator from the COMPOBJ, if
  51. // the shell dll is loaded by non-shell process that registers
  52. // the task allocator to the COMPOBJ.
  53. //
  54. LPVOID WINAPI SHAlloc(ULONG cb);
  55. LPVOID WINAPI SHRealloc(LPVOID pv, ULONG cbNew);
  56. ULONG WINAPI SHGetSize(LPVOID pv);
  57. void WINAPI SHFree(LPVOID pv);
  58. //
  59. // Helper macro definitions
  60. //
  61. #define S_BOOL(f) MAKE_SCODE(SEVERITY_SUCCESS, FACILITY_NULL, f)
  62. //----------------------------------------------------------------------------
  63. //
  64. // Interface: IContextMenu
  65. //
  66. // History:
  67. // 02-24-93 SatoNa Created.
  68. //
  69. //----------------------------------------------------------------------------
  70. #undef INTERFACE
  71. #define INTERFACE IContextMenu
  72. #define CMF_DEFAULTONLY 0x00000001
  73. DECLARE_INTERFACE_(IContextMenu, IUnknown)
  74. {
  75. // *** IUnknown methods ***
  76. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  77. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  78. STDMETHOD_(ULONG,Release) (THIS) PURE;
  79. STDMETHOD(QueryContextMenu)(THIS_
  80. HMENU hmenu,
  81. UINT indexMenu,
  82. UINT idCmdFirst,
  83. UINT idCmdLast,
  84. UINT uFlags) PURE;
  85. STDMETHOD(InvokeCommand)(THIS_
  86. HWND hwndParent,
  87. LPCSTR pszWorkingDir,
  88. LPCSTR pszCmd,
  89. LPCSTR pszParam,
  90. int iShowCmd) PURE;
  91. STDMETHOD(GetCommandString)(THIS_
  92. UINT idCmd,
  93. UINT wReserved,
  94. UINT FAR * pwReserved,
  95. LPSTR pszName,
  96. UINT cchMax) PURE;
  97. };
  98. typedef IContextMenu FAR* LPCONTEXTMENU;
  99. // GetIconLocation() input flags
  100. #define GIL_OPENICON 0x0001 // allows containers to specify an "open" look
  101. // return FALSE to get the standard look
  102. // GetIconLocation() return flags
  103. #define GIL_SIMULATEDOC 0x0001 // simulate this document icon for this
  104. #define GIL_PERINSTANCE 0x0002 // icons from this class are per instance (each file has its own)
  105. #define GIL_PERCLASS 0x0004 // icons from this class per class (shared for all files of this type)
  106. #include <fcext.h> // Browser extension interfaces are defined in FCEXT.H
  107. //==========================================================================
  108. // Helper macro for C programmers
  109. //#ifdef WIN32
  110. #define LPTONP(p) (p)
  111. //#else
  112. //#define LPTONP(p) OFFSETOF(p)
  113. //#endif // WIN32
  114. #define _IOffset(class, itf) ((UINT)&(((class *)0)->itf))
  115. #define IToClass(class, itf, pitf) ((class FAR *)(((LPSTR)pitf)-_IOffset(class, itf)))
  116. #define IToClassN(class, itf, pitf) ((class *)LPTONP(((LPSTR)pitf)-_IOffset(class, itf)))
  117. //===========================================================================
  118. HRESULT STDAPICALLTYPE Link_CreateInstance(LPUNKNOWN punkOuter, REFIID riid, LPVOID FAR* ppvOut);
  119. //
  120. // Helper functions for component object DLLs
  121. //
  122. //===========================================================================
  123. typedef HRESULT (CALLBACK FAR * LPFNCREATEINSTANCE)(
  124. LPUNKNOWN pUnkOuter,
  125. REFIID riid,
  126. LPVOID FAR* ppvObject);
  127. STDAPI Shell_CreateDefClassObject(REFIID riid, LPVOID FAR* ppv,
  128. LPFNCREATEINSTANCE lpfn, UINT FAR * pcRefDll,
  129. REFIID riidInstance);
  130. //===========================================================================
  131. //
  132. // Interface: IShellExtInit
  133. //
  134. // This interface is used to initialize shell extension objects.
  135. //
  136. //===========================================================================
  137. #undef INTERFACE
  138. #define INTERFACE IShellExtInit
  139. DECLARE_INTERFACE_(IShellExtInit, IUnknown)
  140. {
  141. // *** IUnknown methods ***
  142. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  143. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  144. STDMETHOD_(ULONG,Release) (THIS) PURE;
  145. // *** IShellExtInit methods ***
  146. STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidlFolder,
  147. LPDATAOBJECT lpdobj, HKEY hkeyProgID) PURE;
  148. };
  149. typedef IShellExtInit FAR* LPSHELLEXTINIT;
  150. #undef INTERFACE
  151. #define INTERFACE IShellPropSheetExt
  152. DECLARE_INTERFACE_(IShellPropSheetExt, IUnknown)
  153. {
  154. // *** IUnknown methods ***
  155. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  156. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  157. STDMETHOD_(ULONG,Release) (THIS) PURE;
  158. // *** IShellPropSheetExt methods ***
  159. STDMETHOD(AddPages)(THIS_ LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam) PURE;
  160. };
  161. typedef IShellPropSheetExt FAR* LPSHELLPROPSHEETEXT;
  162. //===========================================================================
  163. //
  164. // IPersistFolder Interface
  165. //
  166. // This interface is used by the Folder implementation of
  167. // IMoniker::BindToObject when it is initializing a folder object.
  168. //
  169. //===========================================================================
  170. #undef INTERFACE
  171. #define INTERFACE IPersistFolder
  172. DECLARE_INTERFACE_(IPersistFolder, IPersist) // fld
  173. {
  174. // *** IUnknown methods ***
  175. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  176. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  177. STDMETHOD_(ULONG,Release) (THIS) PURE;
  178. // *** IPersist methods ***
  179. STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  180. // *** IPersistFolder methods ***
  181. STDMETHOD(Initialize) (THIS_
  182. LPCITEMIDLIST pidl) PURE;
  183. };
  184. typedef IPersistFolder FAR* LPPERSISTFOLDER;
  185. //
  186. // IExtractIcon interface
  187. //
  188. #undef INTERFACE
  189. #define INTERFACE IExtractIcon
  190. DECLARE_INTERFACE_(IExtractIcon, IUnknown) // exic
  191. {
  192. // *** IUnknown methods ***
  193. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  194. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  195. STDMETHOD_(ULONG,Release) (THIS) PURE;
  196. // *** IExtractIcon methods ***
  197. STDMETHOD(GetIconLocation)(THIS_
  198. UINT uFlags,
  199. LPSTR szIconFile,
  200. UINT cchMax,
  201. int FAR * piIndex,
  202. UINT FAR * pwFlags) PURE;
  203. STDMETHOD(ExtractIcon)(THIS_
  204. LPCSTR pszFile,
  205. UINT nIconIndex,
  206. HICON FAR *phiconLarge,
  207. HICON FAR *phiconSmall,
  208. UINT nIcons) PURE;
  209. };
  210. typedef IExtractIcon FAR* LPEXTRACTICON;
  211. //===========================================================================
  212. // Network resource array handle
  213. //===========================================================================
  214. typedef HANDLE HNRES;
  215. typedef struct _NETRESOURCE FAR *LPNETRESOURCE;
  216. UINT WINAPI SHGetNetResource(HNRES hnres, UINT iItem, LPNETRESOURCE pnres, UINT cbMax);
  217. //
  218. // IShellLink Interface
  219. //
  220. #undef INTERFACE
  221. #define INTERFACE IShellLink
  222. DECLARE_INTERFACE_(IShellLink, IUnknown) // sl
  223. {
  224. // *** IUnknown methods ***
  225. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  226. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  227. STDMETHOD_(ULONG,Release) (THIS) PURE;
  228. STDMETHOD(IsLinkToFile)(THIS) PURE;
  229. STDMETHOD(GetSubject)(THIS_ LPSTR pszFile, int cchMaxPath, WIN32_FIND_DATA *pfd, UINT fFlags) PURE;
  230. STDMETHOD(SetSubject)(THIS_ LPCSTR pszFile, const WIN32_FIND_DATA *pfd) PURE;
  231. STDMETHOD(GetWorkingDirectory)(THIS_ LPSTR pszDir, int cchMaxPath) PURE;
  232. STDMETHOD(SetWorkingDirectory)(THIS_ LPCSTR pszDir) PURE;
  233. STDMETHOD(GetArguments)(THIS_ LPSTR pszArgs, int cchMaxPath) PURE;
  234. STDMETHOD(SetArguments)(THIS_ LPCSTR pszArgs) PURE;
  235. STDMETHOD(GetHotkey)(THIS_ WORD *pwHotkey) PURE;
  236. STDMETHOD(SetHotkey)(THIS_ WORD wHotkey) PURE;
  237. STDMETHOD(GetShowCmd)(THIS_ int *piShowCmd) PURE;
  238. STDMETHOD(SetShowCmd)(THIS_ int iShowCmd) PURE;
  239. STDMETHOD(GetIconLocation)(THIS_ LPSTR pszIconPath, int cchIconPath, int *piIcon) PURE;
  240. STDMETHOD(SetIconLocation)(THIS_ LPCSTR pszIconPath, int iIcon) PURE;
  241. STDMETHOD(Resolve)(THIS_ HWND hwnd, UINT fFlags) PURE;
  242. STDMETHOD(Update)(THIS_ UINT fFlags) PURE;
  243. };
  244. #endif // _SHELLUI_H_