/header/Microsoft SDKs/Windows/v7.0A/Include/ShObjIdl.idl

https://github.com/nihon-tc/Rtest · IDL · 9308 lines · 5974 code · 1376 blank · 1958 comment · 0 complexity · 62f85797d1b45bc1bd80b47fb9025fde MD5 · raw file

  1. //
  2. // Microsoft Windows
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // File: shobjidl.idl
  6. //
  7. // Contents: This interface definition contains shell objects that can be remoted
  8. //
  9. import "objidl.idl";
  10. import "oleidl.idl";
  11. import "oaidl.idl";
  12. import "docobj.idl";
  13. import "shtypes.idl";
  14. import "servprov.idl";
  15. import "comcat.idl"; // for IEnumGUID
  16. import "propidl.idl";
  17. import "prsht.idl";
  18. import "msxml.idl";
  19. import "wtypes.idl";
  20. import "propsys.idl";
  21. import "ObjectArray.idl";
  22. import "StructuredQueryCondition.idl";
  23. cpp_quote("#include <sherrors.h>")
  24. cpp_quote("#ifndef SHSTDAPI")
  25. cpp_quote("#if defined(_SHELL32_)")
  26. cpp_quote("#define SHSTDAPI STDAPI")
  27. cpp_quote("#define SHSTDAPI_(type) STDAPI_(type)")
  28. cpp_quote("#else")
  29. cpp_quote("#define SHSTDAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE")
  30. cpp_quote("#define SHSTDAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE")
  31. cpp_quote("#endif")
  32. cpp_quote("#endif // SHSTDAPI")
  33. cpp_quote("")
  34. cpp_quote("//===========================================================================")
  35. cpp_quote("//")
  36. cpp_quote("// IContextMenu interface")
  37. cpp_quote("//")
  38. cpp_quote("// [OverView]")
  39. cpp_quote("//")
  40. cpp_quote("// The shell uses the IContextMenu interface in following three cases.")
  41. cpp_quote("//")
  42. cpp_quote("// case-1: The shell is loading context menu extensions.")
  43. cpp_quote("//")
  44. cpp_quote("// When the user clicks the right mouse button on an item within the shell's")
  45. cpp_quote("// name space (i.g., file, directory, server, work-group, etc.), it creates")
  46. cpp_quote("// the default context menu for its type, then loads context menu extensions")
  47. cpp_quote("// that are registered for that type (and its base type) so that they can")
  48. cpp_quote("// add extra menu items. Those context menu extensions are registered at")
  49. cpp_quote("// HKCR\{ProgID}\shellex\ContextMenuHandlers.")
  50. cpp_quote("//")
  51. cpp_quote("// case-2: The shell is retrieving a context menu of sub-folders in extended")
  52. cpp_quote("// name-space.")
  53. cpp_quote("//")
  54. cpp_quote("// When the explorer's name space is extended by name space extensions,")
  55. cpp_quote("// the shell calls their IShellFolder::GetUIObjectOf to get the IContextMenu")
  56. cpp_quote("// objects when it creates context menus for folders under those extended")
  57. cpp_quote("// name spaces.")
  58. cpp_quote("//")
  59. cpp_quote("// case-3: The shell is loading non-default drag and drop handler for directories.")
  60. cpp_quote("//")
  61. cpp_quote("// When the user performed a non-default drag and drop onto one of file")
  62. cpp_quote("// system folders (i.e., directories), it loads shell extensions that are")
  63. cpp_quote("// registered at HKCR\{ProgID}\DragDropHandlers.")
  64. cpp_quote("//")
  65. cpp_quote("//")
  66. cpp_quote("// [Member functions]")
  67. cpp_quote("//")
  68. cpp_quote("//")
  69. cpp_quote("// IContextMenu::QueryContextMenu")
  70. cpp_quote("//")
  71. cpp_quote("// This member function may insert one or more menuitems to the specified")
  72. cpp_quote("// menu (hmenu) at the specified location (indexMenu which is never be -1).")
  73. cpp_quote("// The IDs of those menuitem must be in the specified range (idCmdFirst and")
  74. cpp_quote("// idCmdLast). It returns the maximum menuitem ID offset (ushort) in the")
  75. cpp_quote("// 'code' field (low word) of the scode.")
  76. cpp_quote("//")
  77. cpp_quote("// The uFlags specify the context. It may have one or more of following")
  78. cpp_quote("// flags.")
  79. cpp_quote("//")
  80. cpp_quote("// CMF_DEFAULTONLY: This flag is passed if the user is invoking the default")
  81. cpp_quote("// action (typically by double-clicking, case 1 and 2 only). Context menu")
  82. cpp_quote("// extensions (case 1) should not add any menu items, and returns S_OK.")
  83. cpp_quote("//")
  84. cpp_quote("// CMF_VERBSONLY: The explorer passes this flag if it is constructing")
  85. cpp_quote("// a context menu for a short-cut object (case 1 and case 2 only). If this")
  86. cpp_quote("// flag is passed, it should not add any menu-items that is not appropriate")
  87. cpp_quote("// from a short-cut.")
  88. cpp_quote("// A good example is the Delete menuitem, which confuses the user")
  89. cpp_quote("// because it is not clear whether it deletes the link source item or the")
  90. cpp_quote("// link itself.")
  91. cpp_quote("//")
  92. cpp_quote("// CMF_EXPLORER: The explorer passes this flag if it has the left-side pane")
  93. cpp_quote("// (case 1 and 2 only). Context menu extensions should ignore this flag.")
  94. cpp_quote("//")
  95. cpp_quote("// High word (16-bit) are reserved for context specific communications")
  96. cpp_quote("// and the rest of flags (13-bit) are reserved by the system.")
  97. cpp_quote("//")
  98. cpp_quote("//")
  99. cpp_quote("// IContextMenu::InvokeCommand")
  100. cpp_quote("//")
  101. cpp_quote("// This member is called when the user has selected one of menuitems that")
  102. cpp_quote("// are inserted by previous QueryContextMenu member. In this case, the")
  103. cpp_quote("// LOWORD(lpici->lpVerb) contains the menuitem ID offset (menuitem ID -")
  104. cpp_quote("// idCmdFirst).")
  105. cpp_quote("//")
  106. cpp_quote("// This member function may also be called programmatically. In such a case,")
  107. cpp_quote("// lpici->lpVerb specifies the canonical name of the command to be invoked,")
  108. cpp_quote("// which is typically retrieved by GetCommandString member previously.")
  109. cpp_quote("//")
  110. cpp_quote("// Parameters in lpci:")
  111. cpp_quote("// cbSize -- Specifies the size of this structure (sizeof(*lpci))")
  112. cpp_quote("// hwnd -- Specifies the owner window for any message/dialog box.")
  113. cpp_quote("// fMask -- Specifies whether or not dwHotkey/hIcon paramter is valid.")
  114. cpp_quote("// lpVerb -- Specifies the command to be invoked.")
  115. cpp_quote("// lpParameters -- Parameters (optional)")
  116. cpp_quote("// lpDirectory -- Working directory (optional)")
  117. cpp_quote("// nShow -- Specifies the flag to be passed to ShowWindow (SW_*).")
  118. cpp_quote("// dwHotKey -- Hot key to be assigned to the app after invoked (optional).")
  119. cpp_quote("// hIcon -- Specifies the icon (optional).")
  120. cpp_quote("// hMonitor -- Specifies the default monitor (optional).")
  121. cpp_quote("//")
  122. cpp_quote("//")
  123. cpp_quote("// IContextMenu::GetCommandString")
  124. cpp_quote("//")
  125. cpp_quote("// This member function is called by the explorer either to get the")
  126. cpp_quote("// canonical (language independent) command name (uFlags == GCS_VERB) or")
  127. cpp_quote("// the help text ((uFlags & GCS_HELPTEXT) != 0) for the specified command.")
  128. cpp_quote("// The retrieved canonical string may be passed to its InvokeCommand")
  129. cpp_quote("// member function to invoke a command programmatically. The explorer")
  130. cpp_quote("// displays the help texts in its status bar; therefore, the length of")
  131. cpp_quote("// the help text should be reasonably short (<40 characters).")
  132. cpp_quote("//")
  133. cpp_quote("// Parameters:")
  134. cpp_quote("// idCmd -- Specifies menuitem ID offset (from idCmdFirst)")
  135. cpp_quote("// uFlags -- Either GCS_VERB or GCS_HELPTEXT")
  136. cpp_quote("// pwReserved -- Reserved (must pass NULL when calling, must ignore when called)")
  137. cpp_quote("// pszName -- Specifies the string buffer.")
  138. cpp_quote("// cchMax -- Specifies the size of the string buffer.")
  139. cpp_quote("//")
  140. cpp_quote("//===========================================================================")
  141. cpp_quote("")
  142. cpp_quote("// QueryContextMenu uFlags")
  143. cpp_quote("#define CMF_NORMAL 0x00000000")
  144. cpp_quote("#define CMF_DEFAULTONLY 0x00000001")
  145. cpp_quote("#define CMF_VERBSONLY 0x00000002")
  146. cpp_quote("#define CMF_EXPLORE 0x00000004")
  147. cpp_quote("#define CMF_NOVERBS 0x00000008")
  148. cpp_quote("#define CMF_CANRENAME 0x00000010")
  149. cpp_quote("#define CMF_NODEFAULT 0x00000020")
  150. cpp_quote("#if (NTDDI_VERSION < NTDDI_VISTA)")
  151. cpp_quote("#define CMF_INCLUDESTATIC 0x00000040") // deprecated - do not use
  152. cpp_quote("#endif")
  153. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  154. cpp_quote("#define CMF_ITEMMENU 0x00000080")
  155. cpp_quote("#endif")
  156. cpp_quote("#define CMF_EXTENDEDVERBS 0x00000100") // rarely used verbs
  157. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  158. cpp_quote("#define CMF_DISABLEDVERBS 0x00000200")
  159. cpp_quote("#endif")
  160. cpp_quote("#define CMF_ASYNCVERBSTATE 0x00000400") // the verb state can be evaluated asynchronously
  161. cpp_quote("#define CMF_OPTIMIZEFORINVOKE 0x00000800") // Context menu handlers that do not support invoking verb via canonical verb names (lpVerb)
  162. // can avoid the work in their QueryContextMenu implementation when this flag is present
  163. cpp_quote("#define CMF_SYNCCASCADEMENU 0x00001000") // Populate the cascade menu synchronously
  164. cpp_quote("#define CMF_DONOTPICKDEFAULT 0x00002000") // Tell the context menu to not pick default verb if none is explicitly specified
  165. cpp_quote("#define CMF_RESERVED 0xffff0000") // View specific
  166. cpp_quote("")
  167. cpp_quote("// GetCommandString uFlags")
  168. cpp_quote("#define GCS_VERBA 0x00000000 // canonical verb")
  169. cpp_quote("#define GCS_HELPTEXTA 0x00000001 // help text (for status bar)")
  170. cpp_quote("#define GCS_VALIDATEA 0x00000002 // validate command exists")
  171. cpp_quote("#define GCS_VERBW 0x00000004 // canonical verb (unicode)")
  172. cpp_quote("#define GCS_HELPTEXTW 0x00000005 // help text (unicode version)")
  173. cpp_quote("#define GCS_VALIDATEW 0x00000006 // validate command exists (unicode)")
  174. cpp_quote("#define GCS_VERBICONW 0x00000014 // icon string (unicode)")
  175. cpp_quote("#define GCS_UNICODE 0x00000004 // for bit testing - Unicode string")
  176. cpp_quote("")
  177. cpp_quote("#ifdef UNICODE")
  178. cpp_quote("#define GCS_VERB GCS_VERBW")
  179. cpp_quote("#define GCS_HELPTEXT GCS_HELPTEXTW")
  180. cpp_quote("#define GCS_VALIDATE GCS_VALIDATEW")
  181. cpp_quote("#else")
  182. cpp_quote("#define GCS_VERB GCS_VERBA")
  183. cpp_quote("#define GCS_HELPTEXT GCS_HELPTEXTA")
  184. cpp_quote("#define GCS_VALIDATE GCS_VALIDATEA")
  185. cpp_quote("#endif")
  186. cpp_quote("")
  187. cpp_quote("#define CMDSTR_NEWFOLDERA \"NewFolder\"")
  188. cpp_quote("#define CMDSTR_VIEWLISTA \"ViewList\"")
  189. cpp_quote("#define CMDSTR_VIEWDETAILSA \"ViewDetails\"")
  190. cpp_quote("#define CMDSTR_NEWFOLDERW L\"NewFolder\"")
  191. cpp_quote("#define CMDSTR_VIEWLISTW L\"ViewList\"")
  192. cpp_quote("#define CMDSTR_VIEWDETAILSW L\"ViewDetails\"")
  193. cpp_quote("")
  194. cpp_quote("#ifdef UNICODE")
  195. cpp_quote("#define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERW")
  196. cpp_quote("#define CMDSTR_VIEWLIST CMDSTR_VIEWLISTW")
  197. cpp_quote("#define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSW")
  198. cpp_quote("#else")
  199. cpp_quote("#define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERA")
  200. cpp_quote("#define CMDSTR_VIEWLIST CMDSTR_VIEWLISTA")
  201. cpp_quote("#define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSA")
  202. cpp_quote("#endif")
  203. cpp_quote("")
  204. cpp_quote("#define CMIC_MASK_HOTKEY SEE_MASK_HOTKEY")
  205. cpp_quote("#define CMIC_MASK_ICON SEE_MASK_ICON") // not used
  206. cpp_quote("#define CMIC_MASK_FLAG_NO_UI SEE_MASK_FLAG_NO_UI")
  207. cpp_quote("#define CMIC_MASK_UNICODE SEE_MASK_UNICODE")
  208. cpp_quote("#define CMIC_MASK_NO_CONSOLE SEE_MASK_NO_CONSOLE")
  209. cpp_quote("#if (NTDDI_VERSION < NTDDI_VISTA)")
  210. cpp_quote("#define CMIC_MASK_HASLINKNAME SEE_MASK_HASLINKNAME")
  211. cpp_quote("#define CMIC_MASK_HASTITLE SEE_MASK_HASTITLE")
  212. cpp_quote("#endif // NTDDI_VISTA")
  213. cpp_quote("#define CMIC_MASK_FLAG_SEP_VDM SEE_MASK_FLAG_SEPVDM")
  214. cpp_quote("#define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK")
  215. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  216. cpp_quote("#define CMIC_MASK_NOASYNC SEE_MASK_NOASYNC")
  217. cpp_quote("#endif")
  218. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE501)")
  219. cpp_quote("#define CMIC_MASK_SHIFT_DOWN 0x10000000")
  220. cpp_quote("#define CMIC_MASK_CONTROL_DOWN 0x40000000")
  221. cpp_quote("#endif // _WIN32_IE_IE501")
  222. cpp_quote("#if (_WIN32_IE >= 0x0560)")
  223. cpp_quote("#define CMIC_MASK_FLAG_LOG_USAGE SEE_MASK_FLAG_LOG_USAGE")
  224. cpp_quote("#define CMIC_MASK_NOZONECHECKS SEE_MASK_NOZONECHECKS")
  225. cpp_quote("#endif // (_WIN32_IE >= 0x560)")
  226. cpp_quote("")
  227. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE40)")
  228. cpp_quote("#define CMIC_MASK_PTINVOKE 0x20000000")
  229. cpp_quote("#endif // _WIN32_IE_IE40")
  230. cpp_quote("")
  231. cpp_quote("#include <pshpack8.h>")
  232. cpp_quote("")
  233. //NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor
  234. typedef struct _CMINVOKECOMMANDINFO
  235. {
  236. DWORD cbSize; // sizeof(CMINVOKECOMMANDINFO)
  237. DWORD fMask; // any combination of CMIC_MASK_*
  238. HWND hwnd; // might be NULL (indicating no owner window)
  239. LPCSTR lpVerb; // either a string or MAKEINTRESOURCE(idOffset)
  240. LPCSTR lpParameters; // might be NULL (indicating no parameter)
  241. LPCSTR lpDirectory; // might be NULL (indicating no specific directory)
  242. int nShow; // one of SW_ values for ShowWindow() API
  243. DWORD dwHotKey;
  244. HANDLE hIcon;
  245. } CMINVOKECOMMANDINFO;
  246. typedef CMINVOKECOMMANDINFO *LPCMINVOKECOMMANDINFO;
  247. typedef const CMINVOKECOMMANDINFO *PCCMINVOKECOMMANDINFO;
  248. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE40)")
  249. typedef struct _CMINVOKECOMMANDINFOEX
  250. {
  251. DWORD cbSize; // must be sizeof(CMINVOKECOMMANDINFOEX)
  252. DWORD fMask; // any combination of CMIC_MASK_*
  253. HWND hwnd; // might be NULL (indicating no owner window)
  254. LPCSTR lpVerb; // either a string or MAKEINTRESOURCE(idOffset)
  255. LPCSTR lpParameters; // might be NULL (indicating no parameter)
  256. LPCSTR lpDirectory; // might be NULL (indicating no specific directory)
  257. int nShow; // one of SW_ values for ShowWindow() API
  258. DWORD dwHotKey;
  259. HANDLE hIcon;
  260. LPCSTR lpTitle; // For CreateProcess-StartupInfo.lpTitle
  261. LPCWSTR lpVerbW; // Unicode verb (for those who can use it)
  262. LPCWSTR lpParametersW; // Unicode parameters (for those who can use it)
  263. LPCWSTR lpDirectoryW; // Unicode directory (for those who can use it)
  264. LPCWSTR lpTitleW; // Unicode title (for those who can use it)
  265. POINT ptInvoke; // Point where it's invoked
  266. } CMINVOKECOMMANDINFOEX;
  267. cpp_quote("#else")
  268. cpp_quote("typedef struct _PRE_IE4_CMINVOKECOMMANDINFOEX")
  269. cpp_quote("{")
  270. cpp_quote(" DWORD cbSize; // must be sizeof(CMINVOKECOMMANDINFOEX)")
  271. cpp_quote(" DWORD fMask; // any combination of CMIC_MASK_*")
  272. cpp_quote(" HWND hwnd; // might be NULL (indicating no owner window)")
  273. cpp_quote(" LPCSTR lpVerb; // either a string or MAKEINTRESOURCE(idOffset)")
  274. cpp_quote(" LPCSTR lpParameters; // might be NULL (indicating no parameter)")
  275. cpp_quote(" LPCSTR lpDirectory; // might be NULL (indicating no specific directory)")
  276. cpp_quote(" int nShow; // one of SW_ values for ShowWindow() API")
  277. cpp_quote(" DWORD dwHotKey;")
  278. cpp_quote(" HANDLE hIcon;")
  279. cpp_quote(" LPCSTR lpTitle; // For CreateProcess-StartupInfo.lpTitle")
  280. cpp_quote(" LPCWSTR lpVerbW; // Unicode verb (for those who can use it)")
  281. cpp_quote(" LPCWSTR lpParametersW; // Unicode parameters (for those who can use it)")
  282. cpp_quote(" LPCWSTR lpDirectoryW; // Unicode directory (for those who can use it)")
  283. cpp_quote(" LPCWSTR lpTitleW; // Unicode title (for those who can use it)")
  284. cpp_quote("} CMINVOKECOMMANDINFOEX;")
  285. cpp_quote("#endif // _WIN32_IE_IE40")
  286. typedef CMINVOKECOMMANDINFOEX *LPCMINVOKECOMMANDINFOEX;
  287. typedef const CMINVOKECOMMANDINFOEX *PCCMINVOKECOMMANDINFOEX;
  288. cpp_quote("#include <poppack.h>")
  289. // IContextMenu
  290. [
  291. local,
  292. uuid(000214e4-0000-0000-c000-000000000046), // IID_IContextMenu
  293. pointer_default(unique),
  294. ]
  295. interface IContextMenu : IUnknown
  296. {
  297. HRESULT QueryContextMenu(
  298. [in, annotation("__in")] HMENU hmenu,
  299. [in, annotation("__in")] UINT indexMenu,
  300. [in, annotation("__in")] UINT idCmdFirst,
  301. [in, annotation("__in")] UINT idCmdLast,
  302. [in, annotation("__in")] UINT uFlags);
  303. HRESULT InvokeCommand([in, annotation("__in")] CMINVOKECOMMANDINFO *pici);
  304. HRESULT GetCommandString(
  305. [in, annotation("__in")] UINT_PTR idCmd,
  306. [in, annotation("__in")] UINT uType,
  307. [in, annotation("__reserved")] UINT * pReserved,
  308. [out, annotation("__out_awcount(!(uType & GCS_UNICODE), cchMax)")] LPSTR pszName,
  309. [in, annotation("__in")] UINT cchMax);
  310. }
  311. typedef IContextMenu *LPCONTEXTMENU;
  312. // IContextMenu2
  313. [
  314. local,
  315. uuid(000214f4-0000-0000-c000-000000000046), // IID_IContextMenu2
  316. pointer_default(unique),
  317. ]
  318. interface IContextMenu2 : IContextMenu
  319. {
  320. HRESULT HandleMenuMsg(
  321. [in, annotation("__in")] UINT uMsg,
  322. [in, annotation("__in")] WPARAM wParam,
  323. [in, annotation("__in")] LPARAM lParam);
  324. }
  325. typedef IContextMenu2 * LPCONTEXTMENU2;
  326. // IContextMenu3
  327. [
  328. local,
  329. uuid(BCFCE0A0-EC17-11d0-8D10-00A0C90F2719), // IID_IContextMenu3
  330. pointer_default(unique),
  331. ]
  332. interface IContextMenu3 : IContextMenu2
  333. {
  334. HRESULT HandleMenuMsg2(
  335. [in, annotation("__in")] UINT uMsg,
  336. [in, annotation("__in")] WPARAM wParam,
  337. [in, annotation("__in")] LPARAM lParam,
  338. [out, annotation("__out_opt")] LRESULT* plResult);
  339. }
  340. typedef IContextMenu3 * LPCONTEXTMENU3;
  341. // IExecuteCommand
  342. [
  343. uuid(7F9185B0-CB92-43c5-80A9-92277A4F7B54),
  344. object,
  345. pointer_default(unique)
  346. ]
  347. interface IExecuteCommand : IUnknown
  348. {
  349. // key state values MK_CONTROL & MK_SHIFT
  350. HRESULT SetKeyState([in] DWORD grfKeyState);
  351. // for context menu invokes this comes from CMINVOKECOMMANDINFO.lpParameters
  352. HRESULT SetParameters([in, string] LPCWSTR pszParameters);
  353. // default Position = center of default monitor
  354. HRESULT SetPosition([in] POINT pt);
  355. // default = SW_NORMAL
  356. HRESULT SetShowWindow([in] int nShow);
  357. // default = FALSE
  358. HRESULT SetNoShowUI([in] BOOL fNoShowUI);
  359. // default Directory = GetCurrentDirectory()
  360. HRESULT SetDirectory([in, string] LPCWSTR pszDirectory);
  361. // this is where the work happens!
  362. HRESULT Execute();
  363. };
  364. // IPersistFolder
  365. [
  366. object,
  367. uuid(000214EA-0000-0000-C000-000000000046), // IID_IPersistFolder
  368. pointer_default(unique),
  369. ]
  370. interface IPersistFolder : IPersist
  371. {
  372. // IShellFolder::BindToObject when it is initializing a shell folder object.")
  373. // called when the explorer is initializing a shell folder object.
  374. // pidl -- Specifies the absolute location of the folder
  375. HRESULT Initialize([in] PCIDLIST_ABSOLUTE pidl);
  376. }
  377. typedef IPersistFolder *LPPERSISTFOLDER;
  378. cpp_quote("#if (_WIN32_IE >= 0x0400)")
  379. // IRunnableTask
  380. //
  381. // object that implement IRunnable must be *free threaded*. It is used for creating
  382. // objects to be asynchronously executed on a background thread by a task
  383. // scheduler. The task scheduler is free to call any method on the
  384. // IRunnable task on any thread as it sees fit (i.e. a task scheduler is not
  385. // guaranteed to only have a single background worker thread, nor is it
  386. // restricted to not call the IRunnableTask methods on the original queuing
  387. // thread).
  388. //
  389. // Note:
  390. //
  391. // The Run() member is called by the scheduler to start the task executing.
  392. // If the task supports being suspended and has been signalled to do so
  393. // (via receiving a call from the scheduler to Suspend()), it should return
  394. // from Run() with a value of E_PENDING. The task will then be held and
  395. // resumed by the scheduler at a later time by receiving a call to Resume()
  396. // (assuming it's not destroyed for some reason first).
  397. // IRunnableTask convenient state values
  398. cpp_quote("#define IRTIR_TASK_NOT_RUNNING 0")
  399. cpp_quote("#define IRTIR_TASK_RUNNING 1")
  400. cpp_quote("#define IRTIR_TASK_SUSPENDED 2")
  401. cpp_quote("#define IRTIR_TASK_PENDING 3")
  402. cpp_quote("#define IRTIR_TASK_FINISHED 4")
  403. [
  404. uuid(85788d00-6807-11d0-b810-00c04fd706ec), // IID_IRunnableTask
  405. object,
  406. local
  407. ]
  408. interface IRunnableTask : IUnknown
  409. {
  410. HRESULT Run();
  411. HRESULT Kill([in, annotation("__in")] BOOL bWait);
  412. HRESULT Suspend();
  413. HRESULT Resume();
  414. ULONG IsRunning();
  415. }
  416. // IShellTaskScheduler::AddTask()/RemoveTasks()/CountTasks() default arguments
  417. cpp_quote("#define TOID_NULL GUID_NULL")
  418. cpp_quote("#define ITSAT_DEFAULT_LPARAM ((DWORD_PTR)-1)")
  419. // IShellTaskScheduler::AddTask() priorities
  420. // This depends on the cooperation of tasks currently under execution.
  421. // New tasks will be inserted in the queue in priority order. If a task
  422. // of a low priority is currently under execution when a higher priority
  423. // task is added, the scheduler will attempt to suspend the task
  424. // currently under execution. It will be resumed when the other tasks
  425. // have been completed.
  426. cpp_quote("#define ITSAT_DEFAULT_PRIORITY 0x10000000")
  427. cpp_quote("#define ITSAT_MAX_PRIORITY 0x7fffffff")
  428. cpp_quote("#define ITSAT_MIN_PRIORITY 0x00000000")
  429. // IShellTaskScheduler::Status() flags
  430. cpp_quote("#define ITSSFLAG_COMPLETE_ON_DESTROY 0x0000 // wait for the current task to complete before deleting the scheduler")
  431. cpp_quote("#define ITSSFLAG_KILL_ON_DESTROY 0x0001 // kill the current task (if there is one) when the task scheduler is deleted")
  432. cpp_quote("#define ITSSFLAG_FLAGS_MASK 0x0003")
  433. // IShellTaskScheduler::Status() timeouts
  434. cpp_quote("#define ITSS_THREAD_DESTROY_DEFAULT_TIMEOUT (10*1000) // default milliseconds until a sleeping worker thread is released")
  435. cpp_quote("#define ITSS_THREAD_TERMINATE_TIMEOUT (INFINITE) // set sleeping worker threads to never be released")
  436. cpp_quote("#define ITSS_THREAD_TIMEOUT_NO_CHANGE (INFINITE - 1) // no change to the thread timeout")
  437. // interface for interacting with and controlling a task scheduler.
  438. // This interface is free-threaded (since queued tasks can
  439. // interact with the scheduler as well as the main execution
  440. // thread on which the task scheduler was created).
  441. [
  442. uuid(6CCB7BE0-6807-11d0-B810-00C04FD706EC),
  443. object,
  444. local
  445. ]
  446. interface IShellTaskScheduler : IUnknown
  447. {
  448. // Adds Tasks to the scheduler's background queue. The TASKOWNERID allow particular types
  449. // of tasks to be grouped so that they can be counted or removed. The lParam allows the task
  450. // to be associated with a particular item (for example an item in a listview). Thus, all
  451. // tasks owned by a particular item can be accessed by passing a non default value for this
  452. // parameter (i.e. to RemoveTasks()).
  453. HRESULT AddTask(
  454. [in, annotation("__in")] IRunnableTask *prt,
  455. [in, annotation("__in")] REFTASKOWNERID rtoid,
  456. [in, annotation("__in")] DWORD_PTR lParam,
  457. [in, annotation("__in")] DWORD dwPriority);
  458. // Removes tasks from the scheduler's queue. These can be sepcified in terms of their TASKOWNERID
  459. // or their LPARAM, or both, or neither (TOID_NULL && ITSAT_DEFAULT_LPARAM results in all tasks being
  460. // removed). If a task that matches is currently running and ITaskScheduler::Status() has been
  461. // passeed ITSSFLAG_KILL_ON_DESTROY then the scheduler will attempt to kill the current task. The
  462. // fWaitIfRunning parameter is then passed to IRunnableTask::Kill().
  463. HRESULT RemoveTasks(
  464. [in, annotation("__in")] REFTASKOWNERID rtoid,
  465. [in, annotation("__in")] DWORD_PTR lParam,
  466. [in, annotation("__in")] BOOL bWaitIfRunning);
  467. // returns the count of tasks in the queue depending upon the TASKOWNERID and the LPARAM passed.
  468. // pass TOID_NULL to count all tasks in the queue
  469. UINT CountTasks([in, annotation("__in")] REFTASKOWNERID rtoid);
  470. // This sets the ReleaseStatus for the current task and the background thread timeout. When
  471. // ITaskScheduler::RemoveTasks() is called and there is a task currently running that matches
  472. // ITSSFLAG_COMPLETE_ON_DESTROY will cause TRUE to be passed to the task's IRunnableTask::Kill().
  473. // The dwThreadTimeout parameter if not set to the default will cause the background thread to
  474. // die if no new tasks have been added to the queue in the timeout period. The Thread will be
  475. // recreated when the next new task is added.
  476. HRESULT Status(
  477. [in, annotation("__in")] DWORD dwReleaseStatus,
  478. [in, annotation("__in")] DWORD dwThreadTimeout);
  479. };
  480. cpp_quote("#define SID_ShellTaskScheduler IID_IShellTaskScheduler")
  481. [
  482. object,
  483. uuid("C7B236CE-EE80-11D0-985F-006008059382"),
  484. pointer_default(unique),
  485. local
  486. ]
  487. interface IQueryCodePage : IUnknown
  488. {
  489. HRESULT GetCodePage([out, annotation("__out")] UINT *puiCodePage);
  490. HRESULT SetCodePage([in, annotation("__in")] UINT uiCodePage);
  491. } ;
  492. // IPersistFolder2
  493. [
  494. object,
  495. uuid(1AC3D9F0-175C-11d1-95BE-00609797EA4F), // IID_IPersistFolder2
  496. pointer_default(unique),
  497. ]
  498. interface IPersistFolder2 : IPersistFolder
  499. {
  500. HRESULT GetCurFolder([out] PIDLIST_ABSOLUTE *ppidl);
  501. }
  502. cpp_quote("#endif")
  503. cpp_quote("#if (_WIN32_IE >= 0x0500)")
  504. cpp_quote("#define CSIDL_FLAG_PFTI_TRACKTARGET CSIDL_FLAG_DONT_VERIFY")
  505. // DESCRIPTION: PERSIST_FOLDER_TARGET_INFO
  506. // This stucture is used for Folder Shortcuts which allow the shell to
  507. // have a file system folder act like another area in the name space.
  508. // One of pidlTargetFolder, szTargetParsingName, or csidl needs to
  509. // specify the destination name space.
  510. //
  511. // pidlTargetFolder: This is a full pidl to the target folder. Can be NULL in the IPersistFolder3::InitializeEx()
  512. // call but not in the GetFolderTargetInfo() return structure.
  513. // szTargetParsingName: Empty string if not specified. Ortherwise, it is the parsible name
  514. // to the target. This name can be parsed by IShellFolder::
  515. // ParsedName() from the desktop.
  516. // szNetworkProvider: Can be an empty string. If not empty, it specifies the type of network
  517. // provider that will be used when binding to the target. This is used
  518. // for performance optimizations for the WNet APIs.
  519. // dwAttributes: -1 if not known. These are the SFGAO_ flags for IShellFolder::GetAttributesOf()
  520. // csidl: This is -1 if it's not used. This can be used instead of pidlTargetFolder or
  521. // szTargetParsingName to indicate the TargetFolder. See the list of CSIDL_ folders
  522. // below. CSIDL_FLAG_PFTI_TRACKTARGET means that the IShellFolder's target folder
  523. // should change if the user changes the target of the underlying CSIDL value.
  524. // You can also pass CSIDL_FLAG_CREATE to indicate that the target folder
  525. // should be created if it does not exist. No other CSIDL_FLAG_* values are supported.
  526. cpp_quote("#include <pshpack8.h>")
  527. #ifndef MAX_PATH
  528. #define MAX_PATH 260
  529. #endif
  530. typedef struct _PERSIST_FOLDER_TARGET_INFO
  531. {
  532. PIDLIST_ABSOLUTE pidlTargetFolder; // pidl for the folder we want to intiailize
  533. WCHAR szTargetParsingName[MAX_PATH]; // optional parsing name for the target
  534. WCHAR szNetworkProvider[MAX_PATH]; // optional network provider
  535. DWORD dwAttributes; // optional FILE_ATTRIBUTES_ flags (-1 if not used)
  536. int csidl; // optional folder index (SHGetFolderPath()) -1 if not used
  537. } PERSIST_FOLDER_TARGET_INFO;
  538. cpp_quote("#include <poppack.h>")
  539. // DESCRIPTION: IPersistFolder3
  540. // This interface is implemented by an IShellFolder object that wants non-default
  541. // handling of Folder Shortcuts. In general, shell name space extensions should use
  542. // pidlRoot (the alias pidl) as their location in the name space and pass it to public
  543. // APIs, such as ShellExecute(). The one exception is that pidlTarget should be used
  544. // when sending ChangeNotifies or registering to listen for change notifies
  545. // (see SFVM_GETNOTIFY).
  546. //
  547. // InitializeEx: This method initializes an IShellFolder and specifies where
  548. // it is rooted in the name space.
  549. // pbc: May be NULL.
  550. // pidlRoot: This is the same parameter as IPersistFolder::Initialize(). Caller allocates
  551. // and frees this parameter.
  552. // ppfti: May be NULL, in which case this is the same as a call to IPersistFolder::Initialize().
  553. // Otherwise this is a Folder Shortcut and this structure specifies the target
  554. // folder and it's attributes.
  555. // GetFolderTargetInfo: This is used by the caller to find information about
  556. // the folder shortcut. This structure may not be initialized by the caller,
  557. // so the callee needs to initialize every member. The callee allocates
  558. // pidlTargetFolder and the caller will free it. Filling in pidlTargetFolder is
  559. // ALWAYS required.
  560. [
  561. object,
  562. uuid(CEF04FDF-FE72-11d2-87A5-00C04F6837CF), // IID_IPersistFolder3
  563. pointer_default(unique),
  564. ]
  565. interface IPersistFolder3 : IPersistFolder2
  566. {
  567. HRESULT InitializeEx(
  568. [in, unique] IBindCtx *pbc,
  569. [in] PCIDLIST_ABSOLUTE pidlRoot,
  570. [in, unique] const PERSIST_FOLDER_TARGET_INFO *ppfti);
  571. HRESULT GetFolderTargetInfo([out] PERSIST_FOLDER_TARGET_INFO *ppfti);
  572. }
  573. cpp_quote("#endif")
  574. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WINXP) || (_WIN32_IE >= _WIN32_IE_IE70)")
  575. [
  576. object,
  577. uuid(1079acfc-29bd-11d3-8e0d-00c04f6837d5), // IID_IPersistIDList
  578. pointer_default(unique),
  579. ]
  580. interface IPersistIDList : IPersist
  581. {
  582. // sets or gets a fully qualifed idlist for an object
  583. HRESULT SetIDList([in] PCIDLIST_ABSOLUTE pidl);
  584. HRESULT GetIDList([out] PIDLIST_ABSOLUTE *ppidl);
  585. }
  586. cpp_quote("#endif // NTDDI_WINXP|| (_WIN32_IE >= _WIN32_IE_IE70)")
  587. [
  588. uuid(000214F2-0000-0000-C000-000000000046),
  589. object,
  590. pointer_default(unique)
  591. ]
  592. interface IEnumIDList : IUnknown
  593. {
  594. [local] HRESULT Next(
  595. [in, annotation("__in")] ULONG celt,
  596. [out, size_is(celt), length_is(*pceltFetched), annotation("__out_ecount_part(celt, *pceltFetched)")] PITEMID_CHILD *rgelt,
  597. [out, annotation("__out_opt __deref_out_range(0, celt)")] ULONG *pceltFetched);
  598. [call_as(Next)] HRESULT RemoteNext([in] ULONG celt,
  599. [out, size_is(celt), length_is(*pceltFetched)] PITEMID_CHILD *rgelt,
  600. [out] ULONG* pceltFetched);
  601. HRESULT Skip([in] ULONG celt);
  602. HRESULT Reset();
  603. HRESULT Clone([out] IEnumIDList **ppenum);
  604. }
  605. typedef IEnumIDList *LPENUMIDLIST;
  606. [
  607. uuid(d0191542-7954-4908-bc06-b2360bbe45ba),
  608. object,
  609. pointer_default(unique)
  610. ]
  611. interface IEnumFullIDList : IUnknown
  612. {
  613. [local]
  614. HRESULT Next(
  615. [in, annotation("__in")] ULONG celt,
  616. [out, size_is(celt), length_is(*pceltFetched), annotation("__out_ecount_part(celt, *pceltFetched)")] PIDLIST_ABSOLUTE *rgelt,
  617. [out, annotation("__out_opt __deref_out_range(0, celt)")] ULONG *pceltFetched);
  618. [call_as(Next)]
  619. HRESULT RemoteNext(
  620. [in] ULONG celt,
  621. [out, size_is(celt), length_is(*pceltFetched)] PIDLIST_ABSOLUTE *rgelt,
  622. [out] ULONG *pceltFetched);
  623. HRESULT Skip([in] ULONG celt);
  624. HRESULT Reset();
  625. HRESULT Clone([out] IEnumFullIDList **ppenum);
  626. }
  627. // IShellFolder::GetDisplayNameOf/SetNameOf uFlags
  628. [v1_enum] enum _SHGDNF
  629. {
  630. SHGDN_NORMAL = 0x0000, // default (display purpose)
  631. SHGDN_INFOLDER = 0x0001, // displayed under a folder (relative)
  632. SHGDN_FOREDITING = 0x1000, // for in-place editing
  633. SHGDN_FORADDRESSBAR = 0x4000, // UI friendly parsing name (remove ugly stuff)
  634. SHGDN_FORPARSING = 0x8000, // parsing name for ParseDisplayName()
  635. };
  636. typedef DWORD SHGDNF;
  637. // IShellFolder::EnumObjects grfFlags bits
  638. [v1_enum] enum _SHCONTF
  639. {
  640. SHCONTF_CHECKING_FOR_CHILDREN = 0x00010, // hint that client is checking if (what) child items the folder contains - not all details (e.g. short file name) are needed
  641. SHCONTF_FOLDERS = 0x00020, // only want folders enumerated (SFGAO_FOLDER)
  642. SHCONTF_NONFOLDERS = 0x00040, // include non folders (items without SFGAO_FOLDER)
  643. SHCONTF_INCLUDEHIDDEN = 0x00080, // show items normally hidden (items with SFGAO_HIDDEN)
  644. SHCONTF_INIT_ON_FIRST_NEXT = 0x00100, // DEFUNCT - this is always assumed
  645. SHCONTF_NETPRINTERSRCH = 0x00200, // hint that client is looking for printers
  646. SHCONTF_SHAREABLE = 0x00400, // hint that client is looking sharable resources (local drives or hidden root shares)
  647. SHCONTF_STORAGE = 0x00800, // include all items with accessible storage and their ancestors including hidden items
  648. SHCONTF_NAVIGATION_ENUM = 0x01000, // mark child folders to indicate that they should provide a "navigation" enumeration by default
  649. SHCONTF_FASTITEMS = 0x02000, // hint that client is only interested in items that can be enumerated quickly
  650. SHCONTF_FLATLIST = 0x04000, // enumerate items as flat list even if folder is stacked
  651. SHCONTF_ENABLE_ASYNC = 0x08000, // inform enumerator that client is listening for change notifications so enumerator does not need to be complete, items can be reported via change notifications
  652. SHCONTF_INCLUDESUPERHIDDEN = 0x10000, // show system items that are hidden
  653. };
  654. typedef DWORD SHCONTF;
  655. // IShellFolder::CompareIDs lParam flags
  656. // *these should only be used if the folder supports IShellFolder2*
  657. //
  658. // SHCIDS_ALLFIELDS
  659. //
  660. // only be used in conjunction with SHCIDS_CANONCALONLY or column 0.
  661. // This flag requests that the folder test for *pidl identity*, that is
  662. // “are these pidls logically the same”. This implies that cached fields
  663. // in the pidl that would distinguish them should be tested.
  664. // Without this flag, you are comparing the *object* s the pidls refer to.
  665. //
  666. // SHCIDS_CANONICALONLY
  667. //
  668. // This indicates that the sort should be *the most efficient sort possible*, the implication
  669. // being that the result will not be displayed to the UI: the SHCIDS_COLUMNMASK portion
  670. // of the lParam can be ignored. (Before we had SHCIDS_CANONICALONLY
  671. // we assumed column 0 was the "efficient" sort column.)
  672. //
  673. //
  674. cpp_quote("#define SHCIDS_ALLFIELDS 0x80000000L")
  675. cpp_quote("#define SHCIDS_CANONICALONLY 0x10000000L")
  676. cpp_quote("#define SHCIDS_BITMASK 0xFFFF0000L")
  677. cpp_quote("#define SHCIDS_COLUMNMASK 0x0000FFFFL")
  678. // IShellFolder::GetAttributesOf flags
  679. // SFGAO_CANLINK: If this bit is set on an item in the shell folder, a
  680. // 'Create Shortcut' menu item will be added to the File
  681. // menu and context menus for the item. If the user selects
  682. // that command, your IContextMenu::InvokeCommand() will be called
  683. // with 'link'.
  684. // That flag will also be used to determine if 'Create Shortcut'
  685. // should be added when the item in your folder is dragged to another
  686. // folder.
  687. cpp_quote("#define SFGAO_CANCOPY DROPEFFECT_COPY // Objects can be copied (0x1)")
  688. cpp_quote("#define SFGAO_CANMOVE DROPEFFECT_MOVE // Objects can be moved (0x2)")
  689. cpp_quote("#define SFGAO_CANLINK DROPEFFECT_LINK // Objects can be linked (0x4)")
  690. cpp_quote("#define SFGAO_STORAGE 0x00000008L // supports BindToObject(IID_IStorage)")
  691. cpp_quote("#define SFGAO_CANRENAME 0x00000010L // Objects can be renamed")
  692. cpp_quote("#define SFGAO_CANDELETE 0x00000020L // Objects can be deleted")
  693. cpp_quote("#define SFGAO_HASPROPSHEET 0x00000040L // Objects have property sheets")
  694. // unused 0x00000080
  695. cpp_quote("#define SFGAO_DROPTARGET 0x00000100L // Objects are drop target")
  696. cpp_quote("#define SFGAO_CAPABILITYMASK 0x00000177L")
  697. // unused 0x00000200
  698. // unused 0x00000400
  699. // unused 0x00000800
  700. cpp_quote("#define SFGAO_SYSTEM 0x00001000L // System object")
  701. cpp_quote("#define SFGAO_ENCRYPTED 0x00002000L // Object is encrypted (use alt color)")
  702. cpp_quote("#define SFGAO_ISSLOW 0x00004000L // 'Slow' object")
  703. cpp_quote("#define SFGAO_GHOSTED 0x00008000L // Ghosted icon")
  704. cpp_quote("#define SFGAO_LINK 0x00010000L // Shortcut (link)")
  705. cpp_quote("#define SFGAO_SHARE 0x00020000L // Shared")
  706. cpp_quote("#define SFGAO_READONLY 0x00040000L // Read-only")
  707. cpp_quote("#define SFGAO_HIDDEN 0x00080000L // Hidden object")
  708. cpp_quote("#define SFGAO_DISPLAYATTRMASK 0x000FC000L")
  709. cpp_quote("#define SFGAO_FILESYSANCESTOR 0x10000000L // May contain children with SFGAO_FILESYSTEM")
  710. cpp_quote("#define SFGAO_FOLDER 0x20000000L // Support BindToObject(IID_IShellFolder)")
  711. cpp_quote("#define SFGAO_FILESYSTEM 0x40000000L // Is a win32 file system object (file/folder/root)")
  712. cpp_quote("#define SFGAO_HASSUBFOLDER 0x80000000L // May contain children with SFGAO_FOLDER (may be slow)")
  713. cpp_quote("#define SFGAO_CONTENTSMASK 0x80000000L")
  714. cpp_quote("#define SFGAO_VALIDATE 0x01000000L // Invalidate cached information (may be slow)")
  715. cpp_quote("#define SFGAO_REMOVABLE 0x02000000L // Is this removeable media?")
  716. cpp_quote("#define SFGAO_COMPRESSED 0x04000000L // Object is compressed (use alt color)")
  717. cpp_quote("#define SFGAO_BROWSABLE 0x08000000L // Supports IShellFolder, but only implements CreateViewObject() (non-folder view)")
  718. cpp_quote("#define SFGAO_NONENUMERATED 0x00100000L // Is a non-enumerated object (should be hidden)")
  719. cpp_quote("#define SFGAO_NEWCONTENT 0x00200000L // Should show bold in explorer tree")
  720. cpp_quote("#define SFGAO_CANMONIKER 0x00400000L // Obsolete")
  721. cpp_quote("#define SFGAO_HASSTORAGE 0x00400000L // Obsolete")
  722. cpp_quote("#define SFGAO_STREAM 0x00400000L // Supports BindToObject(IID_IStream)")
  723. cpp_quote("#define SFGAO_STORAGEANCESTOR 0x00800000L // May contain children with SFGAO_STORAGE or SFGAO_STREAM")
  724. cpp_quote("#define SFGAO_STORAGECAPMASK 0x70C50008L // For determining storage capabilities, ie for open/save semantics")
  725. cpp_quote("#define SFGAO_PKEYSFGAOMASK 0x81044000L // Attributes that are masked out for PKEY_SFGAOFlags because they are considered to cause slow calculations or lack context (SFGAO_VALIDATE | SFGAO_ISSLOW | SFGAO_HASSUBFOLDER and others)")
  726. typedef ULONG SFGAOF;
  727. // passed to ISF::BindToObject() via IBindCtx::RegisterObjectParam()
  728. // * no interface support required on object param
  729. // If this param is passed to CFolderShortcut, IShellLink::Resolve will be invoked on the shortcut
  730. // during the bind operation. This will result in slowness for shortcuts pointing to network paths.
  731. cpp_quote("#define STR_BIND_FORCE_FOLDER_SHORTCUT_RESOLVE L\"Force Folder Shortcut Resolve\"")
  732. // passed to ISF::BindToObject() via IBindCtx::RegisterObjectParam()
  733. // * no interface support required on object param
  734. // If this param is passed to CFSFolder, CFSFolder::_CheckDriveRestriction will not check to see
  735. // if the drive it is on is restricted by SHRestriction(REST_NOVIEWONDRIVE) when someone tries
  736. // to CreateViewObject() on it. This is utilized when this folder is being used as a CD burning staging area
  737. // folder, and is not meant to be restricted because of this policy being applied to the drive that
  738. // the staging area folder happens to reside on. This policy is NOT a security policy, and thus this
  739. // is not a security breach. This flag is only sent by the CD folder when creating the IShellFolder for
  740. // the staging area part of the merged folder view, and thus this parameter's existence will not prevent
  741. // the policy from being implemented correctly when the CD drive itself has the group policy applied to it.
  742. cpp_quote("#define STR_AVOID_DRIVE_RESTRICTION_POLICY L\"Avoid Drive Restriction Policy\"")
  743. // passed to ISF::BindToObject() via IBindCtx::RegisterObjectParam()
  744. // * no interface support required on object param
  745. // If this param is passed to CFSFolder, CFSFolder::_CheckDriveRestriction will not check to see
  746. // if the drive it is on is restricted by SHRestriction(REST_NOVIEWONDRIVE) when someone tries
  747. // to CreateViewObject() on it. This is utilized when this folder is being used as a CD burning staging area
  748. // folder, and is not meant to be restricted because of this policy being applied to the drive that
  749. // the staging area folder happens to reside on. This policy is NOT a security policy, and thus this
  750. // is not a security breach. This flag is only sent by the CD folder when creating the IShellFolder for
  751. // the staging area part of the merged folder view, and thus this parameter's existence will not prevent
  752. // the policy from being implemented correctly when the CD drive itself has the group policy applied to it.
  753. cpp_quote("#define STR_AVOID_DRIVE_RESTRICTION_POLICY L\"Avoid Drive Restriction Policy\"")
  754. // passed to ISF::ParseDisplayName() or ISF::BindToObject() via IBindCtx::RegisterObjectParam()
  755. // * IPersist must be supported by the ObjectParam
  756. // the CLSID returned by IPersist::GetCLSID() should be skipped
  757. // in the binding process. used to avoid loops or to allow delegation to
  758. // base name space functionality. see SHSkipJunction()
  759. cpp_quote("#define STR_SKIP_BINDING_CLSID L\"Skip Binding CLSID\"")
  760. // passed to SHGetDesktopFolder()->ParseDisplayName() via IBindCtx::RegisterObjectParam()
  761. // * no interface support required on object param
  762. // instructing to prefer folder support for URLs. specifically used by the common
  763. // dialog to make it use the DAV NP when parsing http: URLs.
  764. cpp_quote("#define STR_PARSE_PREFER_FOLDER_BROWSING L\"Parse Prefer Folder Browsing\"")
  765. // passed to SHGetDesktopFolder()->ParseDisplayName() via IBindCtx::RegisterObjectParam()
  766. // instructing to fail parsing relative paths. only succeeds for fully qualified paths/urls.
  767. // * no interface support required on object param
  768. //
  769. // eg. even if "foo.txt" is a child of the desktop, it will still fail
  770. // but it will succeed for "C:\Documents and Settings\Username\Desktop\foo.txt"
  771. cpp_quote("#define STR_DONT_PARSE_RELATIVE L\"Don't Parse Relative\"")
  772. // passed to SHGetDesktopFolder()->ParseDisplayName() via IBindCtx::RegisterObjectParam()
  773. // to try translate from a full file system pidl to a alias to that pidl, if available.
  774. // * no interface support required on object param
  775. //
  776. // eg. if you pass the following path "C:\Documents and Settings\Username\Desktop\foo.txt"
  777. // if TRANSLATE is SET result is: [foo.txt] (the alias for the desktop being an empty pidl)
  778. // if TRANSLATE is NOT SET result is: [CLSID_MyComputer][c:\][Documents and Settings][Username][Desktop][foo.txt].
  779. cpp_quote("#define STR_PARSE_TRANSLATE_ALIASES L\"Parse Translate Aliases\"")
  780. // passed to SHGetDesktopFolder()->ParseDisplayName() via IBindCtx::RegisterObjectParam()
  781. // to disable the cache of network resources when parsing a name. The cache is still
  782. // populated with the results of the parse, however we skip the initial query.
  783. cpp_quote("#define STR_PARSE_SKIP_NET_CACHE L\"Skip Net Resource Cache\"")
  784. // * no interface support required on object param
  785. // instructing to allow shell: parsing to non-SFGAO_FOLDER objects.
  786. // Safe to set this for strings an end-user types, but do not set this in any binding
  787. // path where untrusted callers control the contents of the string
  788. cpp_quote("#define STR_PARSE_SHELL_PROTOCOL_TO_FILE_OBJECTS L\"Parse Shell Protocol To File Objects\"")
  789. cpp_quote("#if (_WIN32_IE >= 0x0700)")
  790. // passed to IPersistFolder3->Initialize() via IBindCtx::RegisterObjectParam()
  791. // Instructs the folder to track the location of the CLSID. Currently dbfolder uses this to track the pivot of the
  792. // regitem folder that aggregates it.
  793. cpp_quote("#define STR_TRACK_CLSID L\"Track the CLSID\"")
  794. // passed to IPersistHistory::LoadHistory() to enable loading the history from a stream
  795. // for an internal navigaton. An internal navigation is a navigation within the same view.
  796. cpp_quote("#define STR_INTERNAL_NAVIGATE L\"Internal Navigation\"")
  797. // used to passed parsed properties to IShellFolder::ParseDisplayName for a delegate namespace.
  798. // the namespace can use this instead of attempting to parse the name itself
  799. cpp_quote("#define STR_PARSE_PROPERTYSTORE L\"DelegateNamedProperties\"")
  800. // passed to IShellFolder::ParseDisplayName() via IBindCtx::RegisterObjectParam()
  801. // instructing to not fail parsing filenames with invalid characters.
  802. // Meaningful only in conjunction with STR_FILE_SYS_BIND_DATA
  803. // * no interface support required on object param
  804. cpp_quote("#define STR_NO_VALIDATE_FILENAME_CHARS L\"NoValidateFilenameChars\"")
  805. // passed to ISF::BindToObject via IBindCtx::RegisterObjectParam()
  806. // registered object must either implement ICreateObject or ISafeCreateObject
  807. cpp_quote("#define STR_BIND_DELEGATE_CREATE_OBJECT L\"Delegate Object Creation\"")
  808. cpp_quote("#define STR_PARSE_ALLOW_INTERNET_SHELL_FOLDERS L\"Allow binding to Internet shell folder handlers and negate STR_PARSE_PREFER_WEB_BROWSING\"")
  809. cpp_quote("#define STR_PARSE_PREFER_WEB_BROWSING L\"Do not bind to Internet shell folder handlers\"")
  810. // passed to SHGetDesktopFolder()->ParseDisplayName() via IBindCtx::RegisterObjectParam()
  811. // Instructs folders that manipulate network paths to show the network diagnostics UI when they
  812. // encounter diagnosable failures. If diagnosis succeeds, then the folder will try to parse the
  813. // path again. If parsing fails even after diagnosis, an appropriate error value will be returned.
  814. // * no interface support required on object param
  815. cpp_quote("#define STR_PARSE_SHOW_NET_DIAGNOSTICS_UI L\"Show network diagnostics UI\"")
  816. // deprecated
  817. cpp_quote("#define STR_PARSE_DONT_REQUIRE_VALIDATED_URLS L\"Do not require validated URLs\"")
  818. // This should be used when STR_PARSE_PREFER_FOLDER_BROWSING is included in the BindCtx
  819. // and the client desires the Internet shell folder handlers to generate an IDList for any valid URL
  820. // if a DAV-type folder cannot be created for the given URL. Specifically used by the common dialog
  821. // to support opening files on the internet.
  822. // This does not ensure that the URL actually exists. It only checks the syntax of the URL and
  823. // that it has a registered protocol handler.
  824. // * no interface support required on object param
  825. cpp_quote("#define STR_INTERNETFOLDER_PARSE_ONLY_URLMON_BINDABLE L\"Validate URL\"")
  826. cpp_quote("#endif // _WIN32_IE >= 0x0700")
  827. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WIN7)")
  828. // Passed to IShellFolder::ParseDisplayName along with STR_FILE_SYS_BIND_DATA. This forces simple
  829. // parsing while also probing for desktop.ini files along the path to get a localized name string
  830. // if there's any. The advantage is not probing for folders along the path. A folder might be a
  831. // server or a share, so it may be very expensive. On the other hand, desktop.inis are cached in
  832. // at least some locations, so it will be as cheap or cheaper than probling for folders attribs and
  833. // then probing for desktop.ini if hte folder is read only.
  834. cpp_quote("#define STR_BIND_FOLDERS_READ_ONLY L\"Folders As Read Only\"")
  835. // Passed to IShellFolder::ParseDisplayName with an FOLDER_ENUM_MODE value to control
  836. // the enumeration mode of the parsed item. The FOLDER_ENUM_MODE is passed in the bind
  837. // context via an object that implements IObjectWithFolderEnumMode.
  838. //
  839. // Items with different enumeration modes compare canonically (SHCIDS_CANONICALONLY) different
  840. // because they enumerate different sets of items.
  841. //
  842. // If an item doesn't support the enumeration mode value (because it isn't a folder or it doesn't
  843. // provide the enumeration mode) then it is created in the default enumeration mode.
  844. cpp_quote("#define STR_BIND_FOLDER_ENUM_MODE L\"Folder Enum Mode\"")
  845. typedef [v1_enum] enum FOLDER_ENUM_MODE
  846. {
  847. FEM_VIEWRESULT = 0, // main enumeration mode. default enumeration for a folder view, etc.
  848. FEM_NAVIGATION = 1, // alternate enumeration mode for navigating folder's content. default enumeration for a navigation pane, etc.
  849. } FOLDER_ENUM_MODE;
  850. [
  851. uuid(6a9d9026-0e6e-464c-b000-42ecc07de673),
  852. object,
  853. pointer_default(unique)
  854. ]
  855. interface IObjectWithFolderEnumMode : IUnknown
  856. {
  857. HRESULT SetMode([in] FOLDER_ENUM_MODE feMode);
  858. HRESULT GetMode([out] FOLDER_ENUM_MODE *pfeMode);
  859. }
  860. // Passed to IShellFolder::ParseDisplayName
  861. // The IDList returned should be bound to the provided Progid's association handler.
  862. cpp_quote("#define STR_PARSE_WITH_EXPLICIT_PROGID L\"ExplicitProgid\"")
  863. // pass to IShellFolder::ParseDisplayName
  864. // The IDList returned should be bound to the provided Application's association handler.
  865. cpp_quote("#define STR_PARSE_WITH_EXPLICIT_ASSOCAPP L\"ExplicitAssociationApp\"")
  866. // returned from IShellFolder::ParseDisplayName
  867. // The returned IDList was bound to the Progid specified with STR_PARSE_WITH_EXPLICIT_PROGID or the application specified
  868. // with STR_PARSE_WITH_EXPLICIT_ASSOCAPP. When absent, the Progid or Application was not bound into the IDList.
  869. cpp_quote("#define STR_PARSE_EXPLICIT_ASSOCIATION_SUCCESSFUL L\"ExplicitAssociationSuccessful\"")
  870. // IShellFolder IBindCtx parameter: "ParseAndCreateItem"
  871. //
  872. // The IUnknown for this is accessed through IBindCtx::RegisterObjectParam/GetObjectParam.
  873. //
  874. // Data sources should support this bind context parameter in their IShellFolder::ParseDisplayName
  875. // implementations, in order to optimize the behavior of SHCreateItemFromParsingName(). Normally,
  876. // SHCreateItemFromParsingName must perform two binds to the name that is parsed: one to parse via
  877. // IShellFolder::ParseDisplayName(), and a subsequent bind to create the ShellItem.
  878. // Supporting this bind context parameter in the data source avoids the second bind. It does so
  879. // because the first bind (during ParseDisplayName) will create the ShellItem at the same time and
  880. // stash it away via IParseAndCreateItem::SetItem. SHCreateItemFromParsingName() then uses that ShellItem
  881. // instead of creating one via SHCreateItemFromIDList().
  882. //
  883. // This parameter applies to the last element of the name that is parsed (c:\foo\bar.txt,
  884. // data applies to bar.txt).
  885. cpp_quote("#define STR_PARSE_AND_CREATE_ITEM L\"ParseAndCreateItem\"")
  886. interface IShellItem;
  887. [
  888. object,
  889. uuid(67efed0e-e827-4408-b493-78f3982b685c),
  890. pointer_default(unique),
  891. local
  892. ]
  893. interface IParseAndCreateItem : IUnknown
  894. {
  895. HRESULT SetItem([in] IShellItem *psi);
  896. HRESULT GetItem([in] REFIID riid, [out, iid_is(riid)] void **ppv); // Returns IShellItem
  897. };
  898. // IShellFolder IBindCtx parameter: "ItemCacheContext"
  899. //
  900. // The IUnknown for this is accessed through IBindCtx::RegisterObjectParam/GetObjectParam.
  901. // The implementation should be a separate BindContext object.
  902. //
  903. // Data sources should support this bind context parameter in their IShellFolder::ParseDisplayName
  904. // and IPersistFolder3::InitializeEx implementations, in order to cache expensive
  905. // helper objects that can live across instantiations of shell items (instead of re-creating these
  906. // internal objects each time a shell item is created).
  907. //
  908. // A caller must opt-in to this behavior by providing this bind context parameter when calling
  909. // SHCreateItemFromParsingName(), to optimize the behavior of binding to multiple parsing
  910. // names in succession. The lifetime of this object should span across multiple instances
  911. // of shell items and their individual bind contexts.
  912. cpp_quote("#define STR_ITEM_CACHE_CONTEXT L\"ItemCacheContext\"")
  913. cpp_quote("#endif // NTDDI_VERSION >= NTDDI_WIN7")
  914. interface IShellFolder;
  915. [
  916. uuid(000214E6-0000-0000-C000-000000000046),
  917. object,
  918. pointer_default(unique)
  919. ]
  920. interface IShellFolder : IUnknown
  921. {
  922. midl_pragma warning (disable: 2495) // annotation is allowed on local interface and local methods only
  923. HRESULT ParseDisplayName(
  924. [in, unique] HWND hwnd,
  925. [in, unique] IBindCtx *pbc,
  926. [in, string] LPWSTR pszDisplayName,
  927. [in, out, unique, annotation("__reserved")] ULONG *pchEaten,
  928. [out] PIDLIST_RELATIVE *ppidl,
  929. [in, out, unique] ULONG *pdwAttributes);
  930. midl_pragma warning (default: 2495)
  931. HRESULT EnumObjects(
  932. [in, unique] HWND hwnd,
  933. [in] SHCONTF grfFlags,
  934. [out] IEnumIDList **ppenumIDList);
  935. // returns an instance of a sub-folder which is specified by the IDList (pidl).
  936. // IShellFolder or derived interfaces
  937. HRESULT BindToObject(
  938. [in] PCUIDLIST_RELATIVE pidl,
  939. [in, unique] IBindCtx *pbc,
  940. [in] REFIID riid,
  941. [out, iid_is(riid)] void **ppv);
  942. // produces the same result as BindToObject()
  943. HRESULT BindToStorage(
  944. [in] PCUIDLIST_RELATIVE pidl,
  945. [in, unique] IBindCtx *pbc,
  946. [in] REFIID riid,
  947. [out, iid_is(riid)] void **ppv);
  948. // compares two IDLists and returns the result. The shell
  949. // explorer always passes 0 as lParam, which indicates 'sort by name'.
  950. // It should return 0 (as CODE of the scode), if two id indicates the
  951. // same object; negative value if pidl1 should be placed before pidl2;
  952. // positive value if pidl2 should be placed before pidl1.
  953. // use the macro ResultFromShort() to extract the result comparison
  954. // it deals with the casting and type conversion issues for you
  955. HRESULT CompareIDs(
  956. [in] LPARAM lParam,
  957. [in] PCUIDLIST_RELATIVE pidl1,
  958. [in] PCUIDLIST_RELATIVE pidl2);
  959. // creates a view object of the folder itself. The view
  960. // object is a difference instance from the shell folder object.
  961. // 'hwndOwner' can be used as the owner window of its dialog box or
  962. // menu during the lifetime of the view object.
  963. // This member function should always create a new
  964. // instance which has only one reference count. The explorer may create
  965. // more than one instances of view object from one shell folder object
  966. // and treat them as separate instances.
  967. // returns IShellView derived interface
  968. HRESULT CreateViewObject(
  969. [in, unique] HWND hwndOwner,
  970. [in] REFIID riid,
  971. [out, iid_is(riid)] void **ppv);
  972. // returns the attributes of specified objects in that
  973. // folder. 'cidl' and 'apidl' specifies objects. 'apidl' contains only
  974. // simple IDLists. The explorer initializes *prgfInOut with a set of
  975. // flags to be evaluated. The shell folder may optimize the operation
  976. // by not returning unspecified flags.
  977. HRESULT GetAttributesOf(
  978. [in] UINT cidl,
  979. [in, size_is(cidl), unique] PCUITEMID_CHILD_ARRAY apidl,
  980. [in, out] SFGAOF * rgfInOut);
  981. midl_pragma warning (disable: 2495) // annotation is allowed on local interface and local methods only
  982. // creates a UI object to be used for specified objects.
  983. // The shell explorer passes either IID_IDataObject (for transfer operation)
  984. // or IID_IContextMenu (for context menu operation) as riid
  985. // and many other interfaces
  986. HRESULT GetUIObjectOf(
  987. [in, unique] HWND hwndOwner,
  988. [in] UINT cidl,
  989. [in, size_is(cidl), unique] PCUITEMID_CHILD_ARRAY apidl,
  990. [in] REFIID riid,
  991. [in, out, unique, annotation("__reserved")] UINT * rgfReserved,
  992. [out, iid_is(riid)] void **ppv);
  993. midl_pragma warning (default: 2495)
  994. // returns the display name of the specified object.
  995. // If the ID contains the display name (in the locale character set),
  996. // it returns the offset to the name. Otherwise, it returns a pointer
  997. // to the display name string (UNICODE), which is allocated by the
  998. // task allocator, or fills in a buffer.
  999. // use the helper APIS StrRetToStr() or StrRetToBuf() to deal with the different
  1000. // forms of the STRRET structure
  1001. HRESULT GetDisplayNameOf(
  1002. [in, unique] PCUITEMID_CHILD pidl,
  1003. [in] SHGDNF uFlags,
  1004. [out] STRRET *pName);
  1005. // sets the display name of the specified object.
  1006. // If it changes the ID as well, it returns the new ID which is
  1007. // alocated by the task allocator.
  1008. [local]
  1009. HRESULT SetNameOf(
  1010. [in, unique, annotation("__in_opt")] HWND hwnd,
  1011. [in, annotation("__in")] PCUITEMID_CHILD pidl,
  1012. [in, string, annotation("__in")] LPCWSTR pszName,
  1013. [in, annotation("__in")] SHGDNF uFlags,
  1014. [out, annotation("__deref_opt_out")] PITEMID_CHILD *ppidlOut);
  1015. [call_as(SetNameOf)]
  1016. HRESULT RemoteSetNameOf(
  1017. [in, unique] HWND hwnd,
  1018. [in] PCUITEMID_CHILD pidl,
  1019. [in, string] LPCWSTR pszName,
  1020. [in] SHGDNF uFlags,
  1021. [out] PITEMID_CHILD *ppidlOut);
  1022. }
  1023. typedef IShellFolder * LPSHELLFOLDER;
  1024. typedef struct EXTRASEARCH
  1025. {
  1026. GUID guidSearch;
  1027. WCHAR wszFriendlyName[80];
  1028. WCHAR wszUrl[2084];
  1029. } EXTRASEARCH, *LPEXTRASEARCH;
  1030. [
  1031. uuid(0E700BE1-9DB6-11d1-A1CE-00C04FD75D13),
  1032. object,
  1033. pointer_default(unique)
  1034. ]
  1035. interface IEnumExtraSearch : IUnknown
  1036. {
  1037. HRESULT Next(
  1038. [in] ULONG celt,
  1039. [out, size_is(celt), length_is(*pceltFetched)] EXTRASEARCH *rgelt,
  1040. [out] ULONG *pceltFetched);
  1041. HRESULT Skip([in] ULONG celt);
  1042. HRESULT Reset();
  1043. HRESULT Clone([out] IEnumExtraSearch **ppenum);
  1044. }
  1045. typedef IEnumExtraSearch *LPENUMEXTRASEARCH;
  1046. // IShellFolder2::GetDefaultColumnState values
  1047. [
  1048. uuid(93F2F68C-1D1B-11d3-A30E-00C04F79ABD1),
  1049. object,
  1050. pointer_default(unique)
  1051. ]
  1052. interface IShellFolder2 : IShellFolder
  1053. {
  1054. // Returns the guid of the search that is to be invoked when user clicks on the search toolbar button
  1055. HRESULT GetDefaultSearchGUID([out] GUID *pguid);
  1056. // gives an enumerator of the searches to be added to the search menu
  1057. HRESULT EnumSearches([out] IEnumExtraSearch **ppenum);
  1058. HRESULT GetDefaultColumn(
  1059. [in] DWORD dwRes,
  1060. [out] ULONG *pSort,
  1061. [out] ULONG *pDisplay);
  1062. // return SHCOLSTATE_ values
  1063. HRESULT GetDefaultColumnState(
  1064. [in] UINT iColumn,
  1065. [out] SHCOLSTATEF *pcsFlags);
  1066. // PCUITEMID_CHILD should have been annotated as [in].
  1067. // Changing the annotation will break compatibility, but GetDetailsEx should never be called with a null pidl.
  1068. HRESULT GetDetailsEx(
  1069. [in, unique] PCUITEMID_CHILD pidl,
  1070. [in] const SHCOLUMNID *pscid,
  1071. [out] VARIANT *pv);
  1072. HRESULT GetDetailsOf(
  1073. [in, unique] PCUITEMID_CHILD pidl,
  1074. [in] UINT iColumn,
  1075. [out] SHELLDETAILS *psd);
  1076. HRESULT MapColumnToSCID(
  1077. [in] UINT iColumn,
  1078. [out] SHCOLUMNID *pscid);
  1079. }
  1080. // FOLDERSETTINGS is a data structure that explorer passes from one folder
  1081. // view to another, when the user is browsing. It calls ISV::GetCurrentInfo
  1082. // member to get the current settings and pass it to ISV::CreateViewWindow
  1083. // to allow the next folder view 'inherit' it. These settings assumes a
  1084. // particular UI (which the shell's folder view has), and shell extensions
  1085. // may or may not use those settings.
  1086. typedef char * LPVIEWSETTINGS;
  1087. typedef [v1_enum] enum FOLDERFLAGS
  1088. {
  1089. // XP flags
  1090. FWF_NONE = 0x00000000,
  1091. FWF_AUTOARRANGE = 0x00000001,
  1092. FWF_ABBREVIATEDNAMES = 0x00000002, // not supported
  1093. FWF_SNAPTOGRID = 0x00000004,
  1094. FWF_OWNERDATA = 0x00000008, // not supported
  1095. FWF_BESTFITWINDOW = 0x00000010,
  1096. FWF_DESKTOP = 0x00000020, // implies NOCLIENTEDGE/NOSCROLL
  1097. FWF_SINGLESEL = 0x00000040,
  1098. FWF_NOSUBFOLDERS = 0x00000080,
  1099. FWF_TRANSPARENT = 0x00000100,
  1100. FWF_NOCLIENTEDGE = 0x00000200, // not supported, this is always assumed to be true
  1101. FWF_NOSCROLL = 0x00000400,
  1102. FWF_ALIGNLEFT = 0x00000800,
  1103. FWF_NOICONS = 0x00001000,
  1104. FWF_SHOWSELALWAYS = 0x00002000,
  1105. FWF_NOVISIBLE = 0x00004000,
  1106. FWF_SINGLECLICKACTIVATE = 0x00008000, // not supported
  1107. FWF_NOWEBVIEW = 0x00010000, // not supported
  1108. FWF_HIDEFILENAMES = 0x00020000,
  1109. FWF_CHECKSELECT = 0x00040000, // check boxes with 2 modes { unchecked, SVSI_CHECK }
  1110. // Vista Flags
  1111. FWF_NOENUMREFRESH = 0x00080000,
  1112. FWF_NOGROUPING = 0x00100000,
  1113. FWF_FULLROWSELECT = 0x00200000,
  1114. FWF_NOFILTERS = 0x00400000,
  1115. FWF_NOCOLUMNHEADER = 0x00800000, // don't show column header
  1116. FWF_NOHEADERINALLVIEWS = 0x01000000, // don't show column header if not in details mode
  1117. FWF_EXTENDEDTILES = 0x02000000,
  1118. FWF_TRICHECKSELECT = 0x04000000, // checks boxes have 3 modes { unchecked, SVSI_CHECK, SVSI_CHECK2 }
  1119. FWF_AUTOCHECKSELECT = 0x08000000, // check boxes to change item selection state
  1120. FWF_NOBROWSERVIEWSTATE = 0x10000000,
  1121. FWF_SUBSETGROUPS = 0x20000000,
  1122. FWF_USESEARCHFOLDER = 0x40000000, // Use the search folder for stacking and searching
  1123. FWF_ALLOWRTLREADING = 0x80000000, // Do not use WS_EX_RTLREADING when WS_EX_LAYOUTRTL is set (thereby keeping RTL reading)
  1124. } FOLDERFLAGS;
  1125. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(FOLDERFLAGS)") // some bits are flags, others are not
  1126. typedef [v1_enum] enum FOLDERVIEWMODE
  1127. {
  1128. FVM_AUTO = -1,
  1129. FVM_FIRST = 1,
  1130. FVM_ICON = 1,
  1131. FVM_SMALLICON = 2,
  1132. FVM_LIST = 3,
  1133. FVM_DETAILS = 4,
  1134. FVM_THUMBNAIL = 5,
  1135. FVM_TILE = 6,
  1136. FVM_THUMBSTRIP = 7,
  1137. FVM_CONTENT = 8,
  1138. FVM_LAST = 8,
  1139. } FOLDERVIEWMODE;
  1140. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  1141. typedef [v1_enum] enum FOLDERLOGICALVIEWMODE
  1142. {
  1143. FLVM_UNSPECIFIED = -1,
  1144. FLVM_FIRST = 1,
  1145. FLVM_DETAILS = 1,
  1146. FLVM_TILES = 2,
  1147. FLVM_ICONS = 3,
  1148. FLVM_LIST = 4,
  1149. FLVM_CONTENT = 5,
  1150. FLVM_LAST = 5,
  1151. } FOLDERLOGICALVIEWMODE;
  1152. cpp_quote("#endif // NTDDI_VISTA")
  1153. typedef struct FOLDERSETTINGS
  1154. {
  1155. UINT /* FOLDERVIEWMODE */ ViewMode; // View mode
  1156. UINT /* FOLDERFLAGS */ fFlags; // View options
  1157. } FOLDERSETTINGS;
  1158. typedef FOLDERSETTINGS *LPFOLDERSETTINGS;
  1159. typedef const FOLDERSETTINGS * LPCFOLDERSETTINGS;
  1160. typedef FOLDERSETTINGS *PFOLDERSETTINGS;
  1161. [
  1162. uuid(3cc974d2-b302-4d36-ad3e-06d93f695d3f),
  1163. object,
  1164. pointer_default(unique)
  1165. ]
  1166. interface IFolderViewOptions : IUnknown
  1167. {
  1168. typedef [v1_enum] enum FOLDERVIEWOPTIONS
  1169. {
  1170. FVO_DEFAULT = 0x00000000, // default needs none of these options and will use Itemsview
  1171. FVO_VISTALAYOUT = 0x00000001, // always use listview to maintain vista parity
  1172. FVO_CUSTOMPOSITION = 0x00000002, // requires the custom positioning of items within the X,Y space of the view
  1173. FVO_CUSTOMORDERING = 0x00000004, // requires the custom reordering feature of the view
  1174. FVO_SUPPORTHYPERLINKS = 0x00000008, // requires the use of hyperlinks in tiles and details modes
  1175. FVO_NOANIMATIONS = 0x00000010, // turn off animations within the view
  1176. FVO_NOSCROLLTIPS = 0x00000020, // turn off scroll tips
  1177. } FOLDERVIEWOPTIONS;
  1178. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(FOLDERVIEWOPTIONS)")
  1179. HRESULT SetFolderViewOptions(
  1180. [in] FOLDERVIEWOPTIONS fvoMask,
  1181. [in] FOLDERVIEWOPTIONS fvoFlags);
  1182. HRESULT GetFolderViewOptions(
  1183. [out] FOLDERVIEWOPTIONS *pfvoFlags);
  1184. }
  1185. //
  1186. // IShellView::GetWindow(phwnd)
  1187. //
  1188. // Inherited from IOleWindow::GetWindow.
  1189. //
  1190. //
  1191. // IShellView::ContextSensitiveHelp(fEnterMode)
  1192. //
  1193. // Inherited from IOleWindow::ContextSensitiveHelp.
  1194. //
  1195. //
  1196. // IShellView::TranslateAccelerator(lpmsg)
  1197. //
  1198. // Similar to IOleInPlaceActiveObject::TranlateAccelerator. The explorer
  1199. // calls this function BEFORE any other translation. Returning S_OK
  1200. // indicates that the message was translated (eaten) and should not be
  1201. // translated or dispatched by the explorer.
  1202. //
  1203. //
  1204. // IShellView::EnableModeless(fEnable)
  1205. // Similar to IOleInPlaceActiveObject::EnableModeless.
  1206. //
  1207. //
  1208. // IShellView::UIActivate(uState)
  1209. //
  1210. // The explorer calls this member function whenever the activation
  1211. // state of the view window is changed by a certain event that is
  1212. // NOT caused by the shell view itself.
  1213. //
  1214. // SVUIA_DEACTIVATE will be passed when the explorer is about to
  1215. // destroy the shell view window; the shell view is supposed to remove
  1216. // all the extended UIs (typically merged menu and modeless popup windows).
  1217. //
  1218. // SVUIA_ACTIVATE_NOFOCUS will be passsed when the shell view is losing
  1219. // the input focus or the shell view has been just created without the
  1220. // input focus; the shell view is supposed to set menuitems appropriate
  1221. // for non-focused state (no selection specific items should be added).
  1222. //
  1223. // SVUIA_ACTIVATE_FOCUS will be passed when the explorer has just
  1224. // created the view window with the input focus; the shell view is
  1225. // supposed to set menuitems appropriate for focused state.
  1226. //
  1227. // SVUIA_INPLACEACTIVATE(new) will be passed when the shell view is opened
  1228. // within an ActiveX control, which is not a UI active. In this case,
  1229. // the shell view should not merge menus or put toolbas. To be compatible
  1230. // with Win95 client, we don't pass this value unless the view supports
  1231. // IShellView2.
  1232. //
  1233. // The shell view should not change focus within this member function.
  1234. // The shell view should not hook the WM_KILLFOCUS message to remerge
  1235. // menuitems. However, the shell view typically hook the WM_SETFOCUS
  1236. // message, and re-merge the menu after calling IShellBrowser::
  1237. // OnViewWindowActivated.
  1238. //
  1239. // One of the ACTIVATE / INPLACEACTIVATE messages will be sent when
  1240. // the view window becomes the currently displayed view. On Win95 systems,
  1241. // this will happen immediately after the CreateViewWindow call. On IE4, Win98,
  1242. // and NT5 systems this may happen when the view reports it is ready (if the
  1243. // IShellView supports async creation). This can be used as a hint as to when
  1244. // to make your view window visible. Note: the Win95/Win98/NT4 common dialogs
  1245. // do not send either of these on creation.
  1246. //
  1247. //
  1248. // IShellView::Refresh()
  1249. //
  1250. // The explorer calls this member when the view needs to refresh its
  1251. // contents (such as when the user hits F5 key).
  1252. //
  1253. //
  1254. // IShellView::CreateViewWindow
  1255. //
  1256. // This member creates the view window (right-pane of the explorer or the
  1257. // client window of the folder window).
  1258. //
  1259. //
  1260. // IShellView::DestroyViewWindow
  1261. //
  1262. // This member destroys the view window.
  1263. //
  1264. //
  1265. // IShellView::GetCurrentInfo
  1266. //
  1267. // This member returns the folder settings.
  1268. //
  1269. //
  1270. // IShellView::AddPropertySHeetPages
  1271. //
  1272. // The explorer calls this member when it is opening the option property
  1273. // sheet. This allows the view to add additional pages to it.
  1274. //
  1275. //
  1276. // IShellView::SaveViewState()
  1277. //
  1278. // The explorer calls this member when the shell view is supposed to
  1279. // store its view settings. The shell view is supposed to get a view
  1280. // stream by calling IShellBrowser::GetViewStateStream and store the
  1281. // current view state into that stream.
  1282. //
  1283. //
  1284. // IShellView::SelectItem(pidlItem, uFlags)
  1285. //
  1286. // The explorer calls this member to change the selection state of
  1287. // item(s) within the shell view window. If pidlItem is NULL and uFlags
  1288. // is SVSI_DESELECTOTHERS, all items should be deselected.
  1289. typedef [v1_enum] enum _SVSIF // Shell View Select Item Flags (SVSIF)
  1290. {
  1291. SVSI_DESELECT = 0x00000000,
  1292. SVSI_SELECT = 0x00000001,
  1293. SVSI_EDIT = 0x00000003, // includes SVSI_SELECT
  1294. SVSI_DESELECTOTHERS = 0x00000004,
  1295. SVSI_ENSUREVISIBLE = 0x00000008,
  1296. SVSI_FOCUSED = 0x00000010,
  1297. SVSI_TRANSLATEPT = 0x00000020,
  1298. SVSI_SELECTIONMARK = 0x00000040,
  1299. SVSI_POSITIONITEM = 0x00000080,
  1300. SVSI_CHECK = 0x00000100,
  1301. SVSI_CHECK2 = 0x00000200,
  1302. SVSI_KEYBOARDSELECT = 0x00000401, // includes SVSI_SELECT
  1303. SVSI_NOTAKEFOCUS = 0x40000000,
  1304. } _SVSIF;
  1305. cpp_quote("#define SVSI_NOSTATECHANGE ((UINT)0x80000000) // work around the use of the high bit that results in 4245: signed/unsigned mismatch")
  1306. typedef UINT SVSIF; // Shell View Select Item Flags (SVSIF), values from _SVSIF
  1307. typedef [v1_enum] enum _SVGIO // Shell View Get Item Object flags (SVGIO), used with IShellView::GetItemObject() and other methods
  1308. {
  1309. SVGIO_BACKGROUND = 0x00000000, // riid == IID_IDispatch -> view automation object, implements supports connection point container for DIID_DShellFolderViewEvents
  1310. // riid == IID_IContextMenu -> backgroud context menu object
  1311. // riid == IID_IPersistHistory -> persist history object for the view
  1312. SVGIO_SELECTION = 0x00000001, // the selected items in the view
  1313. SVGIO_ALLVIEW = 0x00000002, // all of the items in the view
  1314. SVGIO_CHECKED = 0x00000003, // if the view is in check select mode the checked items
  1315. SVGIO_TYPE_MASK = 0x0000000F, // mask for above values
  1316. SVGIO_FLAG_VIEWORDER = 0x80000000, // request items in view order
  1317. } _SVGIO;
  1318. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(_SVGIO)")
  1319. typedef int SVGIO; // Shell View Get Item Object flags (SVGIO), values from _SVGIO
  1320. // uState values for IShellView::UIActivate
  1321. typedef [v1_enum] enum SVUIA_STATUS
  1322. {
  1323. SVUIA_DEACTIVATE = 0,
  1324. SVUIA_ACTIVATE_NOFOCUS = 1,
  1325. SVUIA_ACTIVATE_FOCUS = 2,
  1326. SVUIA_INPLACEACTIVATE = 3 // new flag for IShellView2
  1327. } SVUIA_STATUS;
  1328. // this is to handle name collisions
  1329. cpp_quote("#ifdef _FIX_ENABLEMODELESS_CONFLICT")
  1330. cpp_quote("#define EnableModeless EnableModelessSV")
  1331. cpp_quote("#endif")
  1332. //
  1333. // this is so that all the implementations still get the function pointer.
  1334. // and midl wont complain about the data type
  1335. //
  1336. cpp_quote("#ifdef _NEVER_")
  1337. typedef LPARAM LPFNSVADDPROPSHEETPAGE;
  1338. cpp_quote("#else //!_NEVER_")
  1339. cpp_quote("#include <prsht.h>")
  1340. cpp_quote("typedef LPFNADDPROPSHEETPAGE LPFNSVADDPROPSHEETPAGE;")
  1341. cpp_quote("#endif //_NEVER_")
  1342. interface IShellBrowser;
  1343. [
  1344. uuid(000214E3-0000-0000-C000-000000000046),
  1345. object,
  1346. pointer_default(unique)
  1347. ]
  1348. interface IShellView : IOleWindow
  1349. {
  1350. HRESULT TranslateAccelerator([in] MSG *pmsg);
  1351. HRESULT EnableModeless([in] BOOL fEnable);
  1352. HRESULT UIActivate([in] UINT /* SVUIA_STATUS */ uState);
  1353. HRESULT Refresh();
  1354. HRESULT CreateViewWindow(
  1355. [in, unique] IShellView *psvPrevious,
  1356. [in] LPCFOLDERSETTINGS pfs,
  1357. [in] IShellBrowser *psb,
  1358. [in] RECT *prcView,
  1359. [out] HWND *phWnd);
  1360. HRESULT DestroyViewWindow();
  1361. HRESULT GetCurrentInfo([out] LPFOLDERSETTINGS pfs);
  1362. [local] HRESULT AddPropertySheetPages(
  1363. [in, annotation("__in")] DWORD dwReserved,
  1364. [in, annotation("__in")] LPFNSVADDPROPSHEETPAGE pfn,
  1365. [in, annotation("__in")] LPARAM lparam);
  1366. HRESULT SaveViewState();
  1367. HRESULT SelectItem(
  1368. [in, unique] PCUITEMID_CHILD pidlItem,
  1369. [in] SVSIF uFlags);
  1370. HRESULT GetItemObject(
  1371. [in] UINT /* SVGIO */ uItem,
  1372. [in] REFIID riid,
  1373. [out, iid_is(riid)] void **ppv);
  1374. typedef IShellView *LPSHELLVIEW;
  1375. }
  1376. [
  1377. uuid(88E39E80-3578-11CF-AE69-08002B2E1262),
  1378. object,
  1379. pointer_default(unique)
  1380. ]
  1381. interface IShellView2 : IShellView
  1382. {
  1383. typedef GUID SHELLVIEWID;
  1384. cpp_quote("#define SV2GV_CURRENTVIEW ((UINT)-1)")
  1385. cpp_quote("#define SV2GV_DEFAULTVIEW ((UINT)-2)")
  1386. //
  1387. // NOTE if the cbSize param is ever updated,")
  1388. // then there will have to be custom [wire_marshal]")
  1389. // implementation to support it")
  1390. //
  1391. cpp_quote("#include <pshpack8.h>")
  1392. typedef struct _SV2CVW2_PARAMS
  1393. {
  1394. DWORD cbSize;
  1395. IShellView *psvPrev;
  1396. LPCFOLDERSETTINGS pfs;
  1397. IShellBrowser *psbOwner;
  1398. RECT *prcView;
  1399. SHELLVIEWID const *pvid;
  1400. HWND hwndView;
  1401. } SV2CVW2_PARAMS, *LPSV2CVW2_PARAMS;
  1402. cpp_quote("#include <poppack.h>") // Return to byte packing
  1403. HRESULT GetView(
  1404. [in, out] SHELLVIEWID* pvid,
  1405. [in] ULONG uView);
  1406. HRESULT CreateViewWindow2(
  1407. [in] LPSV2CVW2_PARAMS lpParams);
  1408. HRESULT HandleRename(
  1409. [in, unique] PCUITEMID_CHILD pidlNew);
  1410. HRESULT SelectAndPositionItem(
  1411. [in, unique] PCUITEMID_CHILD pidlItem,
  1412. [in] UINT /* SVSIF */ uFlags,
  1413. [in, unique] POINT *ppt);
  1414. }
  1415. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  1416. [
  1417. uuid(ec39fa88-f8af-41c5-8421-38bed28f4673),
  1418. object,
  1419. pointer_default(unique)
  1420. ]
  1421. interface IShellView3 : IShellView2
  1422. {
  1423. [v1_enum] enum _SV3CVW3_FLAGS
  1424. {
  1425. SV3CVW3_DEFAULT = 0x00000000,
  1426. SV3CVW3_NONINTERACTIVE = 0x00000001, // Instead of bringing up UI, fail silently.
  1427. SV3CVW3_FORCEVIEWMODE = 0x00000002, // Prefer view mode set by CreateViewWindow3 over saved view state
  1428. SV3CVW3_FORCEFOLDERFLAGS = 0x00000004, // Prefer folder flags set by CreateViewWindow3 over saved view state
  1429. };
  1430. typedef DWORD SV3CVW3_FLAGS;
  1431. HRESULT CreateViewWindow3(
  1432. [in] IShellBrowser *psbOwner,
  1433. [in, unique] IShellView *psvPrev,
  1434. [in] SV3CVW3_FLAGS dwViewFlags,
  1435. [in] FOLDERFLAGS dwMask,
  1436. [in] FOLDERFLAGS dwFlags,
  1437. [in] FOLDERVIEWMODE fvMode,
  1438. [in, unique] const SHELLVIEWID *pvid,
  1439. [in] const RECT *prcView,
  1440. [out] HWND *phwndView);
  1441. }
  1442. cpp_quote("#endif // NTDDI_VISTA")
  1443. // this is to handle name collisions
  1444. cpp_quote("#ifdef _FIX_ENABLEMODELESS_CONFLICT")
  1445. cpp_quote("#undef EnableModeless ")
  1446. cpp_quote("#endif")
  1447. [
  1448. uuid(cde725b0-ccc9-4519-917e-325d72fab4ce),
  1449. object,
  1450. pointer_default(unique)
  1451. ]
  1452. interface IFolderView : IUnknown
  1453. {
  1454. HRESULT GetCurrentViewMode([out] UINT /* FOLDERVIEWMODE */ *pViewMode);
  1455. HRESULT SetCurrentViewMode([in] UINT /* FOLDERVIEWMODE */ ViewMode);
  1456. // the folder for the view, returns IShellFolder and related interfaces
  1457. // also supports IShellItemArray that returns an array with a single item for the folder
  1458. HRESULT GetFolder(
  1459. [in] REFIID riid,
  1460. [out, iid_is(riid)] void **ppv);
  1461. HRESULT Item(
  1462. [in] int iItemIndex,
  1463. [out] PITEMID_CHILD *ppidl);
  1464. // get the count of items for selection, total, etc
  1465. HRESULT ItemCount(
  1466. [in] UINT /* SVGIO */ uFlags,
  1467. [out] int *pcItems);
  1468. // get the items in the view in the form of IShellItemArray, IDataObject, etc
  1469. HRESULT Items(
  1470. [in] UINT /* SVGIO */ uFlags,
  1471. [in] REFIID riid,
  1472. [out, iid_is(riid)] void **ppv);
  1473. HRESULT GetSelectionMarkedItem([out] int *piItem);
  1474. HRESULT GetFocusedItem([out] int *piItem);
  1475. HRESULT GetItemPosition(
  1476. [in] PCUITEMID_CHILD pidl,
  1477. [out] POINT* ppt);
  1478. HRESULT GetSpacing([in, out, unique] POINT* ppt);
  1479. HRESULT GetDefaultSpacing([out] POINT* ppt);
  1480. // returns S_OK if AutoArrange is on, S_FALSE if off
  1481. HRESULT GetAutoArrange();
  1482. // like IShellView::SelectItem() by index, SVSI_ flags
  1483. HRESULT SelectItem(
  1484. [in] int iItem,
  1485. [in] DWORD /* SVSIF */ dwFlags);
  1486. #ifdef ALLOW_DISABLE_CONSISTENCY_CHECK
  1487. HRESULT SelectAndPositionItems(
  1488. [in] UINT cidl,
  1489. [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl,
  1490. [disable_consistency_check, in, unique, size_is(cidl)] POINT* apt,
  1491. [in] DWORD /* SVSIF */ dwFlags);
  1492. #else
  1493. HRESULT SelectAndPositionItems(
  1494. [in] UINT cidl,
  1495. [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl,
  1496. [in, unique, size_is(cidl)] POINT* apt,
  1497. [in] DWORD /* SVSIF */ dwFlags);
  1498. #endif
  1499. }
  1500. cpp_quote("#define SID_SFolderView IID_IFolderView // folder view, usually IFolderView")
  1501. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WIN7)")
  1502. // to discover the search box, use IServiceProvider::QueryService() using SID_SSearchBoxInfo on a site pointer within the explorer window
  1503. [
  1504. uuid(6af6e03f-d664-4ef4-9626-f7e0ed36755e),
  1505. object
  1506. ]
  1507. interface ISearchBoxInfo : IUnknown
  1508. {
  1509. HRESULT GetCondition(
  1510. [in] REFIID riid,
  1511. [out, iid_is(riid)] void **ppv);
  1512. HRESULT GetText([out, string] LPWSTR *ppsz);
  1513. }
  1514. cpp_quote("#endif // (NTDDI_VERSION >= NTDDI_WIN7)")
  1515. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA) || (_WIN32_IE >= _WIN32_IE_IE70)")
  1516. cpp_quote("#ifndef NO_SHOBJIDL_SORTDIRECTION")
  1517. [v1_enum] enum tagSORTDIRECTION
  1518. {
  1519. SORT_DESCENDING = -1,
  1520. SORT_ASCENDING = 1
  1521. };
  1522. cpp_quote("#endif // NO_SHOBJIDL_SORTDIRECTION")
  1523. typedef int SORTDIRECTION;
  1524. typedef struct SORTCOLUMN
  1525. {
  1526. PROPERTYKEY propkey;
  1527. SORTDIRECTION direction;
  1528. } SORTCOLUMN;
  1529. typedef [v1_enum] enum FVTEXTTYPE
  1530. {
  1531. FVST_EMPTYTEXT = 0,
  1532. } FVTEXTTYPE;
  1533. interface IShellItemArray;
  1534. typedef HRESULT DEPRECATED_HRESULT;
  1535. cpp_quote("#if defined(__cplusplus)")
  1536. cpp_quote("#define DEPRECATED_HRESULT HRESULT DECLSPEC_DEPRECATED")
  1537. cpp_quote("#endif")
  1538. [
  1539. uuid(1af3a467-214f-4298-908e-06b03e0b39f9),
  1540. object,
  1541. pointer_default(unique)
  1542. ]
  1543. interface IFolderView2 : IFolderView
  1544. {
  1545. // Sets the group by property and starts a grouping operation
  1546. HRESULT SetGroupBy(
  1547. [in] REFPROPERTYKEY key,
  1548. [in] BOOL fAscending);
  1549. [local]
  1550. HRESULT GetGroupBy(
  1551. [out, annotation("__out")] PROPERTYKEY* pkey,
  1552. [out, annotation("__out_opt")] BOOL *pfAscending);
  1553. [call_as(GetGroupBy)]
  1554. HRESULT RemoteGetGroupBy(
  1555. [out] PROPERTYKEY* pkey,
  1556. [out] BOOL *pfAscending);
  1557. // Setting and Getting per item view properties is not possible for Libraries or Search results views.
  1558. // Consider using existing item properties instead.
  1559. DEPRECATED_HRESULT SetViewProperty(
  1560. [in] PCUITEMID_CHILD pidl,
  1561. [in] REFPROPERTYKEY propkey,
  1562. [in] REFPROPVARIANT propvar);
  1563. // Setting and Getting per item view properties is not possible for Libraries or Search results views.
  1564. // Consider using existing item properties instead.
  1565. DEPRECATED_HRESULT GetViewProperty(
  1566. [in] PCUITEMID_CHILD pidl,
  1567. [in] REFPROPERTYKEY propkey,
  1568. [out] PROPVARIANT *ppropvar);
  1569. // Setting per item Tile view properties is not possible for Libraries or Search results views.
  1570. // Consider setting property lists for your item types instead (see PKEY_PropList_TileInfo)
  1571. DEPRECATED_HRESULT SetTileViewProperties(
  1572. [in] PCUITEMID_CHILD pidl,
  1573. [in, string] LPCWSTR pszPropList);
  1574. // Setting per item Extended Tile view properties is not possible for Libraries or Search results views.
  1575. // Consider setting property lists for your item types instead (see PKEY_PropList_ExtendedTileInfo)
  1576. DEPRECATED_HRESULT SetExtendedTileViewProperties(
  1577. [in] PCUITEMID_CHILD pidl,
  1578. [in, string] LPCWSTR pszPropList);
  1579. HRESULT SetText(
  1580. [in] FVTEXTTYPE iType,
  1581. [in] LPCWSTR pwszText);
  1582. HRESULT SetCurrentFolderFlags(
  1583. [in] DWORD /* FOLDERFLAGS */ dwMask,
  1584. [in] DWORD /* FOLDERFLAGS */ dwFlags);
  1585. HRESULT GetCurrentFolderFlags([out] DWORD /* FOLDERFLAGS */ *pdwFlags);
  1586. HRESULT GetSortColumnCount([out] int *pcColumns);
  1587. // Sets the sort by property and starts a sort operation
  1588. HRESULT SetSortColumns(
  1589. [in, size_is(cColumns)] const SORTCOLUMN *rgSortColumns,
  1590. [in] int cColumns);
  1591. HRESULT GetSortColumns(
  1592. [out, size_is(cColumns)] SORTCOLUMN *rgSortColumns,
  1593. [in] int cColumns);
  1594. // return IShellItem for an item based on its index
  1595. HRESULT GetItem(
  1596. [in] int iItem,
  1597. [in] REFIID riid,
  1598. [out, iid_is(riid)] void **ppv);
  1599. HRESULT GetVisibleItem(
  1600. [in] int iStart,
  1601. [in] BOOL fPrevious,
  1602. [out] int *piItem);
  1603. HRESULT GetSelectedItem(
  1604. [in] int iStart,
  1605. [out] int *piItem);
  1606. HRESULT GetSelection(
  1607. [in] BOOL fNoneImpliesFolder,
  1608. [out] IShellItemArray **ppsia);
  1609. // Gets the selection state including check state. Same as the flags for IFolderView::SelectAndPositionItems
  1610. HRESULT GetSelectionState(
  1611. [in] PCUITEMID_CHILD pidl,
  1612. [out] DWORD /* SVSIF */ *pdwFlags);
  1613. // If pszVerb is NULL, then the default verb is invoked.
  1614. HRESULT InvokeVerbOnSelection([in, unique, string] LPCSTR pszVerb);
  1615. // Sets default icon size if iImageSize == -1
  1616. HRESULT SetViewModeAndIconSize(
  1617. [in] FOLDERVIEWMODE uViewMode,
  1618. [in] int iImageSize);
  1619. HRESULT GetViewModeAndIconSize(
  1620. [out] FOLDERVIEWMODE *puViewMode,
  1621. [out] int *piImageSize);
  1622. HRESULT SetGroupSubsetCount([in] UINT cVisibleRows);
  1623. HRESULT GetGroupSubsetCount([out] UINT *pcVisibleRows);
  1624. HRESULT SetRedraw([in] BOOL fRedrawOn);
  1625. // S_OK means this view sourced the current drag drop or cut/paste operation (used by drop target objects)
  1626. HRESULT IsMoveInSameFolder();
  1627. HRESULT DoRename();
  1628. }
  1629. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  1630. [
  1631. uuid(ae8c987d-8797-4ed3-be72-2a47dd938db0),
  1632. object
  1633. ]
  1634. interface IFolderViewSettings : IUnknown
  1635. {
  1636. // GetColumnPropertyList - returns IPropertyDescriptionList. Ordered list of columns that must correspond to column enumerated
  1637. // via ISF::GetDetailsOf. Any column from ISF::GetDetailsOf not included in this list will be marked SHCOLSTATE_SECONDARYUI
  1638. // (or maintain SHCOLSTATE_HIDDEN)
  1639. HRESULT GetColumnPropertyList(
  1640. [in] REFIID riid,
  1641. [out, iid_is(riid)] void **ppv);
  1642. HRESULT GetGroupByProperty(
  1643. [out] PROPERTYKEY *pkey,
  1644. [out] BOOL *pfGroupAscending);
  1645. HRESULT GetViewMode(
  1646. [out] FOLDERLOGICALVIEWMODE *plvm);
  1647. HRESULT GetIconSize(
  1648. [out] UINT *puIconSize);
  1649. HRESULT GetFolderFlags(
  1650. [out] FOLDERFLAGS *pfolderMask,
  1651. [out] FOLDERFLAGS *pfolderFlags);
  1652. HRESULT GetSortColumns(
  1653. [out, size_is(cColumnsIn), length_is(*pcColumnsOut)] SORTCOLUMN *rgSortColumns,
  1654. [in] UINT cColumnsIn,
  1655. [out] UINT *pcColumnsOut);
  1656. HRESULT GetGroupSubsetCount([out] UINT *pcVisibleRows);
  1657. };
  1658. cpp_quote("#endif // NTDDI_VISTA")
  1659. cpp_quote("#endif // (_WIN32_IE >= _WIN32_IE_IE70)")
  1660. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  1661. [
  1662. object,
  1663. uuid(196bf9a5-b346-4ef0-aa1e-5dcdb76768b1),
  1664. pointer_default(unique)
  1665. ]
  1666. interface IPreviewHandlerVisuals : IUnknown
  1667. {
  1668. HRESULT SetBackgroundColor([in] COLORREF color);
  1669. HRESULT SetFont([in] const LOGFONTW *plf);
  1670. HRESULT SetTextColor([in] COLORREF color);
  1671. };
  1672. [
  1673. uuid(e693cf68-d967-4112-8763-99172aee5e5a),
  1674. object,
  1675. pointer_default(unique)
  1676. ]
  1677. interface IVisualProperties : IUnknown
  1678. {
  1679. typedef [v1_enum] enum VPWATERMARKFLAGS
  1680. {
  1681. VPWF_DEFAULT = 0x00000000, // Windows XP behavior
  1682. VPWF_ALPHABLEND = 0x00000001, // alpha blend the bitmap, assumed 24-bit color + 8-bit alpha
  1683. } VPWATERMARKFLAGS;
  1684. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(VPWATERMARKFLAGS)")
  1685. HRESULT SetWatermark([in, unique] HBITMAP hbmp, [in] VPWATERMARKFLAGS vpwf);
  1686. typedef [v1_enum] enum VPCOLORFLAGS
  1687. {
  1688. VPCF_TEXT = 1,
  1689. VPCF_BACKGROUND = 2,
  1690. VPCF_SORTCOLUMN = 3,
  1691. VPCF_SUBTEXT = 4,
  1692. VPCF_TEXTBACKGROUND = 5,
  1693. } VPCOLORFLAGS; // misnamed, this is not a flags type
  1694. HRESULT SetColor(
  1695. [in] VPCOLORFLAGS vpcf,
  1696. [in] COLORREF cr);
  1697. HRESULT GetColor(
  1698. [in] VPCOLORFLAGS vpcf,
  1699. [out] COLORREF *pcr);
  1700. HRESULT SetItemHeight([in] int cyItemInPixels);
  1701. HRESULT GetItemHeight([out] int *cyItemInPixels);
  1702. HRESULT SetFont(
  1703. [in] const LOGFONTW* plf,
  1704. [in] BOOL bRedraw);
  1705. HRESULT GetFont([out] LOGFONTW* plf);
  1706. HRESULT SetTheme(
  1707. [in, unique, string] LPCWSTR pszSubAppName,
  1708. [in, unique, string] LPCWSTR pszSubIdList);
  1709. }
  1710. cpp_quote("#endif // _WIN32_IE_IE70")
  1711. //-------------------------------------------------------------------------
  1712. // ICommDlgBrowser interface
  1713. //
  1714. // ICommDlgBrowser interface is the interface that is provided by the new
  1715. // common dialog window to hook and modify the behavior of IShellView. When
  1716. // a default view is created, it queries its parent IShellBrowser for the
  1717. // ICommDlgBrowser interface. If supported, it calls out to that interface
  1718. // in several cases that need to behave differently in a dialog.
  1719. //
  1720. // Member functions:
  1721. //
  1722. // ICommDlgBrowser::OnDefaultCommand()
  1723. // Called when the user double-clicks in the view or presses Enter. The
  1724. // browser should return S_OK if it processed the action itself, S_FALSE
  1725. // to let the view perform the default action.
  1726. //
  1727. // ICommDlgBrowser::OnStateChange(ULONG uChange)
  1728. // Called when some states in the view change. 'uChange' is one of the
  1729. // CDBOSC_* values. This call is made after the state (selection, focus,
  1730. // etc) has changed. There is no return value.
  1731. //
  1732. // ICommDlgBrowser::IncludeObject(PCUITEMID_CHILD pidl)
  1733. // Called when the view is enumerating objects. 'pidl' is a relative
  1734. // IDLIST. The browser should return S_OK to include the object in the
  1735. // view, S_FALSE to hide it
  1736. //
  1737. //-------------------------------------------------------------------------
  1738. cpp_quote("#define CDBOSC_SETFOCUS 0x00000000")
  1739. cpp_quote("#define CDBOSC_KILLFOCUS 0x00000001")
  1740. cpp_quote("#define CDBOSC_SELCHANGE 0x00000002")
  1741. cpp_quote("#define CDBOSC_RENAME 0x00000003")
  1742. cpp_quote("#define CDBOSC_STATECHANGE 0x00000004")
  1743. [
  1744. uuid(000214F1-0000-0000-C000-000000000046),
  1745. object,
  1746. pointer_default(unique)
  1747. ]
  1748. interface ICommDlgBrowser : IUnknown
  1749. {
  1750. HRESULT OnDefaultCommand([in] IShellView *ppshv);
  1751. HRESULT OnStateChange(
  1752. [in] IShellView *ppshv,
  1753. [in] ULONG uChange);
  1754. HRESULT IncludeObject(
  1755. [in, unique] IShellView *ppshv,
  1756. [in] PCUITEMID_CHILD pidl);
  1757. }
  1758. typedef ICommDlgBrowser * LPCOMMDLGBROWSER;
  1759. // This is for frames that may host an ExplorerBrowser (which implements ICommDlgBrowser3), and yet need to implement
  1760. // some ICommDlgBrowser methods themselves. ExplorerBrowser will do some default processing if necessary, and then
  1761. // allow responders to SID_SExplorerBrowserFrame to provide additional processing of these calls, when appropriate.
  1762. cpp_quote("#define SID_SExplorerBrowserFrame IID_ICommDlgBrowser")
  1763. //-------------------------------------------------------------------------
  1764. // ICommDlgBrowser2 interface
  1765. //
  1766. // Member functions:
  1767. //
  1768. // ICommDlgBrowser2::Notify(IShellView *pshv, DWORD dwNotfyType)
  1769. // Called when the view is wants to notify common dialog when an event
  1770. // occurrs.
  1771. //
  1772. // CDB2N_CONTEXTMENU_START indicates the context menu has started.
  1773. // CDB2N_CONTEXTMENU_DONE indicates the context menu has completed.
  1774. //
  1775. // ICommDlgBrowser2::GetDefaultMenuText(IShellView *pshv,
  1776. // WCHAR *pszText, INT cchMax)
  1777. // Called when the view wants to get the default context menu text.
  1778. // pszText points to buffer and cchMax specifies the size of the
  1779. // buffer in characters. The browser on return has filled the buffer
  1780. // with the default context menu text. The Shell will call this method
  1781. // with at least a buffer size of MAX_PATH. The browser should return
  1782. // S_OK if it returned a new default menu text, S_FALSE to let the view
  1783. // to use the normal default menu text.
  1784. //
  1785. // ICommDlgBrowser2::GetViewFlags(DWORD *pdwFlags)
  1786. // Called when the view wants to determine if special customization needs to
  1787. // be done for the common dialog browser. For example View calls this function to
  1788. // determin if all files(hidden and system)needs to be shown. If the GetViewFlags returns a DWORD with
  1789. // CDB2GVF_SHOWALLFILES flag set then it will show all the files.
  1790. //-------------------------------------------------------------------------
  1791. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WIN2K)")
  1792. cpp_quote("#define CDB2N_CONTEXTMENU_DONE 0x00000001")
  1793. cpp_quote("#define CDB2N_CONTEXTMENU_START 0x00000002")
  1794. //GetViewFlags
  1795. cpp_quote("#define CDB2GVF_SHOWALLFILES 0x00000001")
  1796. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  1797. cpp_quote("#define CDB2GVF_ISFILESAVE 0x00000002 // is file save, else file open")
  1798. cpp_quote("#define CDB2GVF_ALLOWPREVIEWPANE 0x00000004")
  1799. cpp_quote("#define CDB2GVF_NOSELECTVERB 0x00000008")
  1800. cpp_quote("#define CDB2GVF_NOINCLUDEITEM 0x00000010")
  1801. cpp_quote("#define CDB2GVF_ISFOLDERPICKER 0x00000020")
  1802. cpp_quote("#define CDB2GVF_ADDSHIELD 0x00000040 // when CDB2GVF_NOSELECTVERB is not specified this flag controls the display of a LUA shield on the Select menu item")
  1803. cpp_quote("#endif // NTDDI_VISTA")
  1804. [
  1805. uuid(10339516-2894-11d2-9039-00C04F8EEB3E),
  1806. object,
  1807. pointer_default(unique)
  1808. ]
  1809. interface ICommDlgBrowser2 : ICommDlgBrowser
  1810. {
  1811. HRESULT Notify(
  1812. [in] IShellView *ppshv,
  1813. [in] DWORD dwNotifyType);
  1814. HRESULT GetDefaultMenuText(
  1815. [in] IShellView *ppshv,
  1816. [out, string, size_is(cchMax)] LPWSTR pszText,
  1817. [in] int cchMax);
  1818. // returns CDB2GVF_XXX values to control the behavior of the view when in common dialog mode
  1819. HRESULT GetViewFlags([out] DWORD *pdwFlags);
  1820. }
  1821. typedef ICommDlgBrowser2 * LPCOMMDLGBROWSER2;
  1822. cpp_quote("#endif // NTDDI_WIN2K")
  1823. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  1824. [
  1825. uuid(c8ad25a1-3294-41ee-8165-71174bd01c57),
  1826. object,
  1827. pointer_default(unique)
  1828. ]
  1829. interface ICommDlgBrowser3 : ICommDlgBrowser2
  1830. {
  1831. HRESULT OnColumnClicked(
  1832. [in] IShellView *ppshv,
  1833. [in] int iColumn);
  1834. HRESULT GetCurrentFilter(
  1835. [out, string, size_is(cchFileSpec)] LPWSTR pszFileSpec,
  1836. [in] int cchFileSpec);
  1837. HRESULT OnPreViewCreated([in] IShellView *ppshv);
  1838. }
  1839. //--------------------------------------------------------------------------
  1840. //
  1841. // Interface: IColumnManager
  1842. //
  1843. // IColumnManager is an interfaced provided by defview to
  1844. // allow the manipulation of columns in details view.
  1845. //
  1846. typedef [v1_enum] enum CM_MASK
  1847. {
  1848. CM_MASK_WIDTH = 0x00000001,
  1849. CM_MASK_DEFAULTWIDTH = 0x00000002,
  1850. CM_MASK_IDEALWIDTH = 0x00000004,
  1851. CM_MASK_NAME = 0x00000008,
  1852. CM_MASK_STATE = 0x00000010,
  1853. } CM_MASK;
  1854. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(CM_MASK)")
  1855. typedef [v1_enum] enum CM_STATE
  1856. {
  1857. CM_STATE_NONE = 0x00000000,
  1858. CM_STATE_VISIBLE = 0x00000001, // The column is visible
  1859. CM_STATE_FIXEDWIDTH = 0x00000002, // Can't resize the column
  1860. CM_STATE_NOSORTBYFOLDERNESS = 0x00000004, // Do not sort folders seperately
  1861. CM_STATE_ALWAYSVISIBLE = 0x00000008, // readonly. column cannot be hidden
  1862. } CM_STATE;
  1863. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(CM_STATE)")
  1864. typedef [v1_enum] enum CM_ENUM_FLAGS
  1865. {
  1866. CM_ENUM_ALL = 0x00000001,
  1867. CM_ENUM_VISIBLE = 0x00000002,
  1868. } CM_ENUM_FLAGS;
  1869. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(CM_ENUM_FLAGS)")
  1870. typedef [v1_enum] enum CM_SET_WIDTH_VALUE
  1871. {
  1872. CM_WIDTH_USEDEFAULT = -1,
  1873. CM_WIDTH_AUTOSIZE = -2,
  1874. } CM_SET_WIDTH_VALUE;
  1875. #define MAX_COLUMN_NAME_LEN 80
  1876. typedef struct CM_COLUMNINFO
  1877. {
  1878. DWORD cbSize; // size in bytes of struct
  1879. DWORD dwMask; // CM_MASK
  1880. DWORD dwState; // CM_STATE
  1881. UINT uWidth; // CM_MASK_WIDTH, for SetColumnInfo it can be a CM_SET_WIDTH_VALUE
  1882. UINT uDefaultWidth; // CM_MASK_DEFAULTWIDTH
  1883. UINT uIdealWidth; // CM_MASK_IDEALWIDTH
  1884. WCHAR wszName[MAX_COLUMN_NAME_LEN];
  1885. } CM_COLUMNINFO;
  1886. [
  1887. uuid(d8ec27bb-3f3b-4042-b10a-4acfd924d453),
  1888. object,
  1889. pointer_default(unique)
  1890. ]
  1891. interface IColumnManager : IUnknown
  1892. {
  1893. HRESULT SetColumnInfo(
  1894. [in] REFPROPERTYKEY propkey,
  1895. [in] const CM_COLUMNINFO *pcmci);
  1896. HRESULT GetColumnInfo(
  1897. [in] REFPROPERTYKEY propkey,
  1898. [out] CM_COLUMNINFO *pcmci);
  1899. HRESULT GetColumnCount(
  1900. [in] CM_ENUM_FLAGS dwFlags,
  1901. [out] UINT *puCount);
  1902. HRESULT GetColumns(
  1903. [in] CM_ENUM_FLAGS dwFlags,
  1904. [out, size_is(cColumns)] PROPERTYKEY *rgkeyOrder,
  1905. [in] UINT cColumns);
  1906. HRESULT SetColumns(
  1907. [in, size_is(cVisible)] const PROPERTYKEY *rgkeyOrder,
  1908. [in] UINT cVisible);
  1909. }
  1910. cpp_quote("#endif // (_WIN32_IE >= _WIN32_IE_IE70)")
  1911. // New for XP, but used by downlevel code
  1912. //cpp_quote("#if (NTDDI_VERSION >= NTDDI_WINXP)")
  1913. [
  1914. uuid(C0A651F5-B48B-11d2-B5ED-006097C686F6), // IID_IFolderFilterSite
  1915. object,
  1916. pointer_default(unique)
  1917. ]
  1918. interface IFolderFilterSite : IUnknown
  1919. {
  1920. HRESULT SetFilter([in]IUnknown* punk);
  1921. }
  1922. [
  1923. uuid(9CC22886-DC8E-11d2-B1D0-00C04F8EEB3E), // IID_IFolderFilter
  1924. object,
  1925. pointer_default(unique)
  1926. ]
  1927. interface IFolderFilter : IUnknown
  1928. {
  1929. HRESULT ShouldShow(
  1930. [in] IShellFolder* psf,
  1931. [in, unique] PCIDLIST_ABSOLUTE pidlFolder,
  1932. [in] PCUITEMID_CHILD pidlItem);
  1933. HRESULT GetEnumFlags(
  1934. [in] IShellFolder* psf,
  1935. [in] PCIDLIST_ABSOLUTE pidlFolder,
  1936. [out] HWND *phwnd,
  1937. [in, out] DWORD *pgrfFlags);
  1938. }
  1939. //cpp_quote("#endif // NTDDI_WINXP")
  1940. //==========================================================================
  1941. // IInputObjectSite/IInputObject interfaces
  1942. //
  1943. // These interfaces allow us (or ISVs) to install/update external Internet
  1944. // Toolbar for IE and the shell. The frame will simply get the CLSID from
  1945. // registry (to be defined) and CoCreateInstance it.
  1946. //
  1947. //==========================================================================
  1948. // A site implements this interface so the object can communicate
  1949. // focus change to it.
  1950. [
  1951. object,
  1952. uuid(F1DB8392-7331-11D0-8C99-00A0C92DBFE8),
  1953. pointer_default(unique),
  1954. ]
  1955. interface IInputObjectSite: IUnknown
  1956. {
  1957. // Object (punkObj) is getting or losing the focus.
  1958. HRESULT OnFocusChangeIS([in, unique] IUnknown* punkObj, [in] BOOL fSetFocus);
  1959. }
  1960. [
  1961. object,
  1962. uuid(68284fAA-6A48-11D0-8c78-00C04fd918b4),
  1963. pointer_default(unique)
  1964. ]
  1965. interface IInputObject: IUnknown
  1966. {
  1967. // Activates or deactivates the object. lpMsg may be NULL. Returns
  1968. // S_OK if the activation succeeded.
  1969. HRESULT UIActivateIO([in] BOOL fActivate, [in, unique] MSG *pMsg);
  1970. // Returns S_OK if the object has the focus, S_FALSE if not.
  1971. HRESULT HasFocusIO();
  1972. // Allow the object to process the message. Returns S_OK if the
  1973. // message was processed (eaten).
  1974. HRESULT TranslateAcceleratorIO([in] MSG *pMsg);
  1975. }
  1976. // New for Vista, but used by downlevel code
  1977. //cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  1978. [
  1979. object,
  1980. uuid(6915C085-510B-44cd-94AF-28DFA56CF92B),
  1981. pointer_default(unique),
  1982. local
  1983. ]
  1984. interface IInputObject2 : IInputObject
  1985. {
  1986. // Called to handle global accelerators, so that input objects can
  1987. // respond to keyboard even when they are not UI active.
  1988. //
  1989. // Note that pMsg is not const, to allow implementors to forward to the
  1990. // Win32 TranslateAccelerator without having to cast away const-ness.
  1991. HRESULT TranslateAcceleratorGlobal([in, annotation("__in")] MSG *pMsg);
  1992. }
  1993. //cpp_quote("#endif // NTDDI_VISTA")
  1994. //===========================================================================
  1995. //
  1996. // IShellIcon Interface
  1997. //
  1998. // used to get a icon index for a IShellFolder object.
  1999. //
  2000. // this interface can be implemented by a IShellFolder, as a quick way to
  2001. // return the icon for a object in the folder.
  2002. //
  2003. // a instance of this interface is only created once for the folder, unlike
  2004. // IExtractIcon witch is created once for each object.
  2005. //
  2006. // if a ShellFolder does not implement this interface, the standard
  2007. // GetUIObject(....IExtractIcon) method will be used to get a icon
  2008. // for all objects.
  2009. //
  2010. // the following standard imagelist indexs can be returned:
  2011. //
  2012. // 0 document (blank page) (not associated)
  2013. // 1 document (with stuff on the page)
  2014. // 2 application (exe, com, bat)
  2015. // 3 folder (plain)
  2016. // 4 folder (open)
  2017. //
  2018. // IShellIcon:GetIconOf(pidl, flags, lpIconIndex)
  2019. //
  2020. // pidl object to get icon for.
  2021. // flags GIL_* input flags (GIL_OPEN, ...)
  2022. // lpIconIndex place to return icon index.
  2023. //
  2024. // returns:
  2025. // S_OK, if lpIconIndex contains the correct system imagelist index.
  2026. // S_FALSE, if unable to get icon for this object, go through
  2027. // GetUIObject, IExtractIcon, methods.
  2028. //
  2029. //===========================================================================
  2030. [
  2031. uuid(000214E5-0000-0000-C000-000000000046), // IID_IShellIcon
  2032. object,
  2033. pointer_default(unique)
  2034. ]
  2035. interface IShellIcon : IUnknown
  2036. {
  2037. HRESULT GetIconOf(
  2038. [in] PCUITEMID_CHILD pidl,
  2039. [in] UINT flags,
  2040. [out] int *pIconIndex);
  2041. }
  2042. //--------------------------------------------------------------------------
  2043. //
  2044. // Interface: IShellBrowser
  2045. //
  2046. // IShellBrowser interface is the interface that is provided by the shell
  2047. // explorer/folder frame window. When it creates the 'contents pane' of
  2048. // a shell folder (which provides IShellFolder interface), it calls its
  2049. // CreateViewObject member function to create an IShellView object. Then,
  2050. // it calls its CreateViewWindow member to create the 'contents pane'
  2051. // window. The pointer to the IShellBrowser interface is passed to
  2052. // the IShellView object as a parameter to this CreateViewWindow member
  2053. // function call.
  2054. //
  2055. // +--------------------------+ <-- Explorer window
  2056. // | [] Explorer |
  2057. // |--------------------------+ IShellBrowser
  2058. // | File Edit View .. |
  2059. // |--------------------------|
  2060. // | | |
  2061. // | | <-------- Content pane
  2062. // | | |
  2063. // | | | IShellView
  2064. // | | |
  2065. // | | |
  2066. // +--------------------------+
  2067. //
  2068. //
  2069. //
  2070. // [Member functions]
  2071. //
  2072. //
  2073. // IShellBrowser::GetWindow(phwnd)
  2074. //
  2075. // Inherited from IOleWindow::GetWindow.
  2076. //
  2077. //
  2078. // IShellBrowser::ContextSensitiveHelp(fEnterMode)
  2079. //
  2080. // Inherited from IOleWindow::ContextSensitiveHelp.
  2081. //
  2082. //
  2083. // IShellBrowser::InsertMenusSB(hmenuShared, lpMenuWidths)
  2084. //
  2085. // Similar to the IOleInPlaceFrame::InsertMenus. The explorer will put
  2086. // 'File' and 'Edit' pulldown in the File menu group, 'View' and 'Tools'
  2087. // in the Container menu group and 'Help' in the Window menu group. Each
  2088. // pulldown menu will have a uniqu ID, FCIDM_MENU_FILE/EDIT/VIEW/TOOLS/HELP
  2089. // The view is allowed to insert menuitems into those sub-menus by those
  2090. // IDs must be between FCIDM_SHVIEWFIRST and FCIDM_SHVIEWLAST.
  2091. //
  2092. //
  2093. // IShellBrowser::SetMenuSB(hmenuShared, holemenu, hwndActiveObject)
  2094. //
  2095. // Similar to the IOleInPlaceFrame::SetMenu. The explorer ignores the
  2096. // holemenu parameter (reserved for future enhancement) and performs
  2097. // menu-dispatch based on the menuitem IDs (see the description above).
  2098. // It is important to note that the explorer will add different
  2099. // set of menuitems depending on whether the view has a focus or not.
  2100. // Therefore, it is very important to call ISB::OnViewWindowActivate
  2101. // whenever the view window (or its children) gets the focus.
  2102. //
  2103. //
  2104. // IShellBrowser::RemoveMenusSB(hmenuShared)
  2105. //
  2106. // Same as the IOleInPlaceFrame::RemoveMenus.
  2107. //
  2108. //
  2109. // IShellBrowser::SetStatusTextSB(pszStatusText)
  2110. //
  2111. // Same as the IOleInPlaceFrame::SetStatusText. It is also possible to
  2112. // send messages directly to the status window via SendControlMsg.
  2113. //
  2114. //
  2115. // IShellBrowser::EnableModelessSB(fEnable)
  2116. //
  2117. // Same as the IOleInPlaceFrame::EnableModeless.
  2118. //
  2119. //
  2120. // IShellBrowser::TranslateAcceleratorSB(lpmsg, wID)
  2121. //
  2122. // Same as the IOleInPlaceFrame::TranslateAccelerator, but will be
  2123. // never called because we don't support EXEs (i.e., the explorer has
  2124. // the message loop). This member function is defined here for possible
  2125. // future enhancement.
  2126. //
  2127. //
  2128. // IShellBrowser::BrowseObject(pidl, wFlags)")
  2129. //
  2130. // The view calls this member to let shell explorer browse to another")
  2131. // folder. The pidl and wFlags specifies the folder to be browsed.")
  2132. //
  2133. // Following three flags specifies whether it creates another window or not.
  2134. // SBSP_SAMEBROWSER -- Browse to another folder with the same window.
  2135. // SBSP_NEWBROWSER -- Creates another window for the specified folder.
  2136. // SBSP_DEFBROWSER -- Default behavior (respects the view option).
  2137. //
  2138. // Following three flags specifies open, explore, or default mode. These
  2139. // are ignored if SBSP_SAMEBROWSER or (SBSP_DEFBROWSER && (single window
  2140. // browser || explorer)).
  2141. // SBSP_OPENMODE -- Use a normal folder window
  2142. // SBSP_EXPLOREMODE -- Use an explorer window
  2143. // SBSP_DEFMODE -- Use the same as the current window
  2144. //
  2145. // Following three flags specifies the pidl.
  2146. // SBSP_ABSOLUTE -- pidl is an absolute pidl (relative from desktop)
  2147. // SBSP_RELATIVE -- pidl is relative from the current folder.
  2148. // SBSP_PARENT -- Browse the parent folder (ignores the pidl)
  2149. // SBSP_NAVIGATEBACK -- Navigate back (ignores the pidl)
  2150. // SBSP_NAVIGATEFORWARD -- Navigate forward (ignores the pidl)
  2151. //
  2152. // Following two flags control history manipulation as result of navigate
  2153. // SBSP_WRITENOHISTORY -- write no history (shell folder) entry
  2154. // SBSP_NOAUTOSELECT -- suppress selection in history pane
  2155. //
  2156. //
  2157. // IShellBrowser::GetViewStateStream(grfMode, ppstm)
  2158. //
  2159. // The browser returns an IStream interface as the storage for view
  2160. // specific state information.
  2161. //
  2162. // grfMode -- Specifies the read/write access (STGM_READ/WRITE/READWRITE)
  2163. // ppstm -- Specifies the IStream *variable to be filled.
  2164. //
  2165. //
  2166. // IShellBrowser::GetControlWindow(id, phwnd)
  2167. //
  2168. // The shell view may call this member function to get the window handle
  2169. // of Explorer controls (toolbar or status winodw -- FCW_TOOLBAR or
  2170. // FCW_STATUS).
  2171. //
  2172. //
  2173. // IShellBrowser::SendControlMsg(id, uMsg, wParam, lParam, pret)
  2174. //
  2175. // The shell view calls this member function to send control messages to
  2176. // one of Explorer controls (toolbar or status window -- FCW_TOOLBAR or
  2177. // FCW_STATUS).
  2178. //
  2179. //
  2180. // IShellBrowser::QueryActiveShellView(IShellView * ppshv)
  2181. //
  2182. // This member returns currently activated (displayed) shellview object.
  2183. // A shellview never need to call this member function.
  2184. //
  2185. //
  2186. // IShellBrowser::OnViewWindowActive(pshv)
  2187. //
  2188. // The shell view window calls this member function when the view window
  2189. // (or one of its children) got the focus. It MUST call this member before
  2190. // calling IShellBrowser::InsertMenus, because it will insert different
  2191. // set of menu items depending on whether the view has the focus or not.
  2192. //
  2193. //
  2194. // IShellBrowser::SetToolbarItems(lpButtons, nButtons, uFlags)
  2195. //
  2196. // The view calls this function to add toolbar items to the exporer's
  2197. // toolbar. 'lpButtons' and 'nButtons' specifies the array of toolbar
  2198. // items. 'uFlags' must be one of FCT_MERGE, FCT_CONFIGABLE, FCT_ADDTOEND.
  2199. //
  2200. //-------------------------------------------------------------------------
  2201. //
  2202. // flag values to be combined for the Flags parameter of IShellBrowser::BrowseObject() method
  2203. //
  2204. cpp_quote("#define SBSP_DEFBROWSER 0x0000")
  2205. cpp_quote("#define SBSP_SAMEBROWSER 0x0001")
  2206. cpp_quote("#define SBSP_NEWBROWSER 0x0002")
  2207. cpp_quote("#define SBSP_DEFMODE 0x0000")
  2208. cpp_quote("#define SBSP_OPENMODE 0x0010")
  2209. cpp_quote("#define SBSP_EXPLOREMODE 0x0020")
  2210. cpp_quote("#define SBSP_HELPMODE 0x0040")
  2211. cpp_quote("#define SBSP_NOTRANSFERHIST 0x0080")
  2212. cpp_quote("#define SBSP_ABSOLUTE 0x0000")
  2213. cpp_quote("#define SBSP_RELATIVE 0x1000")
  2214. cpp_quote("#define SBSP_PARENT 0x2000")
  2215. cpp_quote("#define SBSP_NAVIGATEBACK 0x4000")
  2216. cpp_quote("#define SBSP_NAVIGATEFORWARD 0x8000")
  2217. cpp_quote("#define SBSP_ALLOW_AUTONAVIGATE 0x00010000")
  2218. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  2219. cpp_quote("#define SBSP_KEEPSAMETEMPLATE 0x00020000")
  2220. cpp_quote("#define SBSP_KEEPWORDWHEELTEXT 0x00040000")
  2221. cpp_quote("#define SBSP_ACTIVATE_NOFOCUS 0x00080000")
  2222. cpp_quote("#define SBSP_CREATENOHISTORY 0x00100000")
  2223. cpp_quote("#define SBSP_PLAYNOSOUND 0x00200000")
  2224. cpp_quote("#endif // (NTDDI_VERSION >= NTDDI_VISTA)")
  2225. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE60SP2)")
  2226. cpp_quote("#define SBSP_CALLERUNTRUSTED 0x00800000")
  2227. cpp_quote("#define SBSP_TRUSTFIRSTDOWNLOAD 0x01000000")
  2228. cpp_quote("#define SBSP_UNTRUSTEDFORDOWNLOAD 0x02000000")
  2229. cpp_quote("#endif // _WIN32_IE_IE60SP2")
  2230. cpp_quote("#define SBSP_NOAUTOSELECT 0x04000000")
  2231. cpp_quote("#define SBSP_WRITENOHISTORY 0x08000000")
  2232. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE60SP2)")
  2233. cpp_quote("#define SBSP_TRUSTEDFORACTIVEX 0x10000000")
  2234. cpp_quote("#endif // _WIN32_IE_IE60SP2")
  2235. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  2236. cpp_quote("#define SBSP_FEEDNAVIGATION 0x20000000")
  2237. cpp_quote("#endif // _WIN32_IE_IE70")
  2238. cpp_quote("#define SBSP_REDIRECT 0x40000000")
  2239. cpp_quote("#define SBSP_INITIATEDBYHLINKFRAME 0x80000000")
  2240. //
  2241. // Values for id parameter of ISB::GetWindow/SendControlMsg members.
  2242. //
  2243. // WARNING:
  2244. // Any shell extensions which sends messages to those control windows
  2245. // might not work in the future version of windows. If you really need
  2246. // to send messages to them, (1) don't assume that those control window
  2247. // always exist (i.e. GetControlWindow may fail) and (2) verify the window
  2248. // class of the window before sending any messages.
  2249. //
  2250. cpp_quote("#define FCW_STATUS 0x0001")
  2251. cpp_quote("#define FCW_TOOLBAR 0x0002")
  2252. cpp_quote("#define FCW_TREE 0x0003")
  2253. cpp_quote("#define FCW_INTERNETBAR 0x0006")
  2254. cpp_quote("#define FCW_PROGRESS 0x0008")
  2255. cpp_quote("#if (_WIN32_IE >= 0x0700)")
  2256. cpp_quote("#endif")
  2257. //
  2258. // Values for uFlags paremeter of ISB::SetToolbarItems member.
  2259. //
  2260. cpp_quote("#define FCT_MERGE 0x0001")
  2261. cpp_quote("#define FCT_CONFIGABLE 0x0002")
  2262. cpp_quote("#define FCT_ADDTOEND 0x0004")
  2263. cpp_quote("#ifdef _NEVER_")
  2264. typedef LPARAM LPTBBUTTONSB;
  2265. cpp_quote("#else //!_NEVER_")
  2266. cpp_quote("#include <commctrl.h>")
  2267. cpp_quote("typedef LPTBBUTTON LPTBBUTTONSB;")
  2268. cpp_quote("#endif //_NEVER_")
  2269. [
  2270. uuid(000214E2-0000-0000-C000-000000000046),
  2271. object,
  2272. pointer_default(unique)
  2273. ]
  2274. interface IShellBrowser : IOleWindow
  2275. {
  2276. // same as IOleInPlaceFrame
  2277. HRESULT InsertMenusSB(
  2278. [in] HMENU hmenuShared,
  2279. [in, out] LPOLEMENUGROUPWIDTHS lpMenuWidths);
  2280. HRESULT SetMenuSB(
  2281. [in, unique] HMENU hmenuShared,
  2282. [in, unique] HOLEMENU holemenuRes,
  2283. [in, unique] HWND hwndActiveObject);
  2284. HRESULT RemoveMenusSB([in] HMENU hmenuShared);
  2285. HRESULT SetStatusTextSB([in, unique] LPCWSTR pszStatusText);
  2286. HRESULT EnableModelessSB([in] BOOL fEnable);
  2287. HRESULT TranslateAcceleratorSB([in] MSG *pmsg, [in] WORD wID);
  2288. // IShellBrowser
  2289. HRESULT BrowseObject(
  2290. [in, unique] PCUIDLIST_RELATIVE pidl,
  2291. [in] UINT wFlags);
  2292. HRESULT GetViewStateStream(
  2293. [in] DWORD grfMode,
  2294. [out] IStream **ppStrm);
  2295. HRESULT GetControlWindow(
  2296. [in] UINT id,
  2297. [out] HWND * phwnd);
  2298. [local] HRESULT SendControlMsg(
  2299. [in, annotation("__in")] UINT id,
  2300. [in, annotation("__in")] UINT uMsg,
  2301. [in, annotation("__in")] WPARAM wParam,
  2302. [in, annotation("__in")] LPARAM lParam,
  2303. [out, annotation("__out_opt")] LRESULT *pret);
  2304. HRESULT QueryActiveShellView([out] IShellView **ppshv);
  2305. HRESULT OnViewWindowActive([in] IShellView *pshv);
  2306. [local] HRESULT SetToolbarItems(
  2307. [in, annotation("__in_ecount_opt(nButtons)")] LPTBBUTTONSB lpButtons,
  2308. [in, annotation("__in")] UINT nButtons,
  2309. [in, annotation("__in")] UINT uFlags);
  2310. }
  2311. typedef IShellBrowser * LPSHELLBROWSER;
  2312. [
  2313. uuid(cb728b20-f786-11ce-92ad-00aa00a74cd0), // IID_IProfferService
  2314. object,
  2315. pointer_default(unique)
  2316. ]
  2317. interface IProfferService : IUnknown
  2318. {
  2319. HRESULT ProfferService(
  2320. [in] REFGUID guidService,
  2321. [in] IServiceProvider *psp,
  2322. [out] DWORD *pdwCookie);
  2323. HRESULT RevokeService([in] DWORD dwCookie);
  2324. }
  2325. cpp_quote("#define SID_SProfferService IID_IProfferService // nearest service that you can proffer to")
  2326. // Tells an IShellItem not to resolve the link target obtained
  2327. // when using the BHID_LinkTargetItem GUID in BindToHandler.
  2328. cpp_quote("#define STR_DONT_RESOLVE_LINK L\"Don't Resolve Link\"")
  2329. // The handler is being retrieved on the UI thread. Avoid any expensive work that touches the disk, network, etc.
  2330. cpp_quote("#define STR_GET_ASYNC_HANDLER L\"GetAsyncHandler\"")
  2331. // New for XP, but used by downlevel code
  2332. //cpp_quote("#if (NTDDI_VERSION >= NTDDI_WINXP)")
  2333. // BindHandler GUIDs for IShellItem::BindToHandler (defined in shlguid.h)")
  2334. // BHID_SFObject restricts usage to IShellFolder::BindToObject()")
  2335. // BHID_SFUIObject restricts usage to IShellFolder::GetUIObjectOf()")
  2336. // BHID_SFViewObject restricts usage to IShellFolder::CreateViewObject()")
  2337. // BHID_LinkTargetItem CLSID_ShellItem initialized with the target this item (SFGAO_LINK only)")
  2338. // BHID_Storage attempts to get the stg/stm riid from BTO, but defaults to shell implementations on failure")
  2339. // Shell Namespace helper
  2340. [
  2341. uuid(43826d1e-e718-42ee-bc55-a1e261c37bfe),
  2342. object,
  2343. pointer_default(unique)
  2344. ]
  2345. interface IShellItem : IUnknown
  2346. {
  2347. typedef [v1_enum] enum _SIGDN
  2348. { // lower word (& with 0xFFFF)
  2349. SIGDN_NORMALDISPLAY = 0x00000000, // SHGDN_NORMAL
  2350. SIGDN_PARENTRELATIVEPARSING = (int) 0x80018001, // SHGDN_INFOLDER | SHGDN_FORPARSING
  2351. SIGDN_DESKTOPABSOLUTEPARSING = (int) 0x80028000, // SHGDN_FORPARSING
  2352. SIGDN_PARENTRELATIVEEDITING = (int) 0x80031001, // SHGDN_INFOLDER | SHGDN_FOREDITING
  2353. SIGDN_DESKTOPABSOLUTEEDITING = (int) 0x8004c000, // SHGDN_FORPARSING | SHGDN_FORADDRESSBAR
  2354. SIGDN_FILESYSPATH = (int) 0x80058000, // SHGDN_FORPARSING
  2355. SIGDN_URL = (int) 0x80068000, // SHGDN_FORPARSING
  2356. SIGDN_PARENTRELATIVEFORADDRESSBAR = (int) 0x8007c001, // SHGDN_INFOLDER | SHGDN_FORPARSING | SHGDN_FORADDRESSBAR
  2357. SIGDN_PARENTRELATIVE = (int) 0x80080001, // SHGDN_INFOLDER
  2358. } SIGDN;
  2359. // SICHINT_DISPLAY iOrder based on display in a folder view
  2360. // SICHINT_ALLFIELDS exact instance compare
  2361. // SICHINT_CANONICAL iOrder based on canonical name (better performance)
  2362. [v1_enum] enum _SICHINTF
  2363. {
  2364. SICHINT_DISPLAY = 0x00000000,
  2365. SICHINT_ALLFIELDS = (int) 0x80000000,
  2366. SICHINT_CANONICAL = 0x10000000,
  2367. SICHINT_TEST_FILESYSPATH_IF_NOT_EQUAL = 0x20000000,
  2368. };
  2369. typedef DWORD SICHINTF;
  2370. HRESULT BindToHandler(
  2371. [in, unique] IBindCtx *pbc,
  2372. [in] REFGUID bhid,
  2373. [in] REFIID riid,
  2374. [out, iid_is(riid)] void **ppv);
  2375. HRESULT GetParent([out] IShellItem **ppsi);
  2376. HRESULT GetDisplayName(
  2377. [in] SIGDN sigdnName,
  2378. [out, string] LPWSTR *ppszName);
  2379. HRESULT GetAttributes(
  2380. [in] SFGAOF sfgaoMask,
  2381. [out] SFGAOF *psfgaoAttribs);
  2382. HRESULT Compare(
  2383. [in] IShellItem *psi,
  2384. [in] SICHINTF hint,
  2385. [out] int *piOrder);
  2386. }
  2387. //cpp_quote("#endif // NTDDI_WINXP")
  2388. cpp_quote("SHSTDAPI_(PIDLIST_ABSOLUTE) SHSimpleIDListFromPath(LPCWSTR pszPath);")
  2389. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  2390. cpp_quote("// CLSID_ShellItem create and init helper APIs. produce IShellItem derived interfaces from these different expressions of an item")
  2391. cpp_quote("SHSTDAPI SHCreateItemFromIDList(__in PCIDLIST_ABSOLUTE pidl, __in REFIID riid, __deref_out void **ppv);")
  2392. cpp_quote("SHSTDAPI SHCreateItemFromParsingName(__in PCWSTR pszPath, __in_opt IBindCtx *pbc, __in REFIID riid, __deref_out void **ppv);")
  2393. cpp_quote("SHSTDAPI SHCreateItemWithParent(__in_opt PCIDLIST_ABSOLUTE pidlParent, __in_opt IShellFolder *psfParent, __in PCUITEMID_CHILD pidl, __in REFIID riid, __deref_out void **ppvItem);")
  2394. cpp_quote("SHSTDAPI SHCreateItemFromRelativeName(__in IShellItem *psiParent, __in PCWSTR pszName, __in_opt IBindCtx* pbc, __in REFIID riid, __deref_out void **ppv);")
  2395. cpp_quote("#endif // (_WIN32_IE >= _WIN32_IE_IE70)")
  2396. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  2397. cpp_quote("SHSTDAPI SHCreateItemInKnownFolder(REFKNOWNFOLDERID kfid, DWORD dwKFFlags, __in_opt PCWSTR pszItem, REFIID riid, __deref_out void **ppv);")
  2398. cpp_quote("// get the IDList expression from an object, works with objects that support IPersistIDlist or IPersistIDlist like CLSID_ShellItem and most shell folders")
  2399. cpp_quote("SHSTDAPI SHGetIDListFromObject(__in IUnknown *punk, __deref_out PIDLIST_ABSOLUTE *ppidl);")
  2400. cpp_quote("// similar to SHGetIDListFromObject but returns an IShellItem-based object (preferred for performance if the IDList is already bound to a folder)")
  2401. cpp_quote("SHSTDAPI SHGetItemFromObject(__in IUnknown *punk, __in REFIID riid, __deref_out void **ppv);")
  2402. cpp_quote("// these APIs return object that support IPropertyStore or related interfaces")
  2403. cpp_quote("SHSTDAPI SHGetPropertyStoreFromIDList(__in PCIDLIST_ABSOLUTE pidl, __in GETPROPERTYSTOREFLAGS flags, __in REFIID riid, __deref_out void **ppv);")
  2404. cpp_quote("SHSTDAPI SHGetPropertyStoreFromParsingName(__in PCWSTR pszPath, __in_opt IBindCtx *pbc, __in GETPROPERTYSTOREFLAGS flags, __in REFIID riid, __deref_out void **ppv);")
  2405. cpp_quote("SHSTDAPI SHGetNameFromIDList(__in PCIDLIST_ABSOLUTE pidl, __in SIGDN sigdnName, __deref_out PWSTR *ppszName);")
  2406. cpp_quote("#endif // (NTDDI_VERSION >= NTDDI_VISTA)")
  2407. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WIN7)")
  2408. typedef [v1_enum] enum DATAOBJ_GET_ITEM_FLAGS
  2409. {
  2410. DOGIF_DEFAULT = 0x0000,
  2411. DOGIF_TRAVERSE_LINK = 0x0001, // if the item is a link get the target
  2412. DOGIF_NO_HDROP = 0x0002, // don't fallback and use CF_HDROP clipboard format
  2413. DOGIF_NO_URL = 0x0004, // don't fallback and use URL clipboard format
  2414. DOGIF_ONLY_IF_ONE = 0x0008, // only return the item if there is one item in the array
  2415. } DATAOBJ_GET_ITEM_FLAGS;
  2416. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DATAOBJ_GET_ITEM_FLAGS)")
  2417. // returns IShellItem and other interfaces that CLSID_ShellItem implements
  2418. cpp_quote("STDAPI SHGetItemFromDataObject(__in IDataObject *pdtobj, __in DATAOBJ_GET_ITEM_FLAGS dwFlags, __in REFIID riid, __deref_out void **ppv);")
  2419. cpp_quote("#endif // (NTDDI_VERSION >= NTDDI_WIN7)")
  2420. // New for Vista, but used by downlevel code
  2421. //cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  2422. //
  2423. // When requesting a property store through IShellFolder, you can specify the equivalent of
  2424. // GPS_DEFAULT by passing in a null IBindCtx parameter.
  2425. //
  2426. // You can specify the equivalent of GPS_READWRITE by passing a mode of STGM_READWRITE | STGM_EXCLUSIVE
  2427. // in the bind context
  2428. //
  2429. // Here are the string versions of GPS_ flags, passed to IShellFolder::BindToObject() via IBindCtx::RegisterObjectParam()
  2430. // These flags are valid when requesting an IPropertySetStorage or IPropertyStore handler
  2431. //
  2432. // The meaning of these flags are described above.
  2433. //
  2434. // There is no STR_ equivalent for GPS_TEMPORARY because temporary property stores
  2435. // are provided by IShellItem2 only -- not by the underlying IShellFolder.
  2436. //
  2437. cpp_quote("#define STR_GPS_HANDLERPROPERTIESONLY L\"GPS_HANDLERPROPERTIESONLY\"")
  2438. cpp_quote("#define STR_GPS_FASTPROPERTIESONLY L\"GPS_FASTPROPERTIESONLY\"")
  2439. cpp_quote("#define STR_GPS_OPENSLOWITEM L\"GPS_OPENSLOWITEM\"")
  2440. cpp_quote("#define STR_GPS_DELAYCREATION L\"GPS_DELAYCREATION\"")
  2441. cpp_quote("#define STR_GPS_BESTEFFORT L\"GPS_BESTEFFORT\"")
  2442. cpp_quote("#define STR_GPS_NO_OPLOCK L\"GPS_NO_OPLOCK\"")
  2443. // Shell Namespace helper 2
  2444. [
  2445. uuid(7e9fb0d3-919f-4307-ab2e-9b1860310c93),
  2446. object,
  2447. pointer_default(unique)
  2448. ]
  2449. interface IShellItem2 : IShellItem
  2450. {
  2451. HRESULT GetPropertyStore(
  2452. [in] GETPROPERTYSTOREFLAGS flags,
  2453. [in] REFIID riid,
  2454. [out, iid_is(riid)] void **ppv);
  2455. HRESULT GetPropertyStoreWithCreateObject(
  2456. [in] GETPROPERTYSTOREFLAGS flags,
  2457. [in] IUnknown *punkCreateObject, // factory for low-rights creation of type ICreateObject
  2458. [in] REFIID riid,
  2459. [out, iid_is(riid)] void **ppv);
  2460. HRESULT GetPropertyStoreForKeys(
  2461. [in, size_is(cKeys)] const PROPERTYKEY *rgKeys,
  2462. [in] UINT cKeys,
  2463. [in] GETPROPERTYSTOREFLAGS flags,
  2464. [in] REFIID riid,
  2465. [out, iid_is(riid)] void **ppv);
  2466. HRESULT GetPropertyDescriptionList(
  2467. [in] REFPROPERTYKEY keyType,
  2468. [in] REFIID riid,
  2469. [out, iid_is(riid)] void **ppv);
  2470. // Ensures any cached information in this item is up to date, or returns __HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) if the item does not exist.
  2471. HRESULT Update([in, unique] IBindCtx *pbc);
  2472. HRESULT GetProperty(
  2473. [in] REFPROPERTYKEY key,
  2474. [out] PROPVARIANT *ppropvar);
  2475. HRESULT GetCLSID(
  2476. [in] REFPROPERTYKEY key,
  2477. [out] CLSID *pclsid);
  2478. HRESULT GetFileTime(
  2479. [in] REFPROPERTYKEY key,
  2480. [out] FILETIME *pft);
  2481. HRESULT GetInt32(
  2482. [in] REFPROPERTYKEY key,
  2483. [out] int *pi);
  2484. HRESULT GetString(
  2485. [in] REFPROPERTYKEY key,
  2486. [out, string] LPWSTR *ppsz);
  2487. HRESULT GetUInt32(
  2488. [in] REFPROPERTYKEY key,
  2489. [out] ULONG *pui);
  2490. HRESULT GetUInt64(
  2491. [in] REFPROPERTYKEY key,
  2492. [out] ULONGLONG *pull);
  2493. HRESULT GetBool(
  2494. [in] REFPROPERTYKEY key,
  2495. [out] BOOL *pf);
  2496. }
  2497. //cpp_quote("#endif // NTDDI_VISTA")
  2498. [v1_enum] enum _SIIGBF
  2499. {
  2500. SIIGBF_RESIZETOFIT = 0x00000000, // if necessary, stretch down the bitmap (preserving aspect ratio) so width and height fit size given; width or height or both may be smaller if natural size is smaller
  2501. SIIGBF_BIGGERSIZEOK = 0x00000001, // a larger bitmap than requested may be returned, the caller will manage scaling down (inverse of SIIGBF_RESIZETOFIT)
  2502. SIIGBF_MEMORYONLY = 0x00000002, // do not hit the disk, even if cached
  2503. SIIGBF_ICONONLY = 0x00000004, // return only the icon, never the thumbnail
  2504. SIIGBF_THUMBNAILONLY = 0x00000008, // return only the thumbnail, never the icon
  2505. SIIGBF_INCACHEONLY = 0x00000010, // ok to touch the disk, but only to retrieve an already cached item
  2506. };
  2507. typedef int SIIGBF;
  2508. [
  2509. uuid(bcc18b79-ba16-442f-80c4-8a59c30c463b),
  2510. object,
  2511. pointer_default(unique)
  2512. ]
  2513. interface IShellItemImageFactory : IUnknown
  2514. {
  2515. // bitmap returned is a DIB; color format is RGB24, RGB32 or PARGB32
  2516. HRESULT GetImage(
  2517. [in] SIZE size,
  2518. [in] SIIGBF flags,
  2519. [out] HBITMAP *phbm);
  2520. }
  2521. // Notification callback for changes to user accounts
  2522. [
  2523. object,
  2524. uuid(a561e69a-b4b8-4113-91a5-64c6bcca3430),
  2525. version(1.0)
  2526. ]
  2527. interface IUserAccountChangeCallback : IUnknown
  2528. {
  2529. HRESULT OnPictureChange(
  2530. [in, string] LPCWSTR pszUserName);
  2531. }
  2532. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WINXP)")
  2533. // Shell Namespace enumerator
  2534. [
  2535. uuid(70629033-e363-4a28-a567-0db78006e6d7),
  2536. object,
  2537. pointer_default(unique)
  2538. ]
  2539. interface IEnumShellItems : IUnknown
  2540. {
  2541. [local]
  2542. HRESULT Next(
  2543. [in, annotation("__in")] ULONG celt,
  2544. [out, size_is(celt), length_is(*pceltFetched), annotation("__out_ecount_part(celt, *pceltFetched)")] IShellItem **rgelt,
  2545. [out, annotation("__out_opt __deref_out_range(0, celt)")] ULONG *pceltFetched);
  2546. [call_as(Next)]
  2547. HRESULT RemoteNext(
  2548. [in] ULONG celt,
  2549. [out, size_is(celt), length_is(*pceltFetched)] IShellItem **rgelt,
  2550. [out] ULONG *pceltFetched);
  2551. HRESULT Skip([in] ULONG celt);
  2552. HRESULT Reset();
  2553. HRESULT Clone([out] IEnumShellItems **ppenum);
  2554. }
  2555. typedef GUID STGTRANSCONFIRMATION, *LPSTGTRANSCONFIRMATION;
  2556. // Storage operations
  2557. typedef [v1_enum] enum STGOP
  2558. {
  2559. STGOP_MOVE = 1,
  2560. STGOP_COPY = 2,
  2561. STGOP_SYNC = 3,
  2562. STGOP_REMOVE = 5,
  2563. STGOP_RENAME = 6,
  2564. STGOP_APPLYPROPERTIES = 8, // _WIN32_WINNT >= 0x0600
  2565. STGOP_NEW = 10, // _WIN32_WINNT >= 0x0600
  2566. } STGOP;
  2567. cpp_quote("#endif // NTDDI_WINXP")
  2568. // ITransferSource/ITransferDestination flag values use for OpenItem/MoveItem/RecycleItem/RemoveItem/etc
  2569. [v1_enum] enum _TRANSFER_SOURCE_FLAGS
  2570. {
  2571. TSF_NORMAL = 0x0000,
  2572. TSF_FAIL_EXIST = 0x0000, // Fail if destination already exists
  2573. TSF_RENAME_EXIST = 0x0001, // Rename with auto-name generation if destination already exists
  2574. TSF_OVERWRITE_EXIST = 0x0002, // Overwrite/Merge with destination
  2575. TSF_ALLOW_DECRYPTION = 0x0004, // Allow creation of decrypted destination
  2576. TSF_NO_SECURITY = 0x0008, // Without DACL/SACL/Owner
  2577. TSF_COPY_CREATION_TIME = 0x0010, // Copy the creation time as part of the copy (useful for move as copy/delete)
  2578. TSF_COPY_WRITE_TIME = 0x0020, // Copy the last write time as part of the copy
  2579. TSF_USE_FULL_ACCESS = 0x0040, // Open a file with write, read, or delete as share mode
  2580. TSF_DELETE_RECYCLE_IF_POSSIBLE = 0x0080, // Recycle if possible
  2581. TSF_COPY_HARD_LINK = 0x0100, // Hard link desired (not required)
  2582. TSF_COPY_LOCALIZED_NAME = 0x0200, // Copy localized name
  2583. TSF_MOVE_AS_COPY_DELETE = 0x0400, // We are doing a move operation, but we are doing it as a copy/delete
  2584. TSF_SUSPEND_SHELLEVENTS = 0x0800, // suspend shell events
  2585. };
  2586. typedef DWORD TRANSFER_SOURCE_FLAGS;
  2587. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  2588. [
  2589. uuid(d594d0d8-8da7-457b-b3b4-ce5dbaac0b88),
  2590. pointer_default(unique),
  2591. local
  2592. ]
  2593. interface ITransferAdviseSink : IUnknown
  2594. {
  2595. [v1_enum] enum _TRANSFER_ADVISE_STATE
  2596. {
  2597. TS_NONE = 0x00000000,
  2598. TS_PERFORMING = 0x00000001, // Transfer is being performed
  2599. TS_PREPARING = 0x00000002, // Preparing to perform transfer - calculating space needed, etc.
  2600. TS_INDETERMINATE = 0x00000004, // The length of the transfer is indeterminate
  2601. };
  2602. typedef DWORD TRANSFER_ADVISE_STATE;
  2603. // UpdateProgress
  2604. //
  2605. // Updates the sink as to current progress of an operation.
  2606. //
  2607. // Implementers of this function should return an error code when the operation needs to terminate early (e.g. the user clicked on the cancel button).
  2608. // If all parameters are 0, UpdateProgress should not change any of its progress data but should can still return an error code
  2609. // to halt the operation.
  2610. // If all the total parameters are 0 but some of the current parameters are non-zero, UpdateProgress should update it's current progress but shouldn't change
  2611. // it's total progress.
  2612. //
  2613. // Callers should regularly query for a cancel request by calling this function with all parameters set to 0 even if no measurable progress occured.
  2614. //
  2615. // Parameters:
  2616. //
  2617. // ullSizeTotal, nFilesTotal, nFoldersTotal
  2618. // Total size in bytes, number of files and number of folders. This includes what has been processed and what will be processed.
  2619. // Setting all three to 0 indicates that the totals have not changed since the last call to UpdateProgress.
  2620. //
  2621. // ullSizeCurrent, nFilesCurrent, nFoldersCurrent
  2622. // Number of bytes, files and folders processed since the start of the operation.
  2623. // Setting all six parameters to zero indicates that progress has not changed since the last call to UpdateProgress.
  2624. //
  2625. // Return values:
  2626. // COPYENGINE_E_USER_CANCELLED
  2627. // The user has cancelled the operation and the caller should halt execution of the operation as soon as possible.
  2628. //
  2629. // Any other error:
  2630. // The caller should halt execution of the operation as soon as possible.
  2631. HRESULT UpdateProgress(
  2632. [in, annotation("__in")] ULONGLONG ullSizeCurrent,
  2633. [in, annotation("__in")] ULONGLONG ullSizeTotal,
  2634. [in, annotation("__in")] int nFilesCurrent,
  2635. [in, annotation("__in")] int nFilesTotal,
  2636. [in, annotation("__in")] int nFoldersCurrent,
  2637. [in, annotation("__in")] int nFoldersTotal);
  2638. HRESULT UpdateTransferState([in, annotation("__in")] TRANSFER_ADVISE_STATE ts);
  2639. // ConfirmOverwrite
  2640. //
  2641. // Parameters:
  2642. // psiSource
  2643. // Source IShellItem.
  2644. // psiDestParent
  2645. // Destination's parent folder's IShellItem.
  2646. // pszName
  2647. // Pointer to wide-string containing the name of the item. If NULL,
  2648. // the name is the same as the psiSource's.
  2649. //
  2650. // Return Values from Confirmations
  2651. // COPYENGINE_S_USER_IGNORED
  2652. // Continue operation
  2653. // COPYENGINE_E_USER_CANCELLED
  2654. // is a user-interaction cancel. The user clicked "Cancel" somewhere.
  2655. //
  2656. // Any other HRESULT should be passed up.
  2657. // Confirm that the operation is ok to actually overwrite an existing item
  2658. HRESULT ConfirmOverwrite(
  2659. [in, annotation("__in")] IShellItem *psiSource,
  2660. [in, annotation("__in")] IShellItem *psiDestParent,
  2661. [in, string, annotation("__in")] LPCWSTR pszName);
  2662. // Confirm that the operation is ok to lose encryption (disclosure)
  2663. HRESULT ConfirmEncryptionLoss([in, annotation("__in")] IShellItem *psiSource);
  2664. // Parameters:
  2665. // psi
  2666. // The IShellItem that is reporting the failure.
  2667. // pszItem
  2668. // If NULL, the "psi"'s display name will be used.
  2669. // If not NULL, this should be a pointer to a string that is the
  2670. // name of the item.
  2671. // hrError
  2672. // The error that is being reported.
  2673. // pszRename
  2674. // A buffer that the caller passes if it wants to be able to
  2675. // retry the operation with a new destination name. If this
  2676. // parameter is NULL, no option to rename will be available.
  2677. // cchRename
  2678. // Size of the buffer pointed to be pszRename.
  2679. //
  2680. // Return Values:
  2681. // COPYENGINE_S_USER_RETRY
  2682. // The handler should retry the file operation.
  2683. // COPYENGINE_S_USER_IGNORED
  2684. // The handler should skip creating the item and return this code
  2685. // back to the copy engine.
  2686. // COPYENGINE_E_USERCANCELLED
  2687. // The user clicked "Cancel" somewhere. The entire copy job is
  2688. // being aborted. The handler should return this code back to the
  2689. // copy engine.
  2690. //
  2691. // Any other HRESULT should be passed up. If failure not handled,
  2692. // the return value should be the same as hrError.
  2693. HRESULT FileFailure(
  2694. [in, annotation("__in")] IShellItem *psi,
  2695. [in, unique, string, annotation("__in_opt")] LPCWSTR pszItem,
  2696. [in, annotation("__in")] HRESULT hrError,
  2697. [out, unique, size_is(cchRename), annotation("__out_ecount_opt(cchRename)")] LPWSTR pszRename,
  2698. [in, annotation("__in")] ULONG cchRename);
  2699. HRESULT SubStreamFailure(
  2700. [in, annotation("__in")] IShellItem *psi,
  2701. [in, string, annotation("__in")] LPCWSTR pszStreamName,
  2702. [in, annotation("__in")] HRESULT hrError);
  2703. HRESULT PropertyFailure(
  2704. [in, annotation("__in")] IShellItem *psi,
  2705. [in, unique, annotation("__in_opt")] const PROPERTYKEY* pkey, // (pkey == NULL) indicates loss of all properties
  2706. [in, annotation("__in")] HRESULT hrError);
  2707. }
  2708. cpp_quote("#endif // (_WIN32_IE >= _WIN32_IE_IE70)")
  2709. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  2710. [
  2711. object,
  2712. uuid(00adb003-bde9-45c6-8e29-d09f9353e108),
  2713. pointer_default(unique),
  2714. local
  2715. ]
  2716. interface ITransferSource : IUnknown
  2717. {
  2718. // Description:
  2719. // Do an advise before calling anything so the handler can callback for
  2720. // any errors that might occur. If not set, the handler should consider
  2721. // it an indication that no feedback is available and to do the "default"
  2722. // operation.
  2723. //
  2724. // Parameters:
  2725. // psink
  2726. // ITransferAdviseSink interface to be used for status and
  2727. // failures.
  2728. // pdwCookie
  2729. // Pointer to a returned token that uniquely identifies this
  2730. // connection. The caller uses this token later to delete the
  2731. // connection by passing it to the Unadvise method. If the
  2732. // connection was not successfully established, this value is zero.
  2733. //
  2734. // Return Values:
  2735. // S_OK
  2736. // Interface successfully associated.
  2737. // E_UNEXPECTED
  2738. // The handler can only handle one sink interface.
  2739. //
  2740. // other HRESULTs indicate a failure.
  2741. HRESULT Advise(
  2742. [in, annotation("__in")] ITransferAdviseSink *psink,
  2743. [out, annotation("__out")] DWORD *pdwCookie);
  2744. // Description:
  2745. // Terminates an advisory connection previously established through
  2746. // Advise method. The dwCookie parameter identifies the connection
  2747. // to terminate
  2748. //
  2749. // Parameters:
  2750. // dwCookie
  2751. // Connection token previously returned from Advise.
  2752. //
  2753. // Return Values:
  2754. // S_OK
  2755. // The connection was successfully terminated.
  2756. // CONNECT_E_NOCONNECTION
  2757. // The value in dwCookie does not represent a valid connection.
  2758. //
  2759. // other HRESULTs indicate a failure.
  2760. HRESULT Unadvise([in, annotation("__in")] DWORD dwCookie);
  2761. // Description:
  2762. // Set properties that should be applied to an item
  2763. //
  2764. // Parameters:
  2765. // pproparray
  2766. // Contains a list of changes
  2767. //
  2768. // Return Values:
  2769. // S_OK
  2770. // Properties set successfully
  2771. // other HRESULTs indicate a failure.
  2772. HRESULT SetProperties([in, annotation("__in")] IPropertyChangeArray *pproparray);
  2773. // Open the item for copying, returning an object that can be enumerated
  2774. // for resources (IShellItemResources).
  2775. HRESULT OpenItem(
  2776. [in, annotation("__in")] IShellItem *psi,
  2777. [in, annotation("__in")] TRANSFER_SOURCE_FLAGS flags,
  2778. [in, annotation("__in")] REFIID riid,
  2779. [out, iid_is(riid), annotation("__deref_out")] void **ppv);
  2780. // Move the item within the volume/namespace, returning the shell item
  2781. // in its new location.
  2782. // returns:
  2783. // FAILED() codes with special meaning for
  2784. // HRESULT_FROM_WIN32(ERROR_NOT_SAME_DEVICE) -> caller should convert move into a copy/delete
  2785. // E_NOINTERFACE -> caller should convert move into a copy/delete
  2786. // in the case of moving a folder
  2787. // HRESULT_FROM_WIN32(ERROR_FILE_EXISTS) or HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS)
  2788. // indicates
  2789. // to convert to a copy/delete the destination item must support ITransferDestination
  2790. //
  2791. // SUCCEEDED() code with special meaning for
  2792. // S_OK - move succeeded, *ppsiNew contains the new item that is the target of the move
  2793. // COPYENGINE_S_USER_IGNORED -> *ppsiNew is NULL, the destination item already exists and
  2794. // has not been overwritten. caller should complete the "move" by deleting the
  2795. /// source item
  2796. // COPYENGINE_S_MERGE -> *ppsiNew is NULL, the destination folder already exists
  2797. // and the user has chosen to proceed merging the folder, the caller should complete
  2798. // the "move" of the folder by deleting the source
  2799. HRESULT MoveItem(
  2800. [in, annotation("__in")] IShellItem *psi,
  2801. [in, annotation("__in")] IShellItem *psiParentDst,
  2802. [in, string, annotation("__in")] LPCWSTR pszNameDst,
  2803. [in] TRANSFER_SOURCE_FLAGS flags,
  2804. [out, annotation("__deref_out")] IShellItem **ppsiNew);
  2805. // Recycle the item into the provided recycle location, returning the new
  2806. // recycled item in that location.
  2807. HRESULT RecycleItem(
  2808. [in, annotation("__in")] IShellItem *psiSource,
  2809. [in, annotation("__in")] IShellItem *psiParentDest,
  2810. [in, annotation("__in")] TRANSFER_SOURCE_FLAGS flags,
  2811. [out, annotation("__deref_out")] IShellItem **ppsiNewDest);
  2812. // Removed the item (without recycle support)
  2813. HRESULT RemoveItem(
  2814. [in, annotation("__in")] IShellItem *psiSource,
  2815. [in, annotation("__in")] TRANSFER_SOURCE_FLAGS flags);
  2816. // Change the name of an item, returing the shell item in its new location
  2817. HRESULT RenameItem(
  2818. [in, annotation("__in")] IShellItem *psiSource,
  2819. [in, string, annotation("__in")] LPCWSTR pszNewName,
  2820. [in, annotation("__in")] TRANSFER_SOURCE_FLAGS flags,
  2821. [out, annotation("__deref_out")] IShellItem **ppsiNewDest);
  2822. // not used or supported, return E_NOTIMPL
  2823. HRESULT LinkItem(
  2824. [in, annotation("__in")] IShellItem *psiSource,
  2825. [in, annotation("__in")] IShellItem *psiParentDest,
  2826. [in, unique, string, annotation("__in_opt")] LPCWSTR pszNewName,
  2827. [in, annotation("__in")] TRANSFER_SOURCE_FLAGS flags,
  2828. [out, annotation("__deref_out")] IShellItem **ppsiNewDest);
  2829. // Apply a set of property changes to an item, return the modified shell item.
  2830. HRESULT ApplyPropertiesToItem(
  2831. [in, annotation("__in")] IShellItem *psiSource,
  2832. [out, annotation("__deref_out")] IShellItem **ppsiNew);
  2833. // Return the default name, if different from the items parsing name.
  2834. HRESULT GetDefaultDestinationName(
  2835. [in, annotation("__in")] IShellItem *psiSource,
  2836. [in, annotation("__in")] IShellItem *psiParentDest,
  2837. [out, string, annotation("__deref_out")] LPWSTR *ppszDestinationName);
  2838. // Description:
  2839. // These are called after a destination folder item has been created.
  2840. // EnterFolder() will be called before the children objects will be
  2841. // created.
  2842. //
  2843. // Expected the order of operations to be:
  2844. // DoCopyItem( psiParentSource, psiParentFolderDest, pszChildName )
  2845. // {
  2846. // psiParentSource->BindToHandler( ..., &ptsParentFolderSource)
  2847. // ptsParentSource->Advise( psink, &dwCookie )
  2848. // ptsParentSource->CopyItem( psiParentFolderDest, pszChildName, 0, &psiFolderDest )
  2849. // if ( psiParentSource.HasChildren() )
  2850. // {
  2851. // ptsParentSource->EnterFolder( psiFolderDest )
  2852. // for each child in psiParentSource
  2853. // {
  2854. // psiParentSource->"GetChild"( &psiChildSource ); <-- a little more complicated
  2855. // DoCopyItem( psiChildSource , psiFolderDest )
  2856. // }
  2857. // ptsParentSource->LeaveFolder( psiFolderDest )
  2858. // }
  2859. // ptsParentSource->Unadvise( dwCookie )
  2860. // }
  2861. //
  2862. // Parameters:
  2863. // psiChildFolderDest
  2864. // IShellItem of the folder being entered.
  2865. //
  2866. // Return Values:
  2867. // S_OK
  2868. // Operation successful.
  2869. //
  2870. // other HRESULTs indicate failure.
  2871. HRESULT EnterFolder([in, annotation("__in")] IShellItem *psiChildFolderDest);
  2872. HRESULT LeaveFolder([in, annotation("__in")] IShellItem *psiChildFolderDest);
  2873. }
  2874. cpp_quote("#endif // _WIN32_IE_IE70")
  2875. typedef struct SHELL_ITEM_RESOURCE
  2876. {
  2877. GUID guidType;
  2878. WCHAR szName[260 /*MAX_PATH*/];
  2879. } SHELL_ITEM_RESOURCE;
  2880. [
  2881. object,
  2882. uuid(2dd81fe3-a83c-4da9-a330-47249d345ba1),
  2883. pointer_default(unique)
  2884. ]
  2885. interface IEnumResources : IUnknown
  2886. {
  2887. HRESULT Next(
  2888. [in] ULONG celt,
  2889. [out, size_is(celt), length_is(*pceltFetched)] SHELL_ITEM_RESOURCE *psir,
  2890. [out] ULONG *pceltFetched);
  2891. HRESULT Skip([in] ULONG celt);
  2892. HRESULT Reset();
  2893. HRESULT Clone([out] IEnumResources **ppenumr);
  2894. }
  2895. [
  2896. object,
  2897. uuid(ff5693be-2ce0-4d48-b5c5-40817d1acdb9),
  2898. pointer_default(unique)
  2899. ]
  2900. interface IShellItemResources : IUnknown
  2901. {
  2902. HRESULT GetAttributes([out] DWORD *pdwAttributes);
  2903. HRESULT GetSize([out] ULONGLONG *pullSize);
  2904. HRESULT GetTimes(
  2905. [out] FILETIME *pftCreation,
  2906. [out] FILETIME *pftWrite,
  2907. [out] FILETIME *pftAccess);
  2908. HRESULT SetTimes(
  2909. [in, unique] const FILETIME *pftCreation,
  2910. [in, unique] const FILETIME *pftWrite,
  2911. [in, unique] const FILETIME *pftAccess);
  2912. HRESULT GetResourceDescription(
  2913. [in] const SHELL_ITEM_RESOURCE *pcsir,
  2914. [out, string] LPWSTR *ppszDescription);
  2915. HRESULT EnumResources([out] IEnumResources **ppenumr);
  2916. HRESULT SupportsResource([in] const SHELL_ITEM_RESOURCE *pcsir);
  2917. HRESULT OpenResource(
  2918. [in] const SHELL_ITEM_RESOURCE *pcsir,
  2919. [in] REFIID riid,
  2920. [out, iid_is(riid)] void **ppv);
  2921. HRESULT CreateResource(
  2922. [in] const SHELL_ITEM_RESOURCE *pcsir,
  2923. [in] REFIID riid,
  2924. [out, iid_is(riid)] void **ppv);
  2925. HRESULT MarkForDelete();
  2926. }
  2927. [
  2928. object,
  2929. uuid(48addd32-3ca5-4124-abe3-b5a72531b207),
  2930. pointer_default(unique),
  2931. local
  2932. ]
  2933. interface ITransferDestination : IUnknown
  2934. {
  2935. // *** 1: advise ***
  2936. // Do an advise before calling anything so the object can callback for
  2937. // any errors that might occur. If not set, the object should consider
  2938. // it an indication that no feedback is available and to do the "default"
  2939. // for the operation.
  2940. HRESULT Advise(
  2941. [in, annotation("__in")] ITransferAdviseSink * psink,
  2942. [out, annotation("__out")] DWORD * pdwCookie);
  2943. HRESULT Unadvise([in] DWORD dwCookie);
  2944. // returns:
  2945. // SUCCEEDED() code with special meaning for
  2946. // S_OK - move succeeded, *ppvItem and *ppvResources contains the new item and resources object
  2947. // that should be copied to
  2948. // COPYENGINE_S_USER_IGNORED -> *ppvItem and *ppvResources are NULL, the destination item already exists and
  2949. // has not been overwritten. if the caller is implemeting "move" as copy/delete it should complete
  2950. // the "move" by deleting the source item
  2951. HRESULT CreateItem(
  2952. [in, string, annotation("__in")] LPCWSTR pszName,
  2953. // FILE_ATTRIBUTE_XXX values, most important being FILE_ATTRIBUTE_DIRECTORY indicating that
  2954. // a folder should be created
  2955. [in, annotation("__in")] DWORD dwAttributes,
  2956. // the size of the item being copied or zero if unknow
  2957. [in, annotation("__in")] ULONGLONG ullSize,
  2958. [in, annotation("__in")] TRANSFER_SOURCE_FLAGS flags,
  2959. // ppvItem should be an IShellItem or derived interface
  2960. [in, annotation("__in")] REFIID riidItem,
  2961. [out, iid_is(riidItem), annotation("__deref_out")] void **ppvItem,
  2962. // ppvResources should be an IShellItemResources or derived interface
  2963. [in, annotation("__in")] REFIID riidResources,
  2964. [out, iid_is(riidResources), annotation("__deref_out")] void **ppvResources);
  2965. }
  2966. // This structure is defined in winbase.h or winternl.h which is not visible to idl files,
  2967. // so we redeclare it here.
  2968. cpp_quote("#ifdef MIDL_PASS")
  2969. typedef struct _OVERLAPPED {
  2970. ULONG_PTR Internal;
  2971. ULONG_PTR InternalHigh;
  2972. union {
  2973. struct {
  2974. DWORD Offset;
  2975. DWORD OffsetHigh;
  2976. };
  2977. PVOID Pointer;
  2978. };
  2979. HANDLE hEvent;
  2980. } OVERLAPPED, *LPOVERLAPPED;
  2981. cpp_quote("#endif // MIDL_PASS")
  2982. [
  2983. object,
  2984. uuid(fe0b6665-e0ca-49b9-a178-2b5cb48d92a5),
  2985. pointer_default(unique),
  2986. local
  2987. ]
  2988. interface IStreamAsync : IStream
  2989. {
  2990. HRESULT ReadAsync([out, size_is(cb), length_is(*pcbRead), annotation("__out_bcount_part(cb, *pcbRead)")] void *pv, [in] DWORD cb, [out, annotation("__out_opt __deref_out_range(0, cb)")] LPDWORD pcbRead, [in, annotation("__in")] LPOVERLAPPED lpOverlapped);
  2991. HRESULT WriteAsync([in, size_is(cb), annotation("__in_bcount(cb)")] void const *lpBuffer, [in] DWORD cb, [out, annotation("__out_opt __deref_out_range(0, cb)")] LPDWORD pcbWritten, [in, annotation("__in")] LPOVERLAPPED lpOverlapped);
  2992. HRESULT OverlappedResult([in, annotation("__in")] LPOVERLAPPED lpOverlapped, [out, annotation("__out")] LPDWORD lpNumberOfBytesTransferred, [in, annotation("__in")] BOOL bWait);
  2993. HRESULT CancelIo();
  2994. }
  2995. [
  2996. object,
  2997. uuid(8a68fdda-1fdc-4c20-8ceb-416643b5a625),
  2998. pointer_default(unique),
  2999. local
  3000. ]
  3001. interface IStreamUnbufferedInfo : IUnknown
  3002. {
  3003. HRESULT GetSectorSize([out, annotation("__out")] ULONG *pcbSectorSize);
  3004. }
  3005. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  3006. [
  3007. object,
  3008. uuid(04b0f1a7-9490-44bc-96e1-4296a31252e2),
  3009. pointer_default(unique),
  3010. ]
  3011. interface IFileOperationProgressSink : IUnknown
  3012. {
  3013. HRESULT StartOperations();
  3014. HRESULT FinishOperations(
  3015. [in] HRESULT hrResult);
  3016. HRESULT PreRenameItem(
  3017. [in] DWORD dwFlags,
  3018. [in] IShellItem *psiItem,
  3019. [in, unique, string] LPCWSTR pszNewName);
  3020. HRESULT PostRenameItem(
  3021. [in] DWORD dwFlags,
  3022. [in] IShellItem *psiItem,
  3023. [in, string] LPCWSTR pszNewName,
  3024. [in] HRESULT hrRename,
  3025. [in] IShellItem *psiNewlyCreated);
  3026. HRESULT PreMoveItem(
  3027. [in] DWORD dwFlags,
  3028. [in] IShellItem *psiItem,
  3029. [in] IShellItem *psiDestinationFolder,
  3030. [in, unique, string] LPCWSTR pszNewName);
  3031. HRESULT PostMoveItem(
  3032. [in] DWORD dwFlags,
  3033. [in] IShellItem *psiItem,
  3034. [in] IShellItem *psiDestinationFolder,
  3035. [in, unique, string] LPCWSTR pszNewName,
  3036. [in] HRESULT hrMove,
  3037. [in] IShellItem *psiNewlyCreated);
  3038. HRESULT PreCopyItem(
  3039. [in] DWORD dwFlags,
  3040. [in] IShellItem *psiItem,
  3041. [in] IShellItem *psiDestinationFolder,
  3042. [in, unique, string] LPCWSTR pszNewName);
  3043. HRESULT PostCopyItem(
  3044. [in] DWORD dwFlags,
  3045. [in] IShellItem *psiItem,
  3046. [in] IShellItem *psiDestinationFolder,
  3047. [in, unique, string] LPCWSTR pszNewName,
  3048. [in] HRESULT hrCopy,
  3049. [in] IShellItem *psiNewlyCreated);
  3050. HRESULT PreDeleteItem(
  3051. [in] DWORD dwFlags,
  3052. [in] IShellItem *psiItem);
  3053. HRESULT PostDeleteItem(
  3054. [in] DWORD dwFlags,
  3055. [in] IShellItem *psiItem,
  3056. [in] HRESULT hrDelete,
  3057. [in] IShellItem *psiNewlyCreated);
  3058. HRESULT PreNewItem(
  3059. [in] DWORD dwFlags,
  3060. [in] IShellItem *psiDestinationFolder,
  3061. [in, unique, string] LPCWSTR pszNewName);
  3062. HRESULT PostNewItem(
  3063. [in] DWORD dwFlags,
  3064. [in] IShellItem *psiDestinationFolder,
  3065. [in, unique, string] LPCWSTR pszNewName,
  3066. [in, unique, string] LPCWSTR pszTemplateName,
  3067. [in] DWORD dwFileAttributes,
  3068. [in] HRESULT hrNew,
  3069. [in] IShellItem *psiNewItem);
  3070. HRESULT UpdateProgress(
  3071. [in] UINT iWorkTotal,
  3072. [in] UINT iWorkSoFar);
  3073. HRESULT ResetTimer();
  3074. HRESULT PauseTimer();
  3075. HRESULT ResumeTimer();
  3076. }
  3077. cpp_quote("#endif // (_WIN32_IE >= _WIN32_IE_IE70)")
  3078. // New for Vista, but used by downlevel code
  3079. //cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  3080. // Shell Item Container
  3081. [
  3082. uuid(b63ea76d-1f85-456f-a19c-48159efa858b),
  3083. object,
  3084. pointer_default(unique)
  3085. ]
  3086. interface IShellItemArray : IUnknown
  3087. {
  3088. typedef [v1_enum] enum SIATTRIBFLAGS
  3089. {
  3090. SIATTRIBFLAGS_AND = 0x00000001, // if multiple items and the attirbutes together.
  3091. SIATTRIBFLAGS_OR = 0x00000002, // if multiple items or the attributes together.
  3092. SIATTRIBFLAGS_APPCOMPAT = 0x00000003, // Call GetAttributes directly on the ShellFolder for multiple attributes
  3093. SIATTRIBFLAGS_MASK = 0x00000003, // for the AND/OR/APPCOMPAT value
  3094. SIATTRIBFLAGS_ALLITEMS = 0x00004000, // normally only the first few items are used to compute the attributes, pass this to force all of them
  3095. // doing all will result in poor performance for large arrays so use this carefuly
  3096. } SIATTRIBFLAGS;
  3097. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(SIATTRIBFLAGS)") // some bits are flags, others are not
  3098. // bhid values supported for the handler type are defined in shlguid.h
  3099. // BHID_DataObject - IDataObject, only works for flat data objects or item arrays produced directly using SHCreateShellItemArrayFromDataObject()
  3100. // BHID_AssociationArray - IQueryAssociations from the first item in the array
  3101. // BHID_SFUIObject - only works for flat (items in the same folder) item array
  3102. HRESULT BindToHandler([in, unique] IBindCtx *pbc, [in] REFGUID bhid, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut);
  3103. HRESULT GetPropertyStore([in] GETPROPERTYSTOREFLAGS flags, [in] REFIID riid, [out, iid_is(riid)] void **ppv);
  3104. HRESULT GetPropertyDescriptionList([in] REFPROPERTYKEY keyType, [in] REFIID riid, [out, iid_is(riid)] void **ppv);
  3105. // get the attributes for the items using different methods defined by SIATTRIBFLAGS
  3106. HRESULT GetAttributes([in] SIATTRIBFLAGS AttribFlags, [in] SFGAOF sfgaoMask, [out] SFGAOF *psfgaoAttribs);
  3107. HRESULT GetCount([out] DWORD *pdwNumItems);
  3108. HRESULT GetItemAt([in] DWORD dwIndex, [out] IShellItem **ppsi);
  3109. HRESULT EnumItems([out] IEnumShellItems **ppenumShellItems);
  3110. }
  3111. //cpp_quote("#endif // NTDDI_VISTA")
  3112. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  3113. cpp_quote("SHSTDAPI SHCreateShellItemArray(__in_opt PCIDLIST_ABSOLUTE pidlParent, __in_opt IShellFolder *psf, __in UINT cidl, __in_ecount_opt(cidl) PCUITEMID_CHILD_ARRAY ppidl, __deref_out IShellItemArray **ppsiItemArray);")
  3114. cpp_quote("SHSTDAPI SHCreateShellItemArrayFromDataObject(__in IDataObject *pdo, __in REFIID riid, __deref_out void **ppv);")
  3115. cpp_quote("SHSTDAPI SHCreateShellItemArrayFromIDLists(__in UINT cidl, __in_ecount(cidl) PCIDLIST_ABSOLUTE_ARRAY rgpidl, __deref_out IShellItemArray **ppsiItemArray);")
  3116. cpp_quote("SHSTDAPI SHCreateShellItemArrayFromShellItem(__in IShellItem *psi, __in REFIID riid, __deref_out void **ppv);")
  3117. cpp_quote("#endif // (_WIN32_IE >= _WIN32_IE_IE70)")
  3118. [
  3119. uuid(7f73be3f-fb79-493c-a6c7-7ee14e245841),
  3120. object,
  3121. pointer_default(unique)
  3122. ]
  3123. interface IInitializeWithItem : IUnknown
  3124. {
  3125. // grfMode is STGM_ values indicating read/readwrite and sharing modes
  3126. HRESULT Initialize([in] IShellItem *psi, [in] DWORD grfMode);
  3127. }
  3128. [
  3129. object,
  3130. uuid(1c9cd5bb-98e9-4491-a60f-31aacc72b83c),
  3131. pointer_default(unique)
  3132. ]
  3133. interface IObjectWithSelection : IUnknown
  3134. {
  3135. HRESULT SetSelection([in] IShellItemArray *psia);
  3136. HRESULT GetSelection(
  3137. [in] REFIID riid,
  3138. [out, iid_is(riid)] void **ppv);
  3139. }
  3140. [
  3141. object,
  3142. uuid(321a6a6a-d61f-4bf3-97ae-14be2986bb36),
  3143. pointer_default(unique)
  3144. ]
  3145. interface IObjectWithBackReferences : IUnknown
  3146. {
  3147. // This method is used for all tasks associated with freeing/releasing back references held
  3148. // by an object, and may prepare an object for reuse
  3149. HRESULT RemoveBackReferences();
  3150. }
  3151. [v1_enum] enum _PROPERTYUI_NAME_FLAGS
  3152. {
  3153. PUIFNF_DEFAULT = 0x00000000,
  3154. PUIFNF_MNEMONIC = 0x00000001, // include mnemonic in display name
  3155. };
  3156. typedef DWORD PROPERTYUI_NAME_FLAGS;
  3157. [v1_enum] enum _PROPERTYUI_FLAGS
  3158. {
  3159. PUIF_DEFAULT = 0x00000000,
  3160. PUIF_RIGHTALIGN = 0x00000001, // this property should be right aligned
  3161. PUIF_NOLABELININFOTIP = 0x00000002, // this property should not display a label in the infotip
  3162. };
  3163. typedef DWORD PROPERTYUI_FLAGS;
  3164. [v1_enum] enum _PROPERTYUI_FORMAT_FLAGS
  3165. {
  3166. PUIFFDF_DEFAULT = 0x00000000,
  3167. PUIFFDF_RIGHTTOLEFT = 0x00000001, // deprecated - do not use
  3168. PUIFFDF_SHORTFORMAT = 0x00000002, // short format version of string
  3169. PUIFFDF_NOTIME = 0x00000004, // truncate time to days, not hours/mins/sec
  3170. PUIFFDF_FRIENDLYDATE = 0x00000008, // "Today", "Yesterday", etc
  3171. };
  3172. typedef DWORD PROPERTYUI_FORMAT_FLAGS;
  3173. // helper service for dealing with properties ala IPropertySetStorage
  3174. [
  3175. uuid(757a7d9f-919a-4118-99d7-dbb208c8cc66),
  3176. object,
  3177. pointer_default(unique)
  3178. ]
  3179. interface IPropertyUI : IUnknown
  3180. {
  3181. HRESULT ParsePropertyName(
  3182. [in, string] LPCWSTR pszName,
  3183. [out] FMTID *pfmtid,
  3184. [out] PROPID *ppid,
  3185. [in, out] ULONG *pchEaten);
  3186. HRESULT GetCannonicalName(
  3187. [in] REFFMTID fmtid,
  3188. [in] PROPID pid,
  3189. [out, string, size_is(cchText)] LPWSTR pwszText,
  3190. [in] DWORD cchText);
  3191. HRESULT GetDisplayName(
  3192. [in] REFFMTID fmtid,
  3193. [in] PROPID pid,
  3194. [in] PROPERTYUI_NAME_FLAGS flags,
  3195. [out, size_is(cchText)] LPWSTR pwszText,
  3196. [in] DWORD cchText);
  3197. HRESULT GetPropertyDescription(
  3198. [in] REFFMTID fmtid,
  3199. [in] PROPID pid,
  3200. [out, size_is(cchText)] LPWSTR pwszText,
  3201. [in] DWORD cchText);
  3202. HRESULT GetDefaultWidth(
  3203. [in] REFFMTID fmtid,
  3204. [in] PROPID pid,
  3205. [out] ULONG *pcxChars);
  3206. HRESULT GetFlags(
  3207. [in] REFFMTID fmtid,
  3208. [in] PROPID pid,
  3209. [out] PROPERTYUI_FLAGS *pflags);
  3210. HRESULT FormatForDisplay(
  3211. [in] REFFMTID fmtid,
  3212. [in] PROPID pid,
  3213. [in] const PROPVARIANT *ppropvar,
  3214. [in] PROPERTYUI_FORMAT_FLAGS puiff,
  3215. [out, string, size_is(cchText)] LPWSTR pwszText,
  3216. [in] DWORD cchText);
  3217. HRESULT GetHelpInfo(
  3218. [in] REFFMTID fmtid,
  3219. [in] PROPID pid,
  3220. [out, string, size_is(cch)] LPWSTR pwszHelpFile,
  3221. [in] DWORD cch,
  3222. [out] UINT *puHelpID);
  3223. }
  3224. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  3225. cpp_quote("SHSTDAPI SHRemovePersonalPropertyValues(__in IShellItemArray *psia);")
  3226. cpp_quote("SHSTDAPI SHAddDefaultPropertiesByExt(PCWSTR pszExt, IPropertyStore *pPropStore);")
  3227. cpp_quote("SHSTDAPI SHCreateDefaultPropertiesOp(IShellItem *psi, __out IFileOperation **ppFileOp);")
  3228. cpp_quote("SHSTDAPI SHSetDefaultProperties(__in_opt HWND hwnd, IShellItem *psi, DWORD dwFileOpFlags, __in_opt IFileOperationProgressSink *pfops);")
  3229. cpp_quote("#endif // (_WIN32_IE >= _WIN32_IE_IE70)")
  3230. //-------------------------------------------------------------
  3231. // Folder Category Support
  3232. //-------------------------------------------------------------
  3233. cpp_quote("#if (_WIN32_IE >= 0x0500)")
  3234. // Provides a list of catagorizers registered on an IShellFolder
  3235. [
  3236. uuid(9af64809-5864-4c26-a720-c1f78c086ee3),
  3237. object,
  3238. pointer_default(unique)
  3239. ]
  3240. interface ICategoryProvider : IUnknown
  3241. {
  3242. // Returns S_OK if the view should display this column in category selection UI, or S_FALSE to remove it.
  3243. HRESULT CanCategorizeOnSCID([in] const SHCOLUMNID* pscid);
  3244. // Returns either a GUID to create in CreateCategory, or a SHCOLUNNID that is used by the default categorizer.
  3245. // Return S_FALSE if you do not support a default group.
  3246. // GUID_NULL returned in pguid indicates to the client to use pscid as the default category.
  3247. HRESULT GetDefaultCategory(
  3248. [out] GUID* pguid,
  3249. [out] SHCOLUMNID* pscid);
  3250. // Returns either a GUID that represents the categoizer to use for the specified SHCOLUMNID.
  3251. HRESULT GetCategoryForSCID(
  3252. [in] const SHCOLUMNID* pscid,
  3253. [out] GUID* pguid);
  3254. // Returns an IEnumGUID that has a list of GUIDs that represent categories.
  3255. HRESULT EnumCategories([out] IEnumGUID** penum);
  3256. // Returns the name of the given category.
  3257. HRESULT GetCategoryName(
  3258. [in] const GUID* pguid,
  3259. [out, string, size_is(cch)] LPWSTR pszName,
  3260. [in] UINT cch);
  3261. // Creates the category.
  3262. HRESULT CreateCategory(
  3263. [in] const GUID* pguid,
  3264. [in] REFIID riid,
  3265. [out, iid_is(riid)] void** ppv);
  3266. }
  3267. typedef [v1_enum] enum CATEGORYINFO_FLAGS
  3268. {
  3269. CATINFO_NORMAL = 0x00000000, // Apply default properties to this category
  3270. CATINFO_COLLAPSED = 0x00000001, // This category should appear collapsed. useful for the "None" category.
  3271. CATINFO_HIDDEN = 0x00000002, // This category should follow the "Hidden" files setting for being displayed
  3272. CATINFO_EXPANDED = 0x00000004, // This category should appear expanded.
  3273. CATINFO_NOHEADER = 0x00000008, // This category has no header.
  3274. CATINFO_NOTCOLLAPSIBLE = 0x00000010, // This category can not be collapsed.
  3275. CATINFO_NOHEADERCOUNT = 0x00000020, // The count of items in the category should not be displayed in the header
  3276. // Win7 Flags
  3277. CATINFO_SUBSETTED = 0x00000040, // The category should appear subsetted.
  3278. } CATEGORYINFO_FLAGS;
  3279. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(CATEGORYINFO_FLAGS)")
  3280. typedef [v1_enum] enum CATSORT_FLAGS
  3281. {
  3282. CATSORT_DEFAULT = 0x00000000, // Default Sort order
  3283. CATSORT_NAME = 0x00000001, // Sort by name
  3284. } CATSORT_FLAGS;
  3285. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(CATSORT_FLAGS)")
  3286. typedef struct CATEGORY_INFO
  3287. {
  3288. CATEGORYINFO_FLAGS cif;
  3289. WCHAR wszName[260];
  3290. } CATEGORY_INFO;
  3291. //-------------------------------------------------------------
  3292. // ICategorizer
  3293. //-------------------------------------------------------------
  3294. // Categorizes items
  3295. [
  3296. uuid(a3b14589-9174-49a8-89a3-06a1ae2b9ba7),
  3297. object,
  3298. pointer_default(unique)
  3299. ]
  3300. interface ICategorizer : IUnknown
  3301. {
  3302. // Returns the description of this category that will be displayed in the UI
  3303. HRESULT GetDescription(
  3304. [out, string, size_is(cch)] LPWSTR pszDesc,
  3305. [in] UINT cch);
  3306. // Returns a list of categories associated with a list of ID Lists. NOTE: -1 is an invalid Category ID, and they cannot be persisted
  3307. HRESULT GetCategory(
  3308. [in] UINT cidl,
  3309. [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl,
  3310. [out, size_is(cidl)] DWORD* rgCategoryIds);
  3311. // Returns information about the category, such as default display and the text to display in the UI
  3312. HRESULT GetCategoryInfo(
  3313. [in] DWORD dwCategoryId,
  3314. [out] CATEGORY_INFO* pci);
  3315. // Returns HRESULTFromShort. -1, 0, 1 indicate the comparison of the IDs. Used for sorting categories in the UI
  3316. HRESULT CompareCategory(
  3317. [in] CATSORT_FLAGS csfFlags,
  3318. [in] DWORD dwCategoryId1,
  3319. [in] DWORD dwCategoryId2);
  3320. }
  3321. cpp_quote("#endif // (_WIN32_IE >= 0x0500)")
  3322. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WIN2K)")
  3323. ///////////////////////////////////////////////////////
  3324. //
  3325. // Drag and Drop helper
  3326. //
  3327. // Purpose: To expose the Shell drag images
  3328. //
  3329. // This interface is implemented in the shell by CLSID_DragDropHelper.
  3330. //
  3331. // To use:
  3332. // If you are the source of a drag (i.e. in response to LV_DRAGBEGIN or
  3333. // equivelent begin drag message) call
  3334. // IDragSourceHelper::InitializeFromWindow
  3335. // (<hwnd of window supporting DI_GETDRAGIMAGE>,
  3336. // <pointer to POINT indicating offset to the mouse from
  3337. // the upper left corner of the image>,
  3338. // <pointer to data object>)
  3339. //
  3340. // NOTE: The Data object must support IDataObject::SetData with multiple
  3341. // data types and GetData must implement data type cloning
  3342. // (Including HGLOBAL), not just aliasing.
  3343. //
  3344. // If you want to adjust the behavior of the drag image by calling
  3345. // IDragSourceHelper2::SetFlags then that call to SetFlags should be
  3346. // made before calling InitializeFromWindow or InitializeFromBitmap.
  3347. //
  3348. // If you wish to have an image while over your application add the
  3349. // IDragImages::Dr* calls to your IDropTarget implementation. For Example:
  3350. //
  3351. // STDMETHODIMP CUserDropTarget::DragEnter(IDataObject* pDataObject,
  3352. // DWORD grfKeyState,
  3353. // POINTL pt, DWORD* pdwEffect)
  3354. // {
  3355. // // Process your DragEnter
  3356. // // Call IDragImages::DragEnter last.
  3357. // _pDropTargetHelper->DragEnter(_hwndDragOver, pDataObject,
  3358. // (POINT*)&pt, *pdwEffect);
  3359. // return hres;
  3360. // }
  3361. //
  3362. //
  3363. // If you wish to be able to source a drag image from a custom control,
  3364. // implement a handler for the RegisterWindowMessage(DI_GETDRAGIMAGE).
  3365. // The LPARAM is a pointer to an SHDRAGIMAGE structure.
  3366. //
  3367. // sizeDragImage - Calculate the length and width required to render
  3368. // the images.
  3369. // ptOffset - Calculate the offset from the upper left corner to
  3370. // the mouse cursor within the image
  3371. // hbmpDragImage - CreateBitmap( sizeDragImage.cx, sizeDragImage.cy,
  3372. // GetDeviceCaps(hdcScreen, PLANES),
  3373. // GetDeviceCaps(hdcScreen, BITSPIXEL),
  3374. // NULL);
  3375. //
  3376. // Drag Images will only be displayed on Windows NT 5.0 or later.
  3377. //
  3378. //
  3379. // Note about IDropTargetHelper::Show - This method is provided for
  3380. // showing/hiding the Drag image in low color depth video modes. When
  3381. // painting to a window that is currently being dragged over (i.e. For
  3382. // indicating a selection) you need to hide the drag image by calling this
  3383. // method passing FALSE. After the window is done painting, Show the image
  3384. // again by passing TRUE.
  3385. cpp_quote("#include <pshpack8.h>")
  3386. typedef struct SHDRAGIMAGE
  3387. {
  3388. SIZE sizeDragImage; // OUT - The length and Width of the rendered image
  3389. POINT ptOffset; // OUT - The Offset from the mouse cursor to the upper left corner of the image
  3390. HBITMAP hbmpDragImage; // OUT - The Bitmap containing the rendered drag images
  3391. COLORREF crColorKey; // OUT - The COLORREF that has been blitted to the background of the images
  3392. } SHDRAGIMAGE, *LPSHDRAGIMAGE;
  3393. cpp_quote("#include <poppack.h> // Return to byte packing")
  3394. // This is sent to a window to get the rendered images to a bitmap
  3395. // Call RegisterWindowMessage to get the ID
  3396. cpp_quote("#define DI_GETDRAGIMAGE TEXT(\"ShellGetDragImage\")")
  3397. [
  3398. uuid(4657278B-411B-11D2-839A-00C04FD918D0),
  3399. local,
  3400. pointer_default(unique)
  3401. ]
  3402. interface IDropTargetHelper : IUnknown
  3403. {
  3404. HRESULT DragEnter(
  3405. [in, annotation("__in")] HWND hwndTarget,
  3406. [in, annotation("__in")] IDataObject* pDataObject,
  3407. [in, annotation("__in")] POINT* ppt,
  3408. [in, annotation("__in")] DWORD dwEffect);
  3409. HRESULT DragLeave();
  3410. HRESULT DragOver(
  3411. [in, annotation("__in")] POINT* ppt,
  3412. [in, annotation("__in")] DWORD dwEffect);
  3413. HRESULT Drop(
  3414. [in, annotation("__in")] IDataObject* pDataObject,
  3415. [in, annotation("__in")] POINT* ppt,
  3416. [in, annotation("__in")] DWORD dwEffect);
  3417. HRESULT Show([in, annotation("__in")] BOOL fShow);
  3418. }
  3419. [
  3420. uuid(DE5BF786-477A-11D2-839D-00C04FD918D0),
  3421. local,
  3422. pointer_default(unique)
  3423. ]
  3424. interface IDragSourceHelper: IUnknown
  3425. {
  3426. // IDragSourceHelper
  3427. HRESULT InitializeFromBitmap(
  3428. [in, annotation("__in")] LPSHDRAGIMAGE pshdi,
  3429. [in, annotation("__in")] IDataObject* pDataObject);
  3430. HRESULT InitializeFromWindow(
  3431. [in, unique, annotation("__in_opt")] HWND hwnd,
  3432. [in, unique, annotation("__in_opt")] POINT* ppt,
  3433. [in, annotation("__in")] IDataObject* pDataObject);
  3434. }
  3435. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  3436. // IDragSourceHelper2::SetFlags dwFlags
  3437. typedef [v1_enum] enum DSH_FLAGS
  3438. {
  3439. DSH_ALLOWDROPDESCRIPTIONTEXT = 0x0001, // Allow text specified in DropDescription to be displayed on drag image
  3440. } DSH_FLAGS;
  3441. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DSH_FLAGS)")
  3442. [
  3443. uuid(83E07D0D-0C5F-4163-BF1A-60B274051E40),
  3444. local,
  3445. pointer_default(unique)
  3446. ]
  3447. interface IDragSourceHelper2 : IDragSourceHelper
  3448. {
  3449. HRESULT SetFlags(
  3450. [in, annotation("__in")] DWORD dwFlags);
  3451. }
  3452. cpp_quote("#endif // NTDDI_VISTA")
  3453. cpp_quote("#endif // NTDDI_WIN2K")
  3454. cpp_quote("#ifdef UNICODE")
  3455. cpp_quote("#define IShellLink IShellLinkW")
  3456. cpp_quote("#else")
  3457. cpp_quote("#define IShellLink IShellLinkA")
  3458. cpp_quote("#endif")
  3459. // IShellLink::Resolve fFlags
  3460. typedef [v1_enum] enum SLR_FLAGS
  3461. {
  3462. SLR_NO_UI = 0x0001, // don't post any UI durring the resolve operation, not msgs are pumped
  3463. SLR_ANY_MATCH = 0x0002, // no longer used
  3464. SLR_UPDATE = 0x0004, // save the link back to it's file if the track made it dirty
  3465. SLR_NOUPDATE = 0x0008,
  3466. SLR_NOSEARCH = 0x0010, // don't execute the search heuristics
  3467. SLR_NOTRACK = 0x0020, // don't use NT5 object ID to track the link
  3468. SLR_NOLINKINFO = 0x0040, // don't use the net and volume relative info
  3469. SLR_INVOKE_MSI = 0x0080, // if we have a darwin link, then call msi to fault in the applicaion
  3470. SLR_NO_UI_WITH_MSG_PUMP = 0x0101, // SLR_NO_UI + requires an enable modeless site or HWND
  3471. SLR_OFFER_DELETE_WITHOUT_FILE = 0x0200, // offer the option to delete when unable to resolve, even if the shortcut is not file-backed
  3472. SLR_KNOWNFOLDER = 0x0400, // report dirty if target is known folder and it got redirected --
  3473. // this only works if orignal target was a file system path/ID list and not an aliased known folder ID list
  3474. SLR_MACHINE_IN_LOCAL_TARGET = 0x0800, // resolve machine name in UNC targets pointing to local machine (used with SLDF_KEEP_LOCAL_IDLIST_FOR_UNC_TARGET)
  3475. SLR_UPDATE_MACHINE_AND_SID = 0x1000, // update machine GUID and user SID if necessary
  3476. } SLR_FLAGS;
  3477. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(SLR_FLAGS)")
  3478. // IShellLink::GetPath fFlags
  3479. typedef [v1_enum] enum SLGP_FLAGS
  3480. {
  3481. SLGP_SHORTPATH = 0x0001,
  3482. SLGP_UNCPRIORITY = 0x0002,
  3483. SLGP_RAWPATH = 0x0004,
  3484. SLGP_RELATIVEPRIORITY = 0x0008,
  3485. } SLGP_FLAGS;
  3486. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(SLGP_FLAGS)")
  3487. [
  3488. uuid(000214EE-0000-0000-C000-000000000046),
  3489. object,
  3490. pointer_default(unique)
  3491. ]
  3492. interface IShellLinkA : IUnknown
  3493. {
  3494. HRESULT GetPath(
  3495. [out, string, size_is(cch)] LPSTR pszFile,
  3496. [in] int cch,
  3497. [in, out, unique] WIN32_FIND_DATAA *pfd,
  3498. [in] DWORD fFlags);
  3499. HRESULT GetIDList(
  3500. [out] PIDLIST_ABSOLUTE * ppidl);
  3501. HRESULT SetIDList(
  3502. [in] PCIDLIST_ABSOLUTE pidl);
  3503. HRESULT GetDescription(
  3504. [out, string, size_is(cch)] LPSTR pszName,
  3505. [in] int cch);
  3506. HRESULT SetDescription(
  3507. [in, string] LPCSTR pszName);
  3508. HRESULT GetWorkingDirectory(
  3509. [out, string, size_is(cch)] LPSTR pszDir,
  3510. [in] int cch);
  3511. HRESULT SetWorkingDirectory(
  3512. [in, string] LPCSTR pszDir);
  3513. HRESULT GetArguments(
  3514. [out, string, size_is(cch)] LPSTR pszArgs,
  3515. [in] int cch);
  3516. HRESULT SetArguments(
  3517. [in, string] LPCSTR pszArgs);
  3518. HRESULT GetHotkey(
  3519. [out] WORD *pwHotkey);
  3520. HRESULT SetHotkey(
  3521. [in] WORD wHotkey);
  3522. HRESULT GetShowCmd(
  3523. [out] int *piShowCmd);
  3524. HRESULT SetShowCmd(
  3525. [in] int iShowCmd);
  3526. HRESULT GetIconLocation(
  3527. [out, string, size_is(cch)] LPSTR pszIconPath,
  3528. [in] int cch,
  3529. [out] int *piIcon);
  3530. HRESULT SetIconLocation(
  3531. [in, string] LPCSTR pszIconPath,
  3532. [in] int iIcon);
  3533. HRESULT SetRelativePath(
  3534. [in, string] LPCSTR pszPathRel,
  3535. [in] DWORD dwReserved);
  3536. HRESULT Resolve(
  3537. [in, unique] HWND hwnd,
  3538. [in] DWORD fFlags);
  3539. HRESULT SetPath(
  3540. [in, string] LPCSTR pszFile);
  3541. }
  3542. [
  3543. uuid(000214F9-0000-0000-C000-000000000046),
  3544. object,
  3545. pointer_default(unique)
  3546. ]
  3547. interface IShellLinkW : IUnknown
  3548. {
  3549. HRESULT GetPath(
  3550. [out, string, size_is(cch)] LPWSTR pszFile,
  3551. [in] int cch,
  3552. [in, out, unique] WIN32_FIND_DATAW *pfd,
  3553. [in] DWORD fFlags);
  3554. HRESULT GetIDList(
  3555. [out] PIDLIST_ABSOLUTE * ppidl);
  3556. HRESULT SetIDList(
  3557. [in, unique] PCIDLIST_ABSOLUTE pidl);
  3558. HRESULT GetDescription(
  3559. [out, string, size_is(cch)] LPWSTR pszName,
  3560. int cch);
  3561. HRESULT SetDescription(
  3562. [in, string] LPCWSTR pszName);
  3563. HRESULT GetWorkingDirectory(
  3564. [out, string, size_is(cch)] LPWSTR pszDir,
  3565. int cch);
  3566. HRESULT SetWorkingDirectory(
  3567. [in, string] LPCWSTR pszDir);
  3568. HRESULT GetArguments(
  3569. [out, string, size_is(cch)] LPWSTR pszArgs,
  3570. [in] int cch);
  3571. HRESULT SetArguments(
  3572. [in, string] LPCWSTR pszArgs);
  3573. HRESULT GetHotkey(
  3574. [out] WORD *pwHotkey);
  3575. HRESULT SetHotkey(
  3576. [in] WORD wHotkey);
  3577. HRESULT GetShowCmd(
  3578. [out] int *piShowCmd);
  3579. HRESULT SetShowCmd(
  3580. [in] int iShowCmd);
  3581. HRESULT GetIconLocation(
  3582. [out, string, size_is(cch)] LPWSTR pszIconPath,
  3583. [in] int cch,
  3584. [out] int *piIcon);
  3585. HRESULT SetIconLocation(
  3586. [in, string] LPCWSTR pszIconPath,
  3587. [in] int iIcon);
  3588. HRESULT SetRelativePath(
  3589. [in, string] LPCWSTR pszPathRel,
  3590. [in] DWORD dwReserved);
  3591. HRESULT Resolve(
  3592. [in, unique] HWND hwnd,
  3593. [in] DWORD fFlags);
  3594. HRESULT SetPath(
  3595. [in, string] LPCWSTR pszFile);
  3596. }
  3597. [
  3598. uuid(45e2b4ae-b1c3-11d0-b92f-00a0c90312e1),
  3599. object,
  3600. pointer_default(unique)
  3601. #ifdef BUILD_SPLIT_AS_IE
  3602. ,local
  3603. #endif
  3604. ]
  3605. interface IShellLinkDataList : IUnknown
  3606. {
  3607. [local] HRESULT AddDataBlock(
  3608. [in, annotation("__in")] void * pDataBlock);
  3609. [local] HRESULT CopyDataBlock(
  3610. [in, annotation("__in")] DWORD dwSig,
  3611. [out, annotation("__deref_out")] void **ppDataBlock);
  3612. HRESULT RemoveDataBlock(
  3613. [in] DWORD dwSig);
  3614. // flags are SLDF_ values as defined in shlobj.h
  3615. HRESULT GetFlags(
  3616. [out] DWORD *pdwFlags);
  3617. HRESULT SetFlags(
  3618. [in] DWORD dwFlags);
  3619. }
  3620. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WIN2K)")
  3621. // Link resolution helpers - called when a link is created or needs to be resolved.
  3622. [
  3623. object,
  3624. uuid(5cd52983-9449-11d2-963a-00c04f79adf0),
  3625. pointer_default(unique)
  3626. ]
  3627. interface IResolveShellLink : IUnknown
  3628. {
  3629. HRESULT ResolveShellLink(
  3630. [in] IUnknown *punkLink,
  3631. [in] HWND hwnd,
  3632. [in] DWORD fFlags);
  3633. }
  3634. cpp_quote("#endif // NTDDI_WIN2K")
  3635. // New for XP, but used by downlevel code
  3636. //cpp_quote("#if (NTDDI_VERSION >= NTDDI_WINXP)")
  3637. [
  3638. object,
  3639. uuid(49ff1172-eadc-446d-9285-156453a6431c),
  3640. pointer_default(unique)
  3641. ]
  3642. interface IActionProgressDialog : IUnknown
  3643. {
  3644. [v1_enum] enum _SPINITF
  3645. {
  3646. SPINITF_NORMAL = 0x00000000, // default normal progress behavior
  3647. SPINITF_MODAL = 0x00000001, // call punkSite->EnableModeless() or EnableWindow()
  3648. SPINITF_NOMINIMIZE = 0x00000008, // Do not have a minimize button in the caption bar.
  3649. };
  3650. typedef DWORD SPINITF;
  3651. HRESULT Initialize(
  3652. [in] SPINITF flags,
  3653. [in, unique, string] LPCWSTR pszTitle,
  3654. [in, unique, string] LPCWSTR pszCancel);
  3655. HRESULT Stop();
  3656. }
  3657. // HW Event Handler Interface
  3658. [
  3659. object,
  3660. uuid(C1FB73D0-EC3A-4ba2-B512-8CDB9187B6D1),
  3661. pointer_default(unique)
  3662. ]
  3663. interface IHWEventHandler : IUnknown
  3664. {
  3665. HRESULT Initialize(
  3666. [in, string] LPCWSTR pszParams);
  3667. HRESULT HandleEvent(
  3668. [in, string] LPCWSTR pszDeviceID,
  3669. [in, string] LPCWSTR pszAltDeviceID,
  3670. [in, string] LPCWSTR pszEventType);
  3671. HRESULT HandleEventWithContent(
  3672. [in, string] LPCWSTR pszDeviceID,
  3673. [in, string] LPCWSTR pszAltDeviceID,
  3674. [in, string] LPCWSTR pszEventType,
  3675. [in, string] LPCWSTR pszContentTypeHandler,
  3676. [in] IDataObject* pdataobject);
  3677. }
  3678. // HW Event Handler Interface 2
  3679. [
  3680. object,
  3681. uuid(CFCC809F-295D-42e8-9FFC-424B33C487E6),
  3682. pointer_default(unique)
  3683. ]
  3684. interface IHWEventHandler2 : IHWEventHandler
  3685. {
  3686. HRESULT HandleEventWithHWND(
  3687. [in, string] LPCWSTR pszDeviceID,
  3688. [in, string] LPCWSTR pszAltDeviceID,
  3689. [in, string] LPCWSTR pszEventType,
  3690. [in] HWND hwndOwner);
  3691. }
  3692. // Do not use 0x1, it was used to indicate cancellation in legacy autoplay.
  3693. cpp_quote("#define ARCONTENT_AUTORUNINF 0x00000002 // That's the one we have today, and always had")
  3694. cpp_quote("#define ARCONTENT_AUDIOCD 0x00000004 // Audio CD (not MP3 and the like, the stuff you buy at the store)")
  3695. cpp_quote("#define ARCONTENT_DVDMOVIE 0x00000008 // DVD Movie (not MPEGs, the stuff you buy at the store)")
  3696. cpp_quote("#define ARCONTENT_BLANKCD 0x00000010 // Blank CD-R/CD-RW)")
  3697. cpp_quote("#define ARCONTENT_BLANKDVD 0x00000020 // Blank DVD-R/DVD-RW")
  3698. cpp_quote("#define ARCONTENT_UNKNOWNCONTENT 0x00000040 // Whatever files. Mean that it's formatted.")
  3699. cpp_quote("#define ARCONTENT_AUTOPLAYPIX 0x00000080 // Any files classified by shell as image. (jpg, bmp, etc.)")
  3700. cpp_quote("#define ARCONTENT_AUTOPLAYMUSIC 0x00000100 // Any files classified by shell as music. (wma, mp3, etc.)")
  3701. cpp_quote("#define ARCONTENT_AUTOPLAYVIDEO 0x00000200 // Any files classified by shell as video. (mpg, avi, etc.)")
  3702. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  3703. cpp_quote("#define ARCONTENT_VCD 0x00000400 // VCD format")
  3704. cpp_quote("#define ARCONTENT_SVCD 0x00000800 // Super-VCD format")
  3705. cpp_quote("#define ARCONTENT_DVDAUDIO 0x00001000 // DVD-Audio")
  3706. cpp_quote("#define ARCONTENT_BLANKBD 0x00002000 // Blank BD-R/BD-RW")
  3707. cpp_quote("#define ARCONTENT_BLURAY 0x00004000 // Blu-ray Disc")
  3708. cpp_quote("#define ARCONTENT_NONE 0x00000000 // Empty (but formatted)")
  3709. cpp_quote("#define ARCONTENT_MASK 0x00007FFE // Bits that denote valid content types")
  3710. cpp_quote("#define ARCONTENT_PHASE_UNKNOWN 0x00000000 // We can be in any phase. This is XP behavior.")
  3711. cpp_quote("#define ARCONTENT_PHASE_PRESNIFF 0x10000000 // These are contents we know w/o scanning the media for complete data (e.g. Audio track, DVD Movie).")
  3712. cpp_quote("#define ARCONTENT_PHASE_SNIFFING 0x20000000 // We are in the middle of searching the media. There could be more contents to be found than currently reported.")
  3713. cpp_quote("#define ARCONTENT_PHASE_FINAL 0x40000000 // We have finished searching; contents we report are final.")
  3714. cpp_quote("#define ARCONTENT_PHASE_MASK 0x70000000 // Bits that denote what phase we are in the Autoplay process.")
  3715. cpp_quote("#endif // NTDDI_VISTA")
  3716. // HW Event Handler Interface
  3717. [
  3718. object,
  3719. uuid(DDEFE873-6997-4e68-BE26-39B633ADBE12),
  3720. pointer_default(unique)
  3721. ]
  3722. interface IQueryCancelAutoPlay : IUnknown
  3723. {
  3724. HRESULT AllowAutoPlay(
  3725. [in, string] LPCWSTR pszPath,
  3726. [in] DWORD dwContentType,
  3727. [in, string] LPCWSTR pszLabel,
  3728. [in] DWORD dwSerialNumber);
  3729. }
  3730. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  3731. //
  3732. // IDynamicHWHandler is a new feature in AutoPlay V3 (Vista)
  3733. // A handler can register this interface for show/hide itself from the Autoplay prompt dialog.
  3734. // Additionally, it may specify a different action string than one supplied by the static
  3735. // handler registration under HKLM.
  3736. //
  3737. // params:
  3738. // [in] pszDeviceID - DevicePath or drive root (e.g. G:\),
  3739. // [in] dwContentType - bitfield of content types detected so far, similar to the param in IQueryCancelAutoPlay
  3740. // [out] *ppszAction - if not NULL, use this as the Action string.
  3741. // if NULL, fallback to default static action string.
  3742. //
  3743. // returns:
  3744. // S_OK = show, S_FALSE = hide, E_xx = error
  3745. //
  3746. // Dynamic HW Handler Interface
  3747. [
  3748. object,
  3749. uuid(DC2601D7-059E-42fc-A09D-2AFD21B6D5F7),
  3750. pointer_default(unique)
  3751. ]
  3752. interface IDynamicHWHandler : IUnknown
  3753. {
  3754. HRESULT GetDynamicInfo(
  3755. [in, string] LPCWSTR pszDeviceID,
  3756. [in] DWORD dwContentType,
  3757. [out, string] LPWSTR* ppszAction);
  3758. }
  3759. cpp_quote("#endif // NTDDI_VISTA")
  3760. [
  3761. object,
  3762. uuid(49ff1173-eadc-446d-9285-156453a6431c),
  3763. pointer_default(unique)
  3764. ]
  3765. interface IActionProgress : IUnknown
  3766. {
  3767. [v1_enum] enum _SPBEGINF
  3768. {
  3769. SPBEGINF_NORMAL = 0x00000000, // default normal progress behavior
  3770. SPBEGINF_AUTOTIME = 0x00000002, // automatically updates the "time remaining" text
  3771. SPBEGINF_NOPROGRESSBAR = 0x00000010, // Don't display the progress bar (SetProgress() wont be called)
  3772. SPBEGINF_MARQUEEPROGRESS = 0x00000020, // use marquee progress (comctl32 v6 required)
  3773. SPBEGINF_NOCANCELBUTTON = 0x00000040, // no cancel button
  3774. };
  3775. typedef DWORD SPBEGINF;
  3776. typedef [v1_enum] enum _SPACTION {
  3777. SPACTION_NONE = 0,
  3778. SPACTION_MOVING,
  3779. SPACTION_COPYING,
  3780. SPACTION_RECYCLING,
  3781. SPACTION_APPLYINGATTRIBS,
  3782. SPACTION_DOWNLOADING,
  3783. SPACTION_SEARCHING_INTERNET,
  3784. SPACTION_CALCULATING,
  3785. SPACTION_UPLOADING,
  3786. SPACTION_SEARCHING_FILES,
  3787. SPACTION_DELETING, // Vista or higher
  3788. SPACTION_RENAMING, // Vista or higher
  3789. SPACTION_FORMATTING, // Vista or higher
  3790. SPACTION_COPY_MOVING, // Move as copy-delete, Windows 7 or higher
  3791. } SPACTION;
  3792. typedef [v1_enum] enum _SPTEXT
  3793. {
  3794. SPTEXT_ACTIONDESCRIPTION = 1,
  3795. SPTEXT_ACTIONDETAIL,
  3796. } SPTEXT;
  3797. HRESULT Begin(
  3798. [in] SPACTION action,
  3799. [in] SPBEGINF flags);
  3800. HRESULT UpdateProgress(
  3801. [in] ULONGLONG ulCompleted,
  3802. [in] ULONGLONG ulTotal);
  3803. HRESULT UpdateText(
  3804. [in] SPTEXT sptext,
  3805. [in, string] LPCWSTR pszText,
  3806. [in] BOOL fMayCompact);
  3807. HRESULT QueryCancel([out] BOOL * pfCancelled);
  3808. HRESULT ResetCancel();
  3809. HRESULT End();
  3810. }
  3811. //cpp_quote("#endif // NTDDI_WINXP")
  3812. // The IShellExtInit interface is used by the explorer to initialize shell
  3813. // extension objects. The explorer (1) calls CoCreateInstance (or equivalent)
  3814. // with the registered CLSID and IID_IShellExtInit, (2) calls its Initialize
  3815. // member, then (3) calls its QueryInterface to a particular interface (such
  3816. // as IContextMenu or IPropSheetExt and (4) performs the rest of operation.
  3817. //
  3818. // IShellExtInit::Initialize
  3819. //
  3820. // This member function is called when the explorer is initializing either
  3821. // context menu extension, property sheet extension or non-default drag-drop
  3822. // extension.
  3823. //
  3824. // Parameters: (context menu or property sheet extension)
  3825. // pidlFolder -- Specifies the parent folder
  3826. // lpdobj -- Spefifies the set of items selected in that folder.
  3827. // hkeyProgID -- Specifies the type of the focused item in the selection.
  3828. //
  3829. // Parameters: (non-default drag-and-drop extension)
  3830. // pidlFolder -- Specifies the target (destination) folder
  3831. // lpdobj -- Specifies the items that are dropped (see the description
  3832. // about shell's clipboard below for clipboard formats).
  3833. // hkeyProgID -- Specifies the folder type.
  3834. // used to initialize an object on a remote computer (server)
  3835. [
  3836. uuid(000214E8-0000-0000-C000-000000000046),
  3837. object,
  3838. local,
  3839. pointer_default(unique)
  3840. ]
  3841. interface IShellExtInit : IUnknown
  3842. {
  3843. HRESULT Initialize(
  3844. [in, unique, annotation("__in_opt")] PCIDLIST_ABSOLUTE pidlFolder,
  3845. [in, unique, annotation("__in_opt")] IDataObject *pdtobj,
  3846. [in, unique, annotation("__in_opt")] HKEY hkeyProgID);
  3847. }
  3848. typedef IShellExtInit * LPSHELLEXTINIT;
  3849. // The explorer uses the IShellPropSheetExt to allow property sheet
  3850. // extensions or control panel extensions to add additional property
  3851. // sheet pages.
  3852. //
  3853. // IShellPropSheetExt::AddPages
  3854. //
  3855. // The explorer calls this member function when it finds a registered
  3856. // property sheet extension for a particular type of object. For each
  3857. // additional page, the extension creates a page object by calling
  3858. // CreatePropertySheetPage API and calls lpfnAddPage.
  3859. //
  3860. // Parameters:
  3861. // lpfnAddPage -- Specifies the callback function.
  3862. // lParam -- Specifies the opaque handle to be passed to the callback function.
  3863. //
  3864. //
  3865. // IShellPropSheetExt::ReplacePage
  3866. //
  3867. // The explorer never calls this member of property sheet extensions. The
  3868. // explorer calls this member of control panel extensions, so that they
  3869. // can replace some of default control panel pages (such as a page of
  3870. // mouse control panel).
  3871. //
  3872. // Parameters:
  3873. // uPageID -- Specifies the page to be replaced.
  3874. // lpfnReplace Specifies the callback function.
  3875. // lParam -- Specifies the opaque handle to be passed to the callback function.
  3876. //
  3877. [
  3878. uuid(000214E9-0000-0000-C000-000000000046),
  3879. object,
  3880. local,
  3881. pointer_default(unique)
  3882. ]
  3883. interface IShellPropSheetExt : IUnknown
  3884. {
  3885. [v1_enum] enum _EXPPS
  3886. {
  3887. EXPPS_FILETYPES = 0x00000001,
  3888. };
  3889. typedef UINT EXPPS;
  3890. HRESULT AddPages(
  3891. [in, annotation("__in")] LPFNSVADDPROPSHEETPAGE pfnAddPage,
  3892. [in, annotation("__in")] LPARAM lParam);
  3893. HRESULT ReplacePage(
  3894. [in, annotation("__in")] EXPPS uPageID,
  3895. [in, annotation("__in")] LPFNSVADDPROPSHEETPAGE pfnReplaceWith,
  3896. [in, annotation("__in")] LPARAM lParam);
  3897. }
  3898. typedef IShellPropSheetExt * LPSHELLPROPSHEETEXT;
  3899. [
  3900. uuid(000214FE-0000-0000-C000-000000000046),
  3901. object,
  3902. pointer_default(unique)
  3903. ]
  3904. interface IRemoteComputer : IUnknown
  3905. {
  3906. // function is called when the explorer is initializing or
  3907. // enumerating the name space extension. If failure is returned during
  3908. // enumeration, the extension won't appear for this computer. Otherwise,
  3909. // the extension will appear, and should target the given machine.
  3910. //
  3911. // pszMachine Specifies the name of the machine to target. (\\server)
  3912. // bEnumerationg test to see if this object should be enumerated
  3913. // on this server
  3914. HRESULT Initialize(
  3915. [in, string] LPCWSTR pszMachine,
  3916. [in] BOOL bEnumerating);
  3917. }
  3918. [
  3919. uuid(7307055c-b24a-486b-9f25-163e597a28a9),
  3920. object,
  3921. pointer_default(unique)
  3922. ]
  3923. interface IQueryContinue : IUnknown
  3924. {
  3925. HRESULT QueryContinue(); // S_OK -> Continue, S_FALSE -> Cancel
  3926. }
  3927. // This interface supplies a caller with an event that will be signaled
  3928. // by the callee to denote cancellation of a task.
  3929. [
  3930. uuid(F279B885-0AE9-4b85-AC06-DDECF9408941),
  3931. object,
  3932. local,
  3933. pointer_default(unique)
  3934. ]
  3935. interface IObjectWithCancelEvent : IUnknown
  3936. {
  3937. // Call this function to retrieve an event that will be signaled when
  3938. // the callee cancels the operation it's performing.
  3939. // The caller is responsible for closing the returned handle.
  3940. HRESULT GetCancelEvent([out, annotation("__out")] HANDLE *phEvent);
  3941. }
  3942. [
  3943. uuid(ba9711ba-5893-4787-a7e1-41277151550b),
  3944. object,
  3945. pointer_default(unique)
  3946. ]
  3947. interface IUserNotification : IUnknown
  3948. {
  3949. HRESULT SetBalloonInfo(
  3950. [in, unique, string] LPCWSTR pszTitle,
  3951. [in, unique, string] LPCWSTR pszText,
  3952. [in] DWORD dwInfoFlags);
  3953. HRESULT SetBalloonRetry(
  3954. [in] DWORD dwShowTime, // times in msec
  3955. [in] DWORD dwInterval,
  3956. [in] UINT cRetryCount);
  3957. HRESULT SetIconInfo(
  3958. [in, unique] HICON hIcon,
  3959. [in, unique, string] LPCWSTR pszToolTip);
  3960. HRESULT Show(
  3961. [in, unique] IQueryContinue *pqc,
  3962. [in] DWORD dwContinuePollInterval);
  3963. HRESULT PlaySound([in, string] LPCWSTR pszSoundName);
  3964. }
  3965. [
  3966. uuid(19108294-0441-4AFF-8013-FA0A730B0BEA),
  3967. object
  3968. ]
  3969. interface IUserNotificationCallback : IUnknown
  3970. {
  3971. // All of these return S_OK to continue, S_FALSE or other error codes to stop
  3972. // These are all "fire and forget" callbacks. Dont pump messages during these
  3973. // callbacks...
  3974. HRESULT OnBalloonUserClick([in] POINT * pt);
  3975. HRESULT OnLeftClick([in] POINT * pt);
  3976. HRESULT OnContextMenu([in] POINT * pt);
  3977. }
  3978. [
  3979. uuid(215913CC-57EB-4FAB-AB5A-E5FA7BEA2A6C),
  3980. object,
  3981. pointer_default(unique)
  3982. ]
  3983. interface IUserNotification2 : IUnknown
  3984. {
  3985. HRESULT SetBalloonInfo(
  3986. [in, unique, string] LPCWSTR pszTitle,
  3987. [in, unique, string] LPCWSTR pszText,
  3988. [in] DWORD dwInfoFlags);
  3989. HRESULT SetBalloonRetry(
  3990. [in] DWORD dwShowTime, // times in msec
  3991. [in] DWORD dwInterval,
  3992. [in] UINT cRetryCount);
  3993. HRESULT SetIconInfo(
  3994. [in, unique] HICON hIcon,
  3995. [in, unique, string] LPCWSTR pszToolTip);
  3996. HRESULT Show(
  3997. [in, unique] IQueryContinue *pqc,
  3998. [in] DWORD dwContinuePollInterval,
  3999. [in, unique] IUserNotificationCallback *pSink);
  4000. HRESULT PlaySound([in, string] LPCWSTR pszSoundName);
  4001. }
  4002. // interface for describing the limits placed on a name, used for validation
  4003. // parsing and translation.
  4004. [
  4005. uuid(1df0d7f1-b267-4d28-8b10-12e23202a5c4)
  4006. ]
  4007. interface IItemNameLimits : IUnknown
  4008. {
  4009. HRESULT GetValidCharacters(
  4010. [out, string] LPWSTR *ppwszValidChars,
  4011. [out, string] LPWSTR *ppwszInvalidChars);
  4012. HRESULT GetMaxLength(
  4013. [in, string] LPCWSTR pszName,
  4014. [out] int *piMaxNameLen);
  4015. }
  4016. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  4017. [
  4018. object,
  4019. uuid(a0ffbc28-5482-4366-be27-3e81e78e06c2),
  4020. pointer_default(unique)
  4021. ]
  4022. interface ISearchFolderItemFactory : IUnknown
  4023. {
  4024. HRESULT SetDisplayName(
  4025. [in, string] LPCWSTR pszDisplayName);
  4026. HRESULT SetFolderTypeID(
  4027. [in] FOLDERTYPEID ftid);
  4028. HRESULT SetFolderLogicalViewMode(
  4029. [in] FOLDERLOGICALVIEWMODE flvm);
  4030. HRESULT SetIconSize(
  4031. [in] int iIconSize);
  4032. HRESULT SetVisibleColumns(
  4033. [in] UINT cVisibleColumns,
  4034. [in, size_is(cVisibleColumns)] PROPERTYKEY *rgKey);
  4035. HRESULT SetSortColumns(
  4036. [in] UINT cSortColumns,
  4037. [in, size_is(cSortColumns)] SORTCOLUMN *rgSortColumns);
  4038. HRESULT SetGroupColumn(
  4039. [in] REFPROPERTYKEY keyGroup);
  4040. HRESULT SetStacks(
  4041. [in] UINT cStackKeys,
  4042. [in, size_is(cStackKeys)] PROPERTYKEY *rgStackKeys);
  4043. HRESULT SetScope(
  4044. [in] IShellItemArray *psiaScope);
  4045. HRESULT SetCondition(
  4046. [in] ICondition *pCondition);
  4047. HRESULT GetShellItem(
  4048. [in] REFIID riid,
  4049. [out, iid_is(riid)] void **ppv); // returns IShellItem, navigate to this
  4050. HRESULT GetIDList(
  4051. [out] PIDLIST_ABSOLUTE *ppidl);
  4052. }
  4053. cpp_quote("#endif // NTDDI_VISTA")
  4054. cpp_quote("#if (_WIN32_IE >= 0x0400)")
  4055. // --- IExtractImage
  4056. // this interface is provided for objects to provide a thumbnail image.
  4057. // IExtractImage::GetLocation()
  4058. // Gets a path description of the image that is to be extracted. This is used to
  4059. // identify the image in the view so that multiple instances of the same image can reuse the
  4060. // original image. If *pdwFlags == IEIFLAG_ASYNC and the result is E_PENDING, then *pdwPriority
  4061. // is used to return the priority of the item, this is usually a measure of how long it will take
  4062. // to perform the extraction. *pdwFlags can return IEIFLAG_CACHE if the view should cache a copy
  4063. // of the image for future reference and faster access. This flag is used to tell the difference
  4064. // between file formats that cache a thumbnail image such as Flashpix or Office documents, and those
  4065. // that don't cache one.
  4066. // IExtractImage::Extract()
  4067. // Extract the thumbnail of the specified size. If GetLocation() returned the values indicating
  4068. // it is free-threaded and can be placed on a background thread. If the object
  4069. // supports IRunnableTask as well, then long extractions can be started and paused as appropriate.
  4070. // At this point it is asssumed the object is free-threaded.
  4071. // If dwRecClrDepth contains a recommended Colour depth
  4072. // If *phBmpthumbnail is non NULL, then it contains the destination bitmap that should be used.
  4073. cpp_quote("#define IEI_PRIORITY_MAX ITSAT_MAX_PRIORITY")
  4074. cpp_quote("#define IEI_PRIORITY_MIN ITSAT_MIN_PRIORITY")
  4075. cpp_quote("#define IEIT_PRIORITY_NORMAL ITSAT_DEFAULT_PRIORITY")
  4076. cpp_quote("#define IEIFLAG_ASYNC 0x0001 // (deprecated) ask the extractor if it supports ASYNC extract (free threaded)")
  4077. cpp_quote("#define IEIFLAG_CACHE 0x0002 // returned from the extractor if it does NOT cache the thumbnail")
  4078. cpp_quote("#define IEIFLAG_ASPECT 0x0004 // passed to the extractor to beg it to render to the aspect ratio of the supplied rect")
  4079. cpp_quote("#define IEIFLAG_OFFLINE 0x0008 // if the extractor shouldn't hit the net to get any content neede for the rendering")
  4080. cpp_quote("#define IEIFLAG_GLEAM 0x0010 // does the image have a gleam ? this will be returned if it does")
  4081. cpp_quote("#define IEIFLAG_SCREEN 0x0020 // render as if for the screen (this is exlusive with IEIFLAG_ASPECT )")
  4082. cpp_quote("#define IEIFLAG_ORIGSIZE 0x0040 // render to the approx size passed, but crop if neccessary")
  4083. cpp_quote("#define IEIFLAG_NOSTAMP 0x0080 // returned from the extractor if it does NOT want an icon stamp on the thumbnail")
  4084. cpp_quote("#define IEIFLAG_NOBORDER 0x0100 // returned from the extractor if it does NOT want an a border around the thumbnail")
  4085. cpp_quote("#define IEIFLAG_QUALITY 0x0200 // passed to the Extract method to indicate that a slower, higher quality image is desired, re-compute the thumbnail")
  4086. cpp_quote("#define IEIFLAG_REFRESH 0x0400 // returned from the extractor if it would like to have Refresh Thumbnail available")
  4087. [
  4088. uuid(BB2E617C-0920-11d1-9A0B-00C04FC2D6C1),
  4089. object,
  4090. pointer_default(unique)
  4091. ]
  4092. interface IExtractImage : IUnknown
  4093. {
  4094. HRESULT GetLocation(
  4095. [out, string, size_is(cch)] LPWSTR pszPathBuffer,
  4096. [in] DWORD cch,
  4097. [in, out, unique] DWORD *pdwPriority,
  4098. [in] const SIZE * prgSize,
  4099. [in] DWORD dwRecClrDepth,
  4100. [in, out] DWORD *pdwFlags);
  4101. HRESULT Extract(
  4102. [out] HBITMAP *phBmpThumbnail);
  4103. }
  4104. typedef IExtractImage * LPEXTRACTIMAGE;
  4105. cpp_quote("#endif")
  4106. cpp_quote("#if (_WIN32_IE >= 0x0500)")
  4107. // GetDateStamp : returns the date stamp associated with the image. If this image is already cached,
  4108. // then it is easy to find out if the image is out of date.
  4109. [
  4110. uuid(953BB1EE-93B4-11d1-98A3-00C04FB687DA),
  4111. object,
  4112. pointer_default(unique)
  4113. ]
  4114. interface IExtractImage2 : IExtractImage
  4115. {
  4116. HRESULT GetDateStamp([out] FILETIME *pDateStamp);
  4117. }
  4118. typedef IExtractImage2 * LPEXTRACTIMAGE2;
  4119. [
  4120. uuid(e35b4b2e-00da-4bc1-9f13-38bc11f5d417),
  4121. object,
  4122. pointer_default(unique)
  4123. ]
  4124. interface IThumbnailHandlerFactory : IUnknown
  4125. {
  4126. HRESULT GetThumbnailHandler(
  4127. [in] PCUITEMID_CHILD pidlChild,
  4128. [in, unique] IBindCtx *pbc,
  4129. [in] REFIID riid,
  4130. [out, iid_is(riid)] void **ppv);
  4131. }
  4132. [
  4133. uuid(b3a4b685-b685-4805-99d9-5dead2873236), // IID_IParentAndItem
  4134. object,
  4135. pointer_default(unique)
  4136. ]
  4137. interface IParentAndItem : IUnknown
  4138. {
  4139. // 2 ways to init
  4140. // pidlParent == NULL
  4141. // psf is folder, pidlChild is child relative to psf
  4142. HRESULT SetParentAndItem(
  4143. [in, unique] PCIDLIST_ABSOLUTE pidlParent,
  4144. [in, unique] IShellFolder *psf,
  4145. [in] PCUITEMID_CHILD pidlChild);
  4146. // all params optional
  4147. // ppidlParent gets full pidl to parent of item
  4148. // ppsf gets parent folder for item
  4149. // ppidlChild gets item relitve to psf
  4150. [local]
  4151. HRESULT GetParentAndItem(
  4152. [out, annotation("__deref_opt_out")] PIDLIST_ABSOLUTE *ppidlParent,
  4153. [out, annotation("__deref_opt_out")] IShellFolder **ppsf,
  4154. [out, annotation("__deref_opt_out")] PITEMID_CHILD *ppidlChild);
  4155. [call_as(GetParentAndItem)]
  4156. HRESULT RemoteGetParentAndItem(
  4157. [out] PIDLIST_ABSOLUTE *ppidlParent,
  4158. [out] IShellFolder **ppsf,
  4159. [out] PITEMID_CHILD *ppidlChild);
  4160. }
  4161. cpp_quote("#endif")
  4162. //-------------------------------------------------------------------------
  4163. //
  4164. // IDockingWindow interface
  4165. //
  4166. // An object (docking window) implements this interface so the site can
  4167. // communicate with it. An example of a docking window is a toolbar.
  4168. //
  4169. // [Member functions]
  4170. //
  4171. // IDockingWindow::ShowDW(fShow)
  4172. // Shows or hides the docking window.
  4173. //
  4174. // IDockingWindow::CloseDW(dwReserved)
  4175. // Closes the docking window. dwReserved must be 0.
  4176. //
  4177. // IDockingWindow::ResizeBorderDW(prcBorder, punkToolbarSite, fReserved)
  4178. // Resizes the docking window's border to *prcBorder. fReserved must
  4179. // be 0.
  4180. //
  4181. // IObjectWithSite::SetSite(punkSite)
  4182. // IDockingWindow usually paired with IObjectWithSite.
  4183. // Provides the IUnknown pointer of the site to the docking window.
  4184. //
  4185. //-------------------------------------------------------------------------
  4186. [
  4187. uuid(012dd920-7b26-11d0-8ca9-00a0c92dbfe8),
  4188. object
  4189. ]
  4190. interface IDockingWindow : IOleWindow
  4191. {
  4192. HRESULT ShowDW([in] BOOL fShow);
  4193. HRESULT CloseDW([in] DWORD dwReserved);
  4194. HRESULT ResizeBorderDW(
  4195. [in, unique] LPCRECT prcBorder,
  4196. [in, unique] IUnknown* punkToolbarSite,
  4197. [in] BOOL fReserved);
  4198. }
  4199. //-------------------------------------------------------------------------
  4200. //
  4201. // IDeskBand interface
  4202. //
  4203. //
  4204. // [Member functions]
  4205. //
  4206. // IDeskBand::GetBandInfo(dwBandID, dwViewMode, pdbi)
  4207. // Returns info on the given band in *pdbi, according to the mask
  4208. // field in the DESKBANDINFO structure and the given viewmode.
  4209. //
  4210. //-------------------------------------------------------------------------
  4211. // Mask values for DESKBANDINFO
  4212. cpp_quote("#define DBIM_MINSIZE 0x0001")
  4213. cpp_quote("#define DBIM_MAXSIZE 0x0002")
  4214. cpp_quote("#define DBIM_INTEGRAL 0x0004")
  4215. cpp_quote("#define DBIM_ACTUAL 0x0008")
  4216. cpp_quote("#define DBIM_TITLE 0x0010")
  4217. cpp_quote("#define DBIM_MODEFLAGS 0x0020")
  4218. cpp_quote("#define DBIM_BKCOLOR 0x0040")
  4219. cpp_quote("#include <pshpack8.h>")
  4220. typedef struct DESKBANDINFO
  4221. {
  4222. DWORD dwMask;
  4223. POINTL ptMinSize;
  4224. POINTL ptMaxSize;
  4225. POINTL ptIntegral;
  4226. POINTL ptActual;
  4227. WCHAR wszTitle[256];
  4228. DWORD dwModeFlags;
  4229. COLORREF crBkgnd;
  4230. } DESKBANDINFO;
  4231. cpp_quote("#include <poppack.h>") // Return to byte packing
  4232. // DESKBANDINFO dwModeFlags values
  4233. cpp_quote("#define DBIMF_NORMAL 0x0000")
  4234. cpp_quote("#define DBIMF_FIXED 0x0001")
  4235. cpp_quote("#define DBIMF_FIXEDBMP 0x0004 // a fixed background bitmap (if supported)")
  4236. cpp_quote("#define DBIMF_VARIABLEHEIGHT 0x0008")
  4237. cpp_quote("#define DBIMF_UNDELETEABLE 0x0010")
  4238. cpp_quote("#define DBIMF_DEBOSSED 0x0020")
  4239. cpp_quote("#define DBIMF_BKCOLOR 0x0040")
  4240. cpp_quote("#define DBIMF_USECHEVRON 0x0080")
  4241. cpp_quote("#define DBIMF_BREAK 0x0100")
  4242. cpp_quote("#define DBIMF_ADDTOFRONT 0x0200")
  4243. cpp_quote("#define DBIMF_TOPALIGN 0x0400")
  4244. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  4245. cpp_quote("#define DBIMF_NOGRIPPER 0x0800")
  4246. cpp_quote("#define DBIMF_ALWAYSGRIPPER 0x1000")
  4247. cpp_quote("#define DBIMF_NOMARGINS 0x2000")
  4248. cpp_quote("#endif // NTDDI_VISTA")
  4249. // GetBandInfo view mode values
  4250. cpp_quote("#define DBIF_VIEWMODE_NORMAL 0x0000")
  4251. cpp_quote("#define DBIF_VIEWMODE_VERTICAL 0x0001")
  4252. cpp_quote("#define DBIF_VIEWMODE_FLOATING 0x0002")
  4253. cpp_quote("#define DBIF_VIEWMODE_TRANSPARENT 0x0004")
  4254. // Command Target IDs
  4255. enum tagDESKBANDCID
  4256. {
  4257. DBID_BANDINFOCHANGED = 0,
  4258. DBID_SHOWONLY = 1,
  4259. DBID_MAXIMIZEBAND = 2, // Maximize the specified band (VT_UI4 == dwID)
  4260. DBID_PUSHCHEVRON = 3,
  4261. DBID_DELAYINIT = 4, // Note: _bandsite_ calls _band_ with this code
  4262. DBID_FINISHINIT = 5, // Note: _bandsite_ calls _band_ with this code
  4263. DBID_SETWINDOWTHEME = 6, // Note: _bandsite_ calls _band_ with this code
  4264. DBID_PERMITAUTOHIDE = 7,
  4265. };
  4266. cpp_quote("#define DBPC_SELECTFIRST (DWORD)-1")
  4267. cpp_quote("#define DBPC_SELECTLAST (DWORD)-2")
  4268. cpp_quote("#define CGID_DeskBand IID_IDeskBand")
  4269. [
  4270. uuid(EB0FE172-1A3A-11D0-89B3-00A0C90A90AC),
  4271. object,
  4272. ]
  4273. interface IDeskBand : IDockingWindow
  4274. {
  4275. HRESULT GetBandInfo(
  4276. [in] DWORD dwBandID,
  4277. [in] DWORD dwViewMode,
  4278. [in, out] DESKBANDINFO* pdbi);
  4279. }
  4280. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  4281. //-------------------------------------------------------------------------
  4282. //
  4283. // IDeskBandInfo interface
  4284. //
  4285. //
  4286. // [Member functions]
  4287. //
  4288. // IDeskBandInfo::GetDefaultBandWidth(dwBandID, dwViewMode, puWidth)
  4289. // Call back by bandsite to get the band width that bandsite uses to set
  4290. // the default width of the band when the band is first added/docked to
  4291. // bandsite.
  4292. //
  4293. //-------------------------------------------------------------------------
  4294. [
  4295. uuid(77E425FC-CBF9-4307-BA6A-BB5727745661),
  4296. object,
  4297. ]
  4298. interface IDeskBandInfo : IUnknown
  4299. {
  4300. HRESULT GetDefaultBandWidth(
  4301. [in] DWORD dwBandID,
  4302. [in] DWORD dwViewMode,
  4303. [out] int *pnWidth);
  4304. }
  4305. //-------------------------------------------------------------------------
  4306. //
  4307. // IDeskBand2 interface
  4308. //
  4309. //
  4310. // [Member functions]
  4311. //
  4312. // IDeskBand2::CanRenderComposited(pfCanRenderComposited)
  4313. // Does the deskband support composited rendering (glass/translucent)?
  4314. //
  4315. // IDeskBand2::SetCompositionState(fCompositionEnabled)
  4316. // Tell the deskband to render with or without composition.
  4317. //
  4318. // IDeskBand2::GetCompositionState(pfCompositionEnabled)
  4319. // Does the deskband currently render with or without composition?
  4320. //
  4321. //-------------------------------------------------------------------------
  4322. [
  4323. uuid(79D16DE4-ABEE-4021-8D9D-9169B261D657),
  4324. object,
  4325. ]
  4326. interface IDeskBand2 : IDeskBand
  4327. {
  4328. HRESULT CanRenderComposited([out] BOOL *pfCanRenderComposited);
  4329. HRESULT SetCompositionState([in] BOOL fCompositionEnabled);
  4330. HRESULT GetCompositionState([out] BOOL *pfCompositionEnabled);
  4331. }
  4332. cpp_quote("#endif // NTDDI_VISTA")
  4333. //-------------------------------------------------------------------------
  4334. //
  4335. // ITaskbarList interface
  4336. //
  4337. //
  4338. // [Member functions]
  4339. //
  4340. // ITaskbarList::HrInit()
  4341. // This function must be called first to validate use of other members.
  4342. //
  4343. // ITaskbarList::AddTab(hwnd)
  4344. // This function adds a tab for hwnd to the taskbar.
  4345. //
  4346. // ITaskbarList::DeleteTab(hwnd)
  4347. // This function deletes a tab for hwnd from the taskbar.
  4348. //
  4349. // ITaskbarList::ActivateTab(hwnd)
  4350. // This function activates the tab associated with hwnd on the taskbar.
  4351. //
  4352. // ITaskbarList::SetActivateAlt(hwnd)
  4353. // This function marks hwnd in the taskbar as the active tab
  4354. //
  4355. //-------------------------------------------------------------------------
  4356. [
  4357. uuid(56FDF342-FD6D-11d0-958A-006097C9A090),
  4358. object,
  4359. ]
  4360. interface ITaskbarList : IUnknown
  4361. {
  4362. HRESULT HrInit();
  4363. HRESULT AddTab([in] HWND hwnd);
  4364. HRESULT DeleteTab([in] HWND hwnd);
  4365. HRESULT ActivateTab([in] HWND hwnd);
  4366. HRESULT SetActiveAlt([in] HWND hwnd);
  4367. }
  4368. [
  4369. uuid(602D4995-B13A-429b-A66E-1935E44F4317),
  4370. object,
  4371. ]
  4372. interface ITaskbarList2 : ITaskbarList
  4373. {
  4374. HRESULT MarkFullscreenWindow(
  4375. [in] HWND hwnd,
  4376. [in] BOOL fFullscreen);
  4377. }
  4378. cpp_quote("#ifdef MIDL_PASS")
  4379. typedef IUnknown* HIMAGELIST;
  4380. cpp_quote("#endif")
  4381. typedef [v1_enum] enum THUMBBUTTONFLAGS
  4382. {
  4383. THBF_ENABLED = 0x00000000,
  4384. THBF_DISABLED = 0x00000001,
  4385. THBF_DISMISSONCLICK = 0x00000002,
  4386. THBF_NOBACKGROUND = 0x00000004,
  4387. THBF_HIDDEN = 0x00000008,
  4388. THBF_NONINTERACTIVE = 0x00000010,
  4389. } THUMBBUTTONFLAGS;
  4390. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(THUMBBUTTONFLAGS)")
  4391. typedef [v1_enum] enum THUMBBUTTONMASK
  4392. {
  4393. THB_BITMAP = 0x00000001,
  4394. THB_ICON = 0x00000002,
  4395. THB_TOOLTIP = 0x00000004,
  4396. THB_FLAGS = 0x00000008,
  4397. } THUMBBUTTONMASK;
  4398. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(THUMBBUTTONMASK)")
  4399. cpp_quote("#include <pshpack8.h>")
  4400. typedef struct THUMBBUTTON
  4401. {
  4402. THUMBBUTTONMASK dwMask;
  4403. UINT iId;
  4404. UINT iBitmap;
  4405. HICON hIcon;
  4406. WCHAR szTip[260];
  4407. THUMBBUTTONFLAGS dwFlags;
  4408. } THUMBBUTTON, *LPTHUMBBUTTON;
  4409. cpp_quote("#include <poppack.h>")
  4410. cpp_quote("#define THBN_CLICKED 0x1800")
  4411. [
  4412. uuid(ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf),
  4413. object,
  4414. ]
  4415. interface ITaskbarList3 : ITaskbarList2
  4416. {
  4417. // Flags for Setting Taskbar Progress state
  4418. typedef [v1_enum] enum TBPFLAG
  4419. {
  4420. TBPF_NOPROGRESS = 0x00000000,
  4421. TBPF_INDETERMINATE = 0x00000001,
  4422. TBPF_NORMAL = 0x00000002,
  4423. TBPF_ERROR = 0x00000004,
  4424. TBPF_PAUSED = 0x00000008,
  4425. } TBPFLAG;
  4426. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(TBPFLAG)")
  4427. HRESULT SetProgressValue(
  4428. [in] HWND hwnd,
  4429. [in] ULONGLONG ullCompleted,
  4430. [in] ULONGLONG ullTotal);
  4431. HRESULT SetProgressState(
  4432. [in] HWND hwnd,
  4433. [in] TBPFLAG tbpFlags);
  4434. HRESULT RegisterTab(
  4435. [in] HWND hwndTab,
  4436. [in] HWND hwndMDI);
  4437. HRESULT UnregisterTab(
  4438. [in] HWND hwndTab);
  4439. HRESULT SetTabOrder(
  4440. [in] HWND hwndTab,
  4441. [in] HWND hwndInsertBefore);
  4442. HRESULT SetTabActive(
  4443. [in] HWND hwndTab,
  4444. [in] HWND hwndMDI,
  4445. [in] DWORD dwReserved);
  4446. HRESULT ThumbBarAddButtons(
  4447. [in] HWND hwnd,
  4448. [in] UINT cButtons,
  4449. [in, size_is(cButtons)] LPTHUMBBUTTON pButton);
  4450. HRESULT ThumbBarUpdateButtons(
  4451. [in] HWND hwnd,
  4452. [in] UINT cButtons,
  4453. [in, size_is(cButtons)] LPTHUMBBUTTON pButton);
  4454. HRESULT ThumbBarSetImageList(
  4455. [in] HWND hwnd,
  4456. [in] HIMAGELIST himl);
  4457. HRESULT SetOverlayIcon(
  4458. [in] HWND hwnd,
  4459. [in] HICON hIcon,
  4460. [in, unique, string] LPCWSTR pszDescription);
  4461. HRESULT SetThumbnailTooltip(
  4462. [in] HWND hwnd,
  4463. [in, unique, string] LPCWSTR pszTip);
  4464. HRESULT SetThumbnailClip(
  4465. [in] HWND hwnd,
  4466. [in] RECT *prcClip);
  4467. }
  4468. [
  4469. uuid(c43dc798-95d1-4bea-9030-bb99e2983a1a),
  4470. object,
  4471. ]
  4472. interface ITaskbarList4 : ITaskbarList3
  4473. {
  4474. // Flags for Setting Tab Properties
  4475. typedef [v1_enum] enum STPFLAG
  4476. {
  4477. STPF_NONE = 0x00000000,
  4478. STPF_USEAPPTHUMBNAILALWAYS = 0x00000001,
  4479. STPF_USEAPPTHUMBNAILWHENACTIVE = 0x00000002,
  4480. STPF_USEAPPPEEKALWAYS = 0x00000004,
  4481. STPF_USEAPPPEEKWHENACTIVE = 0x00000008,
  4482. } STPFLAG;
  4483. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(STPFLAG)")
  4484. HRESULT SetTabProperties(
  4485. [in] HWND hwndTab,
  4486. [in] STPFLAG stpFlags);
  4487. }
  4488. [
  4489. uuid(4CD19ADA-25A5-4A32-B3B7-347BEE5BE36B),
  4490. object,
  4491. ]
  4492. interface IStartMenuPinnedList : IUnknown
  4493. {
  4494. // if pitem is not pinned, return S_OK
  4495. // if pitem is pinned, the pitem is successfully removed from pinned list, return S_OK
  4496. // if pitem is pinned, the pitem fail to be removed from pinned list, return error HRESULT
  4497. HRESULT RemoveFromList([in] IShellItem *pitem);
  4498. }
  4499. [
  4500. object,
  4501. uuid(3d73a659-e5d0-4d42-afc0-5121ba425c8d), // IID_ICDBurn
  4502. pointer_default(unique)
  4503. ]
  4504. interface ICDBurn : IUnknown
  4505. {
  4506. HRESULT GetRecorderDriveLetter(
  4507. [out, string, size_is(cch)] LPWSTR pszDrive,
  4508. [in] UINT cch);
  4509. HRESULT Burn([in] HWND hwnd);
  4510. HRESULT HasRecordableDrive([out] BOOL *pfHasRecorder);
  4511. }
  4512. // Wizard Extension objects. These interfaces defined methods for extending
  4513. // Win32 wizard in a progromatic way.
  4514. // Range of ID's that extensions can used, these mustn't clash with
  4515. // the existing wizards dialog IDS. (That enables them to still
  4516. // do PropSheet_SetCurSelByID).
  4517. cpp_quote("#define IDD_WIZEXTN_FIRST 0x5000")
  4518. cpp_quote("#define IDD_WIZEXTN_LAST 0x5100")
  4519. // This site object is requested via a QueryService of the objects site,
  4520. // it allows the extension to navigate in/out out itself, eg. when the
  4521. // extension has shown all of its pages and wants to navigate to the
  4522. // next page it would call GetNextPage and select the specified HPAGE.
  4523. // Wizard Extension Site
  4524. [
  4525. uuid(88960f5b-422f-4e7b-8013-73415381c3c3),
  4526. local
  4527. ]
  4528. interface IWizardSite : IUnknown
  4529. {
  4530. HRESULT GetPreviousPage([out, annotation("__out")] HPROPSHEETPAGE *phpage);
  4531. HRESULT GetNextPage([out, annotation("__out")] HPROPSHEETPAGE *phpage);
  4532. HRESULT GetCancelledPage([out, annotation("__out")] HPROPSHEETPAGE *phpage);
  4533. }
  4534. cpp_quote("#define SID_WizardSite IID_IWizardSite")
  4535. // A wizard extension is implemented using this object, the extension will declare the
  4536. // pages that it supports using the AddPages method, and then when its host needs to navigate
  4537. // into the extenion it will do so via GetFirstPage and selecting that.
  4538. // Wizard Extension
  4539. [
  4540. uuid(c02ea696-86cc-491e-9b23-74394a0444a8),
  4541. local
  4542. ]
  4543. interface IWizardExtension : IUnknown
  4544. {
  4545. HRESULT AddPages(
  4546. [out, size_is(cPages), annotation("__out_ecount_part(cPages, *pnPagesAdded)")] HPROPSHEETPAGE* aPages,
  4547. [in, annotation("__in")] UINT cPages,
  4548. [out, annotation("__out __deref_out_range(0, cPages)")] UINT *pnPagesAdded);
  4549. HRESULT GetFirstPage([out, annotation("__out")] HPROPSHEETPAGE *phpage);
  4550. HRESULT GetLastPage([out, annotation("__out")] HPROPSHEETPAGE *phpage);
  4551. }
  4552. // The Web Wizard is a HTML host for wizard pages, it allows you
  4553. // create a HTML wizard starting at the URL defined via SetInitialURL.
  4554. // Web Wizard Page Extension
  4555. [
  4556. uuid(0e6b3f66-98d1-48c0-a222-fbde74e2fbc5),
  4557. local,
  4558. pointer_default(unique)
  4559. ]
  4560. interface IWebWizardExtension : IWizardExtension
  4561. {
  4562. HRESULT SetInitialURL([in, string, annotation("__in")] LPCWSTR pszURL);
  4563. HRESULT SetErrorURL([in, string, annotation("__in")] LPCWSTR pszErrorURL);
  4564. }
  4565. cpp_quote("#define SID_WebWizardHost IID_IWebWizardExtension")
  4566. // flags for the host to control the publishing wizard
  4567. cpp_quote ("#define SHPWHF_NORECOMPRESS 0x00000001 // don't allow/prompt for recompress of streams")
  4568. cpp_quote ("#define SHPWHF_NONETPLACECREATE 0x00000002 // don't create a network place when transfer is complete")
  4569. cpp_quote ("#define SHPWHF_NOFILESELECTOR 0x00000004 // don't show the file selector")
  4570. cpp_quote ("#define SHPWHF_USEMRU 0x00000008 // For OPW. Use the Most-Recently-Used Print Provider")
  4571. cpp_quote ("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  4572. cpp_quote ("#define SHPWHF_ANYLOCATION 0x00000100 // allow publishing to any location")
  4573. cpp_quote ("#endif // NTDDI_VISTA")
  4574. cpp_quote ("#define SHPWHF_VALIDATEVIAWEBFOLDERS 0x00010000 // enable web folders to validate network places (ANP support)")
  4575. // Web Publishing Wizard
  4576. [
  4577. uuid(aa9198bb-ccec-472d-beed-19a4f6733f7a),
  4578. local,
  4579. pointer_default(unique)
  4580. ]
  4581. interface IPublishingWizard : IWizardExtension
  4582. {
  4583. HRESULT Initialize(
  4584. [in, unique, annotation("__in_opt")] IDataObject *pdo,
  4585. [in, annotation("__in")] DWORD dwOptions,
  4586. [in, string, annotation("__in")] LPCWSTR pszServiceScope);
  4587. HRESULT GetTransferManifest(
  4588. [out, annotation("__out_opt")] HRESULT *phrFromTransfer,
  4589. [out, annotation("__deref_opt_out")] IXMLDOMDocument **pdocManifest);
  4590. }
  4591. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WINXP) || (_WIN32_IE >= _WIN32_IE_IE70)")
  4592. // Object to host an IFolderView in a window. This is used to build check mark selection
  4593. // UI for files.
  4594. // Shell Folder Host
  4595. [
  4596. uuid(1ea58f02-d55a-411d-b09e-9e65ac21605b),
  4597. local,
  4598. ]
  4599. interface IFolderViewHost : IUnknown
  4600. {
  4601. HRESULT Initialize(
  4602. [in, annotation("__in")] HWND hwndParent,
  4603. [in, annotation("__in")] IDataObject *pdo,
  4604. [in, annotation("__in")] RECT *prc);
  4605. };
  4606. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  4607. // Event sink interface for IExplorerBrowser events
  4608. [
  4609. uuid(361bbdc7-e6ee-4e13-be58-58e2240c810f), // IID_IExplorerBrowserEvents
  4610. object
  4611. ]
  4612. interface IExplorerBrowserEvents : IUnknown
  4613. {
  4614. // Returning failure from this will cancel the navigation.
  4615. HRESULT OnNavigationPending([in] PCIDLIST_ABSOLUTE pidlFolder);
  4616. // Called once the view window has been created. Do any last minute modifcations
  4617. // to the view here before it is shown (set view modes, folder flags, etc...)
  4618. HRESULT OnViewCreated([in] IShellView *psv);
  4619. // Called once the navigation has succeeded (after OnViewCreated).
  4620. HRESULT OnNavigationComplete([in] PCIDLIST_ABSOLUTE pidlFolder);
  4621. // Called if a navigation failed, despite the call to IShellBrowser::BrowseObject succeeding.
  4622. HRESULT OnNavigationFailed([in] PCIDLIST_ABSOLUTE pidlFolder);
  4623. }
  4624. // IExplorerBrowser::SetOptions() flags
  4625. typedef [v1_enum] enum EXPLORER_BROWSER_OPTIONS
  4626. {
  4627. EBO_NONE = 0x00000000, // No options
  4628. EBO_NAVIGATEONCE = 0x00000001, // Don't navigate after initial navigation
  4629. EBO_SHOWFRAMES = 0X00000002, // Show with frame module manager on - otherwise, single view object
  4630. EBO_ALWAYSNAVIGATE = 0x00000004, // Always navigate, even if you are attempting to navigate to the current folder
  4631. EBO_NOTRAVELLOG = 0x00000008, // do not update travel log
  4632. EBO_NOWRAPPERWINDOW = 0x00000010, // For legacy clients that need the browser parented directly on themselves
  4633. EBO_HTMLSHAREPOINTVIEW = 0x00000020, // Show WebView for sharepoint sites
  4634. } EXPLORER_BROWSER_OPTIONS;
  4635. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(EXPLORER_BROWSER_OPTIONS)")
  4636. // IExplorerBrowser::FillFromObject() flags
  4637. // Cannot conflict with SBSP_... flags from IShellBrowser::BrowseObject()
  4638. typedef [v1_enum] enum EXPLORER_BROWSER_FILL_FLAGS
  4639. {
  4640. EBF_NONE = 0x0000000, // No flags
  4641. // Causes FillFromObject to populate the ResultsFolder with the
  4642. // contents of the parent folders of the items in the DataObject
  4643. // and then check-selects only the items that are in the DataObject
  4644. EBF_SELECTFROMDATAOBJECT = 0x0000100,
  4645. // don't regsiter a drop target for the view, this enables apps to register their own drop target
  4646. // that they can use to receive the drops
  4647. EBF_NODROPTARGET = 0x0000200,
  4648. } EXPLORER_BROWSER_FILL_FLAGS;
  4649. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(EXPLORER_BROWSER_FILL_FLAGS)")
  4650. //
  4651. // This allows you to host a simple browser (CLSID_ExplorerBrowser) that can be navigated
  4652. // or host a view of a data object. Use either BrowseToIDList or BrowseToObject to navigate
  4653. // the browser or use FillWithDataObject to create the view on the data object.
  4654. //
  4655. [
  4656. uuid(dfd3b6b5-c10c-4be9-85f6-a66969f402f6),
  4657. object,
  4658. ]
  4659. interface IExplorerBrowser : IUnknown
  4660. {
  4661. // to clean up this object you must call ::Destroy.
  4662. [local] HRESULT Initialize(
  4663. [in, annotation("__in")] HWND hwndParent,
  4664. [in, annotation("__in")] const RECT *prc,
  4665. [in, unique, annotation("__in_opt")] const FOLDERSETTINGS *pfs);
  4666. HRESULT Destroy();
  4667. [local] HRESULT SetRect(
  4668. [in, out, unique, annotation("__inout_opt")] HDWP *phdwp,
  4669. [in, annotation("__in")] RECT rcBrowser); // relative to hwndParent
  4670. HRESULT SetPropertyBag([in, string] LPCWSTR pszPropertyBag); // Property bag for view state persistence
  4671. HRESULT SetEmptyText([in, string] LPCWSTR pszEmptyText); // Displayed when view is empty
  4672. HRESULT SetFolderSettings([in] const FOLDERSETTINGS *pfs); // Sets how view displays / operates
  4673. HRESULT Advise([in] IExplorerBrowserEvents *psbe, [out] DWORD *pdwCookie);
  4674. HRESULT Unadvise([in] DWORD dwCookie);
  4675. HRESULT SetOptions([in] EXPLORER_BROWSER_OPTIONS dwFlag);
  4676. HRESULT GetOptions([out] EXPLORER_BROWSER_OPTIONS *pdwFlag);
  4677. // navigate the browser to a particular location
  4678. // uFlags contains SBSP_ flag values
  4679. HRESULT BrowseToIDList([in] PCUIDLIST_RELATIVE pidl, [in] UINT uFlags);
  4680. // punk is a shell item (IShellItem) or any object that can produce an IDList
  4681. // using SHGetIDListFromObject()
  4682. // uFlags contains SBSP_ flag values
  4683. HRESULT BrowseToObject([in] IUnknown *punk, [in] UINT uFlags);
  4684. // populate from a given data source
  4685. // punk can be an IDataObject or anything that can be used with INamespaceWalk
  4686. HRESULT FillFromObject([in, unique] IUnknown *punk, [in] EXPLORER_BROWSER_FILL_FLAGS dwFlags);
  4687. HRESULT RemoveAll();
  4688. // return the current view object on IShellView or IFolderView or related interface
  4689. HRESULT GetCurrentView([in] REFIID riid, [out, iid_is(riid)] void **ppv);
  4690. }
  4691. //
  4692. // This allows you to set the accessible name on COM objects that function as UI elements
  4693. //
  4694. [
  4695. uuid(95A391C5-9ED4-4c28-8401-AB9E06719E11),
  4696. object,
  4697. ]
  4698. interface IAccessibleObject : IUnknown
  4699. {
  4700. HRESULT SetAccessibleName([in, string] LPCWSTR pszName);
  4701. }
  4702. cpp_quote("#endif // (_WIN32_IE >= _WIN32_IE_IE70)")
  4703. // New for Vista, but used by downlevel code
  4704. //cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  4705. [
  4706. object,
  4707. uuid(96E5AE6D-6AE1-4b1c-900C-C6480EAA8828),
  4708. pointer_default(unique)
  4709. ]
  4710. interface IResultsFolder : IUnknown
  4711. {
  4712. HRESULT AddItem([in] IShellItem *psi);
  4713. [local]
  4714. HRESULT AddIDList(
  4715. [in, annotation("__in")] PCIDLIST_ABSOLUTE pidl,
  4716. [out, annotation("__deref_opt_out")] PITEMID_CHILD *ppidlAdded);
  4717. [call_as(AddIDList)]
  4718. HRESULT RemoteAddIDList(
  4719. [in] PCIDLIST_ABSOLUTE pidl,
  4720. [out] PITEMID_CHILD *ppidlAdded);
  4721. HRESULT RemoveItem([in] IShellItem *psi);
  4722. HRESULT RemoveIDList([in] PCIDLIST_ABSOLUTE pidl);
  4723. HRESULT RemoveAll();
  4724. }
  4725. //cpp_quote("#endif // NTDDI_VISTA")
  4726. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  4727. // Unknown Object Enumerator
  4728. [
  4729. uuid(2c1c7e2e-2d0e-4059-831e-1e6f82335c2e),
  4730. object,
  4731. pointer_default(unique)
  4732. ]
  4733. interface IEnumObjects : IUnknown
  4734. {
  4735. [local] HRESULT Next(
  4736. [in, annotation("__in")] ULONG celt,
  4737. [in, annotation("__in")] REFIID riid,
  4738. [out, size_is(celt), length_is(*pceltFetched), iid_is(riid), annotation("__out_ecount_part(celt, *pceltFetched)")] void **rgelt,
  4739. [out, annotation("__out_opt __deref_out_range(0, celt)")] ULONG *pceltFetched);
  4740. [call_as(Next)] HRESULT RemoteNext(
  4741. [in] ULONG celt,
  4742. [in] REFIID riid,
  4743. [out, size_is(celt), length_is(*pceltFetched), iid_is(riid)] void **rgelt,
  4744. [out] ULONG *pceltFetched);
  4745. HRESULT Skip([in] ULONG celt);
  4746. HRESULT Reset();
  4747. HRESULT Clone([out] IEnumObjects **ppenum);
  4748. }
  4749. [v1_enum] enum _OPPROGDLGF
  4750. {
  4751. // The flag space includes OPPROGDLG_ and PROGDLG_ values
  4752. // please guarantee they don't conflict. See shlobj.w for PROGDLG_*
  4753. OPPROGDLG_DEFAULT = 0x00000000,
  4754. OPPROGDLG_ENABLEPAUSE = 0x00000080, // Add a pause button (operation can be paused)
  4755. OPPROGDLG_ALLOWUNDO = 0x00000100, // The operation can be undone in the dialog. (The Stop button becomes Undo)
  4756. OPPROGDLG_DONTDISPLAYSOURCEPATH = 0x00000200, // Don't display the path of source file in progress dialog
  4757. OPPROGDLG_DONTDISPLAYDESTPATH = 0x00000400, // Don't display the path of destination file in progress dialog
  4758. OPPROGDLG_NOMULTIDAYESTIMATES = 0x00000800, // deprecated - progress dialog no longer displays > 1 day estimates
  4759. OPPROGDLG_DONTDISPLAYLOCATIONS = 0x00001000, // Don't display the location line in the progress dialog
  4760. };
  4761. typedef DWORD OPPROGDLGF;
  4762. // Shell Operations Engine Progress Dialog
  4763. [
  4764. uuid(0C9FB851-E5C9-43EB-A370-F0677B13874C),
  4765. object,
  4766. pointer_default(unique)
  4767. ]
  4768. interface IOperationsProgressDialog : IUnknown
  4769. {
  4770. [v1_enum] enum _PDMODE
  4771. {
  4772. PDM_DEFAULT = 0x00000000,
  4773. PDM_RUN = 0x00000001, // Operation is running
  4774. PDM_PREFLIGHT = 0x00000002, // Pre-flight mode, calculating operation time, etc
  4775. PDM_UNDOING = 0x00000004, // Operation is rolling back, undo has been selected
  4776. PDM_ERRORSBLOCKING = 0x00000008, // Only errors remain, error dialogs are blocking progress from completing
  4777. PDM_INDETERMINATE = 0x00000010, // The length of the operation is indeterminate, don't show a timer, progressbar is in marquee mode
  4778. };
  4779. typedef DWORD PDMODE;
  4780. typedef [v1_enum] enum PDOPSTATUS
  4781. {
  4782. PDOPS_RUNNING = 1, // Operation is running, no user intervention
  4783. PDOPS_PAUSED = 2, // Operation has been paused by the user
  4784. PDOPS_CANCELLED = 3, // Operation has been cancelled by the user - now go undo
  4785. PDOPS_STOPPED = 4, // Operation has been stopped by the user - terminate completely
  4786. PDOPS_ERRORS = 5, // Operation has gone as far as it can without throwing error dialogs
  4787. } PDOPSTATUS;
  4788. HRESULT StartProgressDialog([in, unique] HWND hwndOwner, [in] OPPROGDLGF flags);
  4789. HRESULT StopProgressDialog();
  4790. // Sets which operation is occuring, and whether we are in pre-flight or undo mode - sets animations, text, etc.
  4791. HRESULT SetOperation([in] SPACTION action);
  4792. HRESULT SetMode([in] PDMODE mode);
  4793. HRESULT UpdateProgress(
  4794. [in] ULONGLONG ullPointsCurrent, // Progress (in points) we are currently at
  4795. [in] ULONGLONG ullPointsTotal, // Progress (in points) to go to timer
  4796. [in] ULONGLONG ullSizeCurrent, // Progress (in bytes) we are currently at
  4797. [in] ULONGLONG ullSizeTotal, // Progress (in bytes) total
  4798. [in] ULONGLONG ullItemsCurrent, // Progress (in # of items) we are currently at
  4799. [in] ULONGLONG ullItemsTotal); // Progress (in # of items) total
  4800. // Used to generate display for "from <item (path)> to <item (path)>", etc.
  4801. HRESULT UpdateLocations(
  4802. [in, unique] IShellItem *psiSource,
  4803. [in, unique] IShellItem *psiTarget,
  4804. [in, unique] IShellItem *psiItem);
  4805. HRESULT ResetTimer();
  4806. HRESULT PauseTimer();
  4807. HRESULT ResumeTimer();
  4808. HRESULT GetMilliseconds([out] ULONGLONG *pullElapsed, [out] ULONGLONG *pullRemaining);
  4809. // Returns running/paused/cancelled, etc.
  4810. HRESULT GetOperationStatus([out] PDOPSTATUS *popstatus);
  4811. }
  4812. // Handles the thread ID and message information used after cancelling progress UI
  4813. [
  4814. uuid(f5b0bf81-8cb5-4b1b-9449-1a159e0c733c),
  4815. object,
  4816. pointer_default(unique),
  4817. local
  4818. ]
  4819. interface IIOCancelInformation : IUnknown
  4820. {
  4821. // When the progress UI is cancled by the user, dwThreadID will have
  4822. // 1) any pending or future IO requests canceled using CancelSynchronousIo()
  4823. // 2) uMsgCancel will be posted to the thread to tell it to
  4824. // exit a wait that it might be in waiting for async IO to complete
  4825. HRESULT SetCancelInformation([in] DWORD dwThreadID, [in] UINT uMsgCancel);
  4826. HRESULT GetCancelInformation([out, annotation("__out_opt")] DWORD *pdwThreadID, [out, annotation("__out_opt")] UINT *puMsgCancel);
  4827. }
  4828. // Extended FOF_ flags passed to IFileOperation::SetOperationFlags()
  4829. // These flags only work with IFileOperation not SHFileOperation.
  4830. // other posible FOF_ flags are specified in shellapi.h
  4831. cpp_quote("#define FOFX_NOSKIPJUNCTIONS 0x00010000 // Don't avoid binding to junctions (like Task folder, Recycle-Bin)")
  4832. cpp_quote("#define FOFX_PREFERHARDLINK 0x00020000 // Create hard link if possible")
  4833. cpp_quote("#define FOFX_SHOWELEVATIONPROMPT 0x00040000 // Show elevation prompts when error UI is disabled (use with FOF_NOERRORUI)")
  4834. cpp_quote("#define FOFX_EARLYFAILURE 0x00100000 // Fail operation as soon as a single error occurs rather than trying to process other items (applies only when using FOF_NOERRORUI)")
  4835. cpp_quote("#define FOFX_PRESERVEFILEEXTENSIONS 0x00200000 // Rename collisions preserve file extns (use with FOF_RENAMEONCOLLISION)")
  4836. cpp_quote("#define FOFX_KEEPNEWERFILE 0x00400000 // Keep newer file on naming conflicts")
  4837. cpp_quote("#define FOFX_NOCOPYHOOKS 0x00800000 // Don't use copy hooks")
  4838. cpp_quote("#define FOFX_NOMINIMIZEBOX 0x01000000 // Don't allow minimizing the progress dialog")
  4839. cpp_quote("#define FOFX_MOVEACLSACROSSVOLUMES 0x02000000 // Copy security information when performing a cross-volume move operation")
  4840. cpp_quote("#define FOFX_DONTDISPLAYSOURCEPATH 0x04000000 // Don't display the path of source file in progress dialog")
  4841. cpp_quote("#define FOFX_DONTDISPLAYDESTPATH 0x08000000 // Don't display the path of destination file in progress dialog")
  4842. cpp_quote("#define FOFX_REQUIREELEVATION 0x10000000 // User expects the elevation; don't show a dialog to confirm")
  4843. cpp_quote("#define FOFX_COPYASDOWNLOAD 0x40000000 // Show Downloading instead of Copying")
  4844. cpp_quote("#define FOFX_DONTDISPLAYLOCATIONS 0x80000000 // Hides the locations line in the progress dialog")
  4845. // Shell Copy/Move/Rename/Delete/Link/ApplyProperties Operation Handler
  4846. [
  4847. uuid(947aab5f-0a5c-4c13-b4d6-4bf7836fc9f8),
  4848. object,
  4849. pointer_default(unique)
  4850. ]
  4851. interface IFileOperation : IUnknown
  4852. {
  4853. // 1) (Optional) Set up your event sink.
  4854. HRESULT Advise([in] IFileOperationProgressSink *pfops, [out] DWORD *pdwCookie);
  4855. HRESULT Unadvise([in] DWORD dwCookie);
  4856. // 2) Set operation state
  4857. // FOF_ flags (defined in shellapi.h) and FOFX_ flags are passed here
  4858. // if not specified the default flags are FOF_ALLOWUNDO | FOF_NOCONFIRMMKDIR
  4859. HRESULT SetOperationFlags([in] DWORD dwOperationFlags);
  4860. HRESULT SetProgressMessage([in, string] LPCWSTR pszMessage);
  4861. HRESULT SetProgressDialog([in] IOperationsProgressDialog *popd);
  4862. HRESULT SetProperties([in] IPropertyChangeArray *pproparray);
  4863. HRESULT SetOwnerWindow([in] HWND hwndOwner);
  4864. // 3) Specify operations to take on given items.
  4865. // FooItem takes an IShellItem*.
  4866. // FooItems takes an IShellItem*, an IEnumShellItems* or an IDataObject*.
  4867. HRESULT ApplyPropertiesToItem([in] IShellItem *psiItem);
  4868. HRESULT ApplyPropertiesToItems([in] IUnknown *punkItems);
  4869. HRESULT RenameItem(
  4870. [in] IShellItem *psiItem,
  4871. [in, string] LPCWSTR pszNewName,
  4872. [in, unique] IFileOperationProgressSink *pfopsItem);
  4873. HRESULT RenameItems(
  4874. [in] IUnknown *pUnkItems,
  4875. [in, string] LPCWSTR pszNewName);
  4876. HRESULT MoveItem(
  4877. [in] IShellItem *psiItem,
  4878. [in] IShellItem *psiDestinationFolder,
  4879. [in, unique, string] LPCWSTR pszNewName,
  4880. [in, unique] IFileOperationProgressSink *pfopsItem);
  4881. HRESULT MoveItems(
  4882. [in] IUnknown *punkItems,
  4883. [in] IShellItem *psiDestinationFolder);
  4884. HRESULT CopyItem(
  4885. [in] IShellItem *psiItem,
  4886. [in] IShellItem *psiDestinationFolder,
  4887. [in, unique, string] LPCWSTR pszCopyName,
  4888. [in, unique] IFileOperationProgressSink *pfopsItem);
  4889. HRESULT CopyItems(
  4890. [in] IUnknown *punkItems,
  4891. [in] IShellItem *psiDestinationFolder);
  4892. HRESULT DeleteItem(
  4893. [in] IShellItem *psiItem,
  4894. [in, unique] IFileOperationProgressSink *pfopsItem);
  4895. HRESULT DeleteItems([in] IUnknown *punkItems);
  4896. HRESULT NewItem(
  4897. [in] IShellItem *psiDestinationFolder,
  4898. [in] DWORD dwFileAttributes,
  4899. [in, unique, string] LPCWSTR pszName,
  4900. [in, unique, string] LPCWSTR pszTemplateName,
  4901. [in, unique] IFileOperationProgressSink *pfopsItem);
  4902. // 4) Perform operations.
  4903. HRESULT PerformOperations();
  4904. // 5) Were any operations aborted?
  4905. HRESULT GetAnyOperationsAborted([out] BOOL *pfAnyOperationsAborted);
  4906. }
  4907. [
  4908. uuid(a6087428-3be3-4d73-b308-7c04a540bf1a),
  4909. object,
  4910. pointer_default(unique)
  4911. ]
  4912. interface IObjectProvider : IUnknown
  4913. {
  4914. // IObjectProvider is similar to IServiceProvider except that it
  4915. // does not imply that unhandled/unknown requests should be forwarded,
  4916. // as IServiceProvider does. the object being queired for is identified
  4917. // by guidObject, usually named as OID_XXX
  4918. HRESULT QueryObject([in] REFGUID guidObject, [in] REFIID riid, [out, iid_is(riid)] void **ppvOut);
  4919. }
  4920. cpp_quote("#endif // (_WIN32_IE >= _WIN32_IE_IE70)")
  4921. // shell name space walking callback interface"),
  4922. [
  4923. uuid(d92995f8-cf5e-4a76-bf59-ead39ea2b97e),
  4924. ]
  4925. interface INamespaceWalkCB : IUnknown
  4926. {
  4927. // called for every non folder item found in the folder. these items are reported
  4928. // before any of the folders are returned via EnterFolder(). this is a bredth first
  4929. // walk of the name space
  4930. HRESULT FoundItem([in] IShellFolder *psf, [in] PCUITEMID_CHILD pidl);
  4931. // this is called for ever sub folder found below the punkToWalk input
  4932. // it is not called for any folders specified directly in the input
  4933. //
  4934. // for every folder this is called after all of the items in the folder have
  4935. // been reported via FoundItem()
  4936. //
  4937. // return:
  4938. // S_OK to continue recursing
  4939. // S_FALSE to skip this folder but continue
  4940. // FAILED() (HRESULT_FROM_WIN32(ERROR_CANCELLED)) to stop the whole walk
  4941. HRESULT EnterFolder([in] IShellFolder *psf, [in] PCUITEMID_CHILD pidl);
  4942. // matches the EnterFolder() calls, but since folders can nest this
  4943. // other folders may be entered and left before the matching call is made
  4944. HRESULT LeaveFolder([in] IShellFolder *psf, [in] PCUITEMID_CHILD pidl);
  4945. HRESULT InitializeProgressDialog([out, string] LPWSTR *ppszTitle, [out, string] LPWSTR *ppszCancel);
  4946. }
  4947. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  4948. [
  4949. uuid(7ac7492b-c38e-438a-87db-68737844ff70),
  4950. ]
  4951. interface INamespaceWalkCB2 : INamespaceWalkCB
  4952. {
  4953. HRESULT WalkComplete([in] HRESULT hr);
  4954. }
  4955. cpp_quote("#endif // (_WIN32_IE >= _WIN32_IE_IE70)")
  4956. // shell name space walk, used to expand data objects, views or recurse folders
  4957. [
  4958. uuid(57ced8a7-3f4a-432c-9350-30f24483f74f),
  4959. ]
  4960. interface INamespaceWalk : IUnknown
  4961. {
  4962. typedef [v1_enum] enum
  4963. {
  4964. NSWF_DEFAULT = 0x00000000,
  4965. NSWF_NONE_IMPLIES_ALL = 0x00000001,
  4966. NSWF_ONE_IMPLIES_ALL = 0x00000002,
  4967. NSWF_DONT_TRAVERSE_LINKS = 0x00000004, // don't traverse the targets of link items (items with SFGAO_LINK)
  4968. NSWF_DONT_ACCUMULATE_RESULT = 0x00000008, // don't store the results of the walk, GetIDArrayResult() will fail if called
  4969. // for items with both SFGAO_FOLDER and SFGAO_STREAM discovered via the walk
  4970. // (as opposed to those passed as the input) for example .zip, .search-ms and .library-ms files
  4971. // traverse through them and find the items they reference. this will result in
  4972. // EnterFolder()/LeaveFolder() callbacks instead of FoundItem()
  4973. NSWF_TRAVERSE_STREAM_JUNCTIONS = 0x00000010,
  4974. NSWF_FILESYSTEM_ONLY = 0x00000020, // only return file system items (SFGAO_FILESYSTEM)
  4975. NSWF_SHOW_PROGRESS = 0x00000040, // display the progress dialog while walking
  4976. NSWF_FLAG_VIEWORDER = 0x00000080, // order the items based on the view order that might be different from the default sort
  4977. NSWF_IGNORE_AUTOPLAY_HIDA = 0x00000100,
  4978. NSWF_ASYNC = 0x00000200, // run the walk on a background thread
  4979. NSWF_DONT_RESOLVE_LINKS = 0x00000400, // avoid the expense of resolving links, means link targets might not be up to date
  4980. NSWF_ACCUMULATE_FOLDERS = 0x00000800,
  4981. NSWF_DONT_SORT = 0x00001000, // Don't maintain sort order of items
  4982. NSWF_USE_TRANSFER_MEDIUM = 0x00002000, // Use SHCONTF_STORAGE in enumerations
  4983. // for items with both SFGAO_FOLDER and SFGAO_STREAM passed to the walk
  4984. // (as opposed to those discovered by walking), for example .zip, .search-ms and .library-ms files
  4985. // do not traverse them, instead treat them as items. this will result in
  4986. // FoundItem() callbacks instead of EnterFolder()/LeaveFolder()
  4987. NSWF_DONT_TRAVERSE_STREAM_JUNCTIONS = 0x00004000,
  4988. } NAMESPACEWALKFLAG;
  4989. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(NAMESPACEWALKFLAG)")
  4990. // punkToWalk can be
  4991. // a punkSite that QueryService(SID_SFolderView, IFolderView) can discover
  4992. // IShellFolder
  4993. // IDataObject
  4994. // IParentAndItem (thus supports CLSID_ShellItem/IShellItem)
  4995. // IEnumFullIDList
  4996. // IShellItem
  4997. // IShellItemArray
  4998. HRESULT Walk(
  4999. [in] IUnknown *punkToWalk,
  5000. [in] DWORD /* NAMESPACEWALKFLAG */ dwFlags,
  5001. [in] int cDepth,
  5002. [in, unique] INamespaceWalkCB *pnswcb);
  5003. HRESULT GetIDArrayResult(
  5004. [out] UINT *pcItems,
  5005. [out, size_is( , *pcItems)] PIDLIST_ABSOLUTE **prgpidl);
  5006. }
  5007. cpp_quote("#endif // NTDDI_WINXP || (_WIN32_IE >= _WIN32_IE_IE70)")
  5008. cpp_quote("__inline void FreeIDListArray(__in_ecount(cItems) PIDLIST_RELATIVE *ppidls, UINT cItems)")
  5009. cpp_quote("{ ")
  5010. cpp_quote(" UINT i; ")
  5011. cpp_quote(" for (i = 0; i < cItems; i++) ")
  5012. cpp_quote(" { ")
  5013. cpp_quote(" CoTaskMemFree(ppidls[i]); ")
  5014. cpp_quote(" } ")
  5015. cpp_quote(" CoTaskMemFree(ppidls); ")
  5016. cpp_quote("} ")
  5017. cpp_quote("#if defined(STRICT_TYPED_ITEMIDS) && defined(__cplusplus)")
  5018. cpp_quote("__inline void FreeIDListArrayFull(__in_ecount(cItems) PIDLIST_ABSOLUTE *ppidls, UINT cItems)")
  5019. cpp_quote("{ ")
  5020. cpp_quote(" for (UINT i = 0; i < cItems; i++) ")
  5021. cpp_quote(" { ")
  5022. cpp_quote(" CoTaskMemFree(ppidls[i]); ")
  5023. cpp_quote(" } ")
  5024. cpp_quote(" CoTaskMemFree(ppidls); ")
  5025. cpp_quote("} ")
  5026. cpp_quote("__inline void FreeIDListArrayChild(__in_ecount(cItems) PITEMID_CHILD *ppidls, UINT cItems)")
  5027. cpp_quote("{ ")
  5028. cpp_quote(" for (UINT i = 0; i < cItems; i++) ")
  5029. cpp_quote(" { ")
  5030. cpp_quote(" CoTaskMemFree(ppidls[i]); ")
  5031. cpp_quote(" } ")
  5032. cpp_quote(" CoTaskMemFree(ppidls); ")
  5033. cpp_quote("} ")
  5034. cpp_quote("#else // defined(STRICT_TYPED_ITEMIDS) && defined(__cplusplus)")
  5035. cpp_quote("#define FreeIDListArrayFull FreeIDListArray")
  5036. cpp_quote("#define FreeIDListArrayChild FreeIDListArray")
  5037. cpp_quote("#endif // defined(STRICT_TYPED_ITEMIDS) && defined(__cplusplus)")
  5038. //
  5039. // Flags for IAutoCompleteDropDown::GetDropDownStatus
  5040. //
  5041. cpp_quote("#define ACDD_VISIBLE 0x0001")
  5042. [
  5043. uuid(3CD141F4-3C6A-11d2-BCAA-00C04FD929DB),
  5044. object,
  5045. pointer_default(unique)
  5046. ]
  5047. interface IAutoCompleteDropDown : IUnknown
  5048. {
  5049. HRESULT GetDropDownStatus(
  5050. [out] DWORD *pdwFlags,
  5051. [out, string] LPWSTR *ppwszString);
  5052. HRESULT ResetEnumerator();
  5053. }
  5054. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE40)")
  5055. //-------------------------------------------------------------------------
  5056. //
  5057. // IBandSite interface
  5058. //
  5059. // This interface provides methods to get or set bandsite information.
  5060. //
  5061. // [Member functions]
  5062. //
  5063. // IBandSite::AddBand(punk)
  5064. // Add a band to the bandsite. Returns the band ID in ShortFromResult(hres).
  5065. //
  5066. // IBandSite::EnumBands(uBand, *pdwBandID)
  5067. // Enumerate the bands. If uBand is -1, pdwBandID is ignored and this
  5068. // method returns the count of bands in the bandsite. Call this method
  5069. // with uBand starting at 0 to begin enumerating. Returns S_OK and the
  5070. // band ID in *pdwBandID of the next band.
  5071. //
  5072. // IBandSite::QueryBand(dwBandID, ppstb, pdwState, pszName, cchName)
  5073. // Get info about a band.
  5074. //
  5075. // IBandSite::SetBandState(dwBandID, dwState)
  5076. // Set the band's state.
  5077. //
  5078. // IBandSite::RemoveBand(dwBandID)
  5079. // Remove the band.
  5080. //
  5081. // IBandSite::GetBandObject(dwBandID, riid, ppv)
  5082. // Get an object that support riid for the band.
  5083. //
  5084. // IBandSite::GetBandSiteInfo(pbsinfo)
  5085. // Get info about the bandsite.
  5086. //
  5087. // IBandSite::SetBandSiteInfo(pbsinfo)
  5088. // Set info about the bandsite.
  5089. //
  5090. //-------------------------------------------------------------------------
  5091. cpp_quote("#include <pshpack8.h>")
  5092. typedef struct tagBANDSITEINFO
  5093. {
  5094. DWORD dwMask; // BSIM_* flags
  5095. DWORD dwState; // BSSF_* flags
  5096. DWORD dwStyle; // BSIS_* flags
  5097. } BANDSITEINFO;
  5098. cpp_quote("#include <poppack.h>") // Return to byte packing
  5099. enum tagBANDSITECID {
  5100. BSID_BANDADDED,
  5101. BSID_BANDREMOVED,
  5102. };
  5103. // Field mask
  5104. cpp_quote("#define BSIM_STATE 0x00000001")
  5105. cpp_quote("#define BSIM_STYLE 0x00000002")
  5106. // State flags
  5107. cpp_quote("#define BSSF_VISIBLE 0x00000001")
  5108. cpp_quote("#define BSSF_NOTITLE 0x00000002")
  5109. cpp_quote("#define BSSF_UNDELETEABLE 0x00001000")
  5110. // Style flags
  5111. cpp_quote("#define BSIS_AUTOGRIPPER 0x00000000")
  5112. cpp_quote("#define BSIS_NOGRIPPER 0x00000001")
  5113. cpp_quote("#define BSIS_ALWAYSGRIPPER 0x00000002")
  5114. cpp_quote("#define BSIS_LEFTALIGN 0x00000004")
  5115. cpp_quote("#define BSIS_SINGLECLICK 0x00000008")
  5116. cpp_quote("#define BSIS_NOCONTEXTMENU 0x00000010")
  5117. cpp_quote("#define BSIS_NODROPTARGET 0x00000020")
  5118. cpp_quote("#define BSIS_NOCAPTION 0x00000040")
  5119. cpp_quote("#define BSIS_PREFERNOLINEBREAK 0x00000080")
  5120. cpp_quote("#define BSIS_LOCKED 0x00000100")
  5121. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  5122. cpp_quote("#define BSIS_PRESERVEORDERDURINGLAYOUT 0x00000200")
  5123. cpp_quote("#define BSIS_FIXEDORDER 0x00000400")
  5124. cpp_quote("#endif // _WIN32_IE_IE70")
  5125. cpp_quote("#define SID_SBandSite IID_IBandSite")
  5126. cpp_quote("#define CGID_BandSite IID_IBandSite")
  5127. [
  5128. object,
  5129. uuid(4CF504B0-DE96-11D0-8B3F-00A0C911E8E5)
  5130. ]
  5131. interface IBandSite : IUnknown
  5132. {
  5133. HRESULT AddBand([in] IUnknown* punk);
  5134. HRESULT EnumBands(
  5135. [in] UINT uBand,
  5136. [out] DWORD* pdwBandID);
  5137. [local]
  5138. HRESULT QueryBand(
  5139. [in, annotation("__in")] DWORD dwBandID,
  5140. [out, annotation("__deref_opt_out")] IDeskBand** ppstb,
  5141. [out, annotation("__out_opt")] DWORD* pdwState,
  5142. [out, string, size_is(cchName), annotation("__out_ecount_opt(cchName)")] LPWSTR pszName,
  5143. [in, annotation("__in")] int cchName);
  5144. [call_as(QueryBand)]
  5145. HRESULT RemoteQueryBand(
  5146. [in] DWORD dwBandID,
  5147. [out] IDeskBand** ppstb,
  5148. [out] DWORD* pdwState,
  5149. [out, string, size_is(cchName)] LPWSTR pszName,
  5150. [in] int cchName);
  5151. HRESULT SetBandState(
  5152. [in] DWORD dwBandID,
  5153. [in] DWORD dwMask,
  5154. [in] DWORD dwState);
  5155. HRESULT RemoveBand([in] DWORD dwBandID);
  5156. HRESULT GetBandObject(
  5157. [in] DWORD dwBandID,
  5158. [in] REFIID riid,
  5159. [out, iid_is(riid)] void **ppv);
  5160. HRESULT SetBandSiteInfo([in] const BANDSITEINFO *pbsinfo);
  5161. HRESULT GetBandSiteInfo([in, out] BANDSITEINFO *pbsinfo);
  5162. }
  5163. cpp_quote("#endif // _WIN32_IE_IE40")
  5164. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WINXP)")
  5165. // simple interface for showing a window
  5166. [
  5167. uuid(b4db1657-70d7-485e-8e3e-6fcb5a5c1802),
  5168. object,
  5169. pointer_default(unique)
  5170. ]
  5171. interface IModalWindow : IUnknown
  5172. {
  5173. [local] HRESULT Show([in, unique, annotation("__in_opt")] HWND hwndOwner);
  5174. [call_as(Show)] HRESULT RemoteShow([in, unique] HWND hwndOwner);
  5175. }
  5176. // the cd burning wizard extension sets return codes through a property bag
  5177. // to tell the main wizard whether it should stop or keep going
  5178. cpp_quote("#define PROPSTR_EXTENSIONCOMPLETIONSTATE L\"ExtensionCompletionState\"")
  5179. enum tagCDBURNINGEXTENSIONRET
  5180. {
  5181. CDBE_RET_DEFAULT = 0x00000000,
  5182. CDBE_RET_DONTRUNOTHEREXTS = 0x00000001,
  5183. CDBE_RET_STOPWIZARD = 0x00000002,
  5184. };
  5185. cpp_quote("#define SID_CDWizardHost IID_ICDBurnExt")
  5186. [v1_enum] enum _CDBE_ACTIONS
  5187. {
  5188. CDBE_TYPE_MUSIC = 0x00000001,
  5189. CDBE_TYPE_DATA = 0x00000002,
  5190. CDBE_TYPE_ALL = (int) 0xFFFFFFFF
  5191. };
  5192. typedef DWORD CDBE_ACTIONS;
  5193. // add-ons for cd burning
  5194. [
  5195. uuid(2271dcca-74fc-4414-8fb7-c56b05ace2d7)
  5196. ]
  5197. interface ICDBurnExt : IUnknown
  5198. {
  5199. HRESULT GetSupportedActionTypes([out] CDBE_ACTIONS *pdwActions);
  5200. }
  5201. cpp_quote("#endif // NTDDI_WINXP")
  5202. // New for XP, but used by downlevel code
  5203. //cpp_quote("#if (NTDDI_VERSION >= NTDDI_WINXP)")
  5204. [
  5205. uuid(0811AEBE-0B87-4C54-9E72-548CF649016B),
  5206. object,
  5207. pointer_default(unique)
  5208. ]
  5209. interface IContextMenuSite : IUnknown
  5210. {
  5211. HRESULT DoContextMenuPopup(
  5212. [in] IUnknown* punkContextMenu,
  5213. [in] UINT fFlags,
  5214. [in] POINT pt);
  5215. }
  5216. //cpp_quote("#endif // NTDDI_WINXP")
  5217. // New for XP, but used by downlevel code
  5218. //cpp_quote("#if (NTDDI_VERSION >= NTDDI_WINXP)")
  5219. [
  5220. uuid(61E00D45-8FFF-4e60-924E-6537B61612DD),
  5221. object,
  5222. pointer_default(unique),
  5223. local
  5224. ]
  5225. interface IEnumReadyCallback : IUnknown
  5226. {
  5227. HRESULT EnumReady();
  5228. };
  5229. // interface between CDefView and clients like the NSC which will try to share enumeration with the view
  5230. [
  5231. uuid(8C8BF236-1AEC-495f-9894-91D57C3C686F),
  5232. local
  5233. ]
  5234. interface IEnumerableView : IUnknown
  5235. {
  5236. HRESULT SetEnumReadyCallback([in, annotation("__in")] IEnumReadyCallback *percb);
  5237. HRESULT CreateEnumIDListFromContents(
  5238. [in, annotation("__in")] PCIDLIST_ABSOLUTE pidlFolder,
  5239. [in, annotation("__in")] DWORD dwEnumFlags,
  5240. [out, annotation("__deref_out")] IEnumIDList **ppEnumIDList);
  5241. }
  5242. // QueryService id find the enumerable view. One case where the QS may fail is if the view is holding on to unrealized items (requires possible I/O to get the real item).
  5243. cpp_quote("#define SID_EnumerableView IID_IEnumerableView")
  5244. //cpp_quote("#endif // NTDDI_WINXP")
  5245. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WINXP) || (_WIN32_IE >= _WIN32_IE_IE70)")
  5246. // supports inserting an item into a folder
  5247. [
  5248. uuid(D2B57227-3D23-4b95-93C0-492BD454C356),
  5249. object,
  5250. local
  5251. ]
  5252. interface IInsertItem : IUnknown
  5253. {
  5254. HRESULT InsertItem([in, annotation("__in")] PCUIDLIST_RELATIVE pidl);
  5255. }
  5256. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WINXP)")
  5257. //-------------------------------------------------------------------------
  5258. //
  5259. // IMenuBand interface
  5260. //
  5261. // This interface provides methods the menuband (CLSID_MenuBand)
  5262. // to receive pertinent messages.
  5263. //
  5264. // [Member functions]
  5265. //
  5266. // IMenuBand::IsMenuMessage(pmsg)
  5267. // A message pump calls this function to see if any messages need
  5268. // to be redirected to this object. If this returns S_OK, the
  5269. // message loop should not call TranslateMessage or DispatchMessage.
  5270. // If this returns E_FAIL, the menu has exited menu mode and is ready
  5271. // to be destroyed.
  5272. //
  5273. // IMenuBand::TranslateMenuMessage(pmsg, plRet)
  5274. // Offers the object an opportunity to translate messages. The
  5275. // parent window proc must call this method for every message (not
  5276. // the message pump). The message, wParam, and lParam should be
  5277. // delivered to this method in *pmsg. This method may change the
  5278. // values of pmsg->wParam or pmsg->lParam, in which case these changes
  5279. // should be forwarded on.
  5280. //
  5281. // This method is required because some modal message pumps (like the one
  5282. // in TrackPopupMenu) do not give an opportunity to call a custom
  5283. // TranslateAccelerator method like IInputObject::TranslateAcceleratorIO.
  5284. //
  5285. // TranslateMenuMessage returns S_OK if the message was handled and
  5286. // should be eaten. *plRet is not touched if this returns S_FALSE.
  5287. //
  5288. //
  5289. //-------------------------------------------------------------------------
  5290. [
  5291. uuid(568804CD-CBD7-11d0-9816-00C04FD91972),
  5292. object,
  5293. pointer_default(unique),
  5294. local
  5295. ]
  5296. interface IMenuBand : IUnknown
  5297. {
  5298. // CmdIDs for the IOleCommandTarget Group: CGID_MenuBandHandler (defined in shguidp.h)
  5299. enum tagMENUBANDHANDLERCID {
  5300. MBHANDCID_PIDLSELECT = 0, // A PIDL from a menuband was selected
  5301. };
  5302. HRESULT IsMenuMessage([in, annotation("__in")] MSG* pmsg);
  5303. HRESULT TranslateMenuMessage(
  5304. [in, out, annotation("__inout")] MSG* pmsg,
  5305. [out, annotation("__out")] LRESULT* plRet);
  5306. }
  5307. [
  5308. object,
  5309. uuid(47c01f95-e185-412c-b5c5-4f27df965aea), // IID_IFolderBandPriv
  5310. pointer_default(unique)
  5311. ]
  5312. interface IFolderBandPriv : IUnknown
  5313. {
  5314. HRESULT SetCascade([in] BOOL fCascade);
  5315. HRESULT SetAccelerators([in] BOOL fAccelerators);
  5316. HRESULT SetNoIcons([in] BOOL fNoIcons);
  5317. HRESULT SetNoText([in] BOOL fNoText);
  5318. }
  5319. // callback objects for CRegTreeOptions items
  5320. [
  5321. uuid(A9521922-0812-4d44-9EC3-7FD38C726F3D),
  5322. local
  5323. ]
  5324. interface IRegTreeItem : IUnknown
  5325. {
  5326. HRESULT GetCheckState([out, annotation("__out")] BOOL *pbCheck);
  5327. HRESULT SetCheckState([in, annotation("__in")] BOOL bCheck);
  5328. }
  5329. // image recompression object, given the cx, cy and a quality that we need go through the steps
  5330. // of creating a stream that we can give to somebody containing an image that size. if the
  5331. // image is < that size then return S_FALSE.
  5332. // Image Recompression Object
  5333. [
  5334. uuid(505f1513-6b3e-4892-a272-59f8889a4d3e),
  5335. pointer_default(unique),
  5336. object
  5337. ]
  5338. interface IImageRecompress : IUnknown
  5339. {
  5340. HRESULT RecompressImage(
  5341. [in] IShellItem *psi,
  5342. [in] int cx,
  5343. [in] int cy,
  5344. [in] int iQuality,
  5345. [in] IStorage *pstg,
  5346. [out] IStream **ppstrmOut);
  5347. }
  5348. cpp_quote("#endif // NTDDI_WINXP")
  5349. cpp_quote("#endif // NTDDI_WINXP) || (_WIN32_IE >= _WIN32_IE_IE70)")
  5350. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE60)")
  5351. [
  5352. uuid(EB0FE173-1A3A-11D0-89B3-00A0C90A90AC),
  5353. object,
  5354. pointer_default(unique),
  5355. local
  5356. ]
  5357. interface IDeskBar : IOleWindow
  5358. {
  5359. HRESULT SetClient([in, annotation("__in")] IUnknown* punkClient);
  5360. HRESULT GetClient([out, annotation("__deref_out")] IUnknown** ppunkClient);
  5361. HRESULT OnPosRectChangeDB([in, annotation("__in")] RECT *prc);
  5362. }
  5363. //-------------------------------------------------------------------------
  5364. //
  5365. // IMenuPopup interface
  5366. //
  5367. // This interface provides methods to navigate thru a menu.
  5368. //
  5369. // [Member functions]
  5370. //
  5371. // IMenuPopup::Popup(ppt, prcExclude, dwFlags)
  5372. // Invoke the menu, located at the point *ppt (in screen coordinates).
  5373. // The optional prcExclude points to the rectangle to exclude when
  5374. // positioning the menu, otherwise it should be NULL. dwFlags may be:
  5375. //
  5376. // MDBPU_SETFOCUS: the menu can take the focus.
  5377. //
  5378. // Returns S_OK if the object implements the popup menu as a modeless
  5379. // menu. Otherwise it returns S_FALSE, and the menu is finished.
  5380. //
  5381. // IMenuPopup::OnSelect(dwSelectType)
  5382. // This method handles selection notifications.
  5383. //
  5384. // IMenuPopup::SetSubMenu(pmp, fSet)
  5385. // Sets the given menu bar interface to be the submenu of this
  5386. // object's interface. Set fSet == FALSE to remove the submenu.
  5387. //
  5388. //-------------------------------------------------------------------------
  5389. [
  5390. uuid(D1E7AFEB-6A2E-11d0-8C78-00C04FD918B4),
  5391. object,
  5392. pointer_default(unique),
  5393. local
  5394. ]
  5395. interface IMenuPopup : IDeskBar
  5396. {
  5397. // Type values for IMenuPopup::OnSelect
  5398. enum tagMENUPOPUPSELECT
  5399. {
  5400. MPOS_EXECUTE = 0, // Execute the selected menu item
  5401. MPOS_FULLCANCEL, // Cancel the entire menu
  5402. MPOS_CANCELLEVEL, // Cancel the current cascaded menu
  5403. MPOS_SELECTLEFT, // select one to the left of the cur selection
  5404. MPOS_SELECTRIGHT, // select one to the right of the cur selection
  5405. MPOS_CHILDTRACKING // the child got a tracking select (mouse moved over)
  5406. };
  5407. // Flags for IMenuPopup::Popup
  5408. enum tagMENUPOPUPPOPUPFLAGS
  5409. {
  5410. MPPF_SETFOCUS = 0x00000001, // Menu can take the focus
  5411. MPPF_INITIALSELECT = 0x00000002, // Select the first item
  5412. MPPF_NOANIMATE = 0x00000004, // Do not animate this show
  5413. MPPF_KEYBOARD = 0x00000010, // The menu is activated by keyboard
  5414. MPPF_REPOSITION = 0x00000020, // Resposition the displayed bar.
  5415. MPPF_FORCEZORDER = 0x00000040, // internal: Tells menubar to ignore Submenu positions
  5416. MPPF_FINALSELECT = 0x00000080, // Select the last item
  5417. MPPF_TOP = 0x20000000, // Popup menu up from point
  5418. MPPF_LEFT = 0x40000000, // Popup menu left from point
  5419. MPPF_RIGHT = 0x60000000, // Popup menu right from point
  5420. MPPF_BOTTOM = (int) 0x80000000, // Popup menu below point
  5421. MPPF_POS_MASK = (int) 0xE0000000, // Menu Position Mask
  5422. MPPF_ALIGN_LEFT = 0x02000000, // Default alignment
  5423. MPPF_ALIGN_RIGHT = 0x04000000 // Popup menu aligned to right of exclude rect
  5424. };
  5425. typedef int MP_POPUPFLAGS;
  5426. HRESULT Popup(
  5427. [in, annotation("__in")] POINTL *ppt,
  5428. [in, unique, annotation("__in_opt")] RECTL *prcExclude,
  5429. [in, annotation("__in")] MP_POPUPFLAGS dwFlags);
  5430. HRESULT OnSelect([in, annotation("__in")] DWORD dwSelectType);
  5431. HRESULT SetSubMenu(
  5432. [in, annotation("__in")] IMenuPopup* pmp,
  5433. [in, annotation("__in")] BOOL fSet);
  5434. }
  5435. cpp_quote("#endif // _WIN32_IE_IE60")
  5436. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  5437. // Constants for the type of usage of an open file
  5438. typedef [v1_enum] enum FILE_USAGE_TYPE
  5439. {
  5440. FUT_PLAYING,
  5441. FUT_EDITING,
  5442. FUT_GENERIC
  5443. } FILE_USAGE_TYPE;
  5444. cpp_quote("#define OF_CAP_CANSWITCHTO 0x0001")
  5445. cpp_quote("#define OF_CAP_CANCLOSE 0x0002")
  5446. [
  5447. uuid(64a1cbf0-3a1a-4461-9158-376969693950),
  5448. pointer_default(unique)
  5449. ]
  5450. interface IFileIsInUse : IUnknown
  5451. {
  5452. HRESULT GetAppName([out, string] LPWSTR *ppszName);
  5453. HRESULT GetUsage([out] FILE_USAGE_TYPE *pfut);
  5454. HRESULT GetCapabilities([out] DWORD *pdwCapFlags);
  5455. HRESULT GetSwitchToHWND([out] HWND *phwnd);
  5456. HRESULT CloseFile();
  5457. }
  5458. interface IFileDialog;
  5459. typedef [v1_enum] enum FDE_OVERWRITE_RESPONSE
  5460. {
  5461. FDEOR_DEFAULT = 0, // The application has not handled the event, and the dialog should put up UI asking the user
  5462. // whether or not the file should be overwritten and be returned from the dialog
  5463. FDEOR_ACCEPT = 1, // The application has decided that the file should be returned from the dialog
  5464. FDEOR_REFUSE = 2, // The application has decided that the file should not be returned from the dialog
  5465. } FDE_OVERWRITE_RESPONSE;
  5466. typedef [v1_enum] enum FDE_SHAREVIOLATION_RESPONSE
  5467. {
  5468. FDESVR_DEFAULT = 0, // The application has not handled the event. The dialog will put up UI indicating the file
  5469. // is in use, and a different file must be chosen.
  5470. FDESVR_ACCEPT = 1, // The application has decided that the file should be returned from the dialog
  5471. FDESVR_REFUSE = 2, // The application has decided that the file should not be returned from the dialog
  5472. } FDE_SHAREVIOLATION_RESPONSE;
  5473. typedef [v1_enum] enum FDAP
  5474. {
  5475. FDAP_BOTTOM = 0, // The place is added to the bottom of the default list.
  5476. FDAP_TOP = 1, // The place is added to the top of the default list.
  5477. } FDAP;
  5478. //
  5479. // Implemented by a client of the common file dialog browser,
  5480. // for notification of events within the dialog.
  5481. //
  5482. [
  5483. uuid(973510db-7d7f-452b-8975-74a85828d354),
  5484. object,
  5485. pointer_default(unique)
  5486. ]
  5487. interface IFileDialogEvents : IUnknown
  5488. {
  5489. HRESULT OnFileOk([in] IFileDialog *pfd);
  5490. HRESULT OnFolderChanging(
  5491. [in] IFileDialog *pfd,
  5492. [in] IShellItem *psiFolder);
  5493. HRESULT OnFolderChange([in] IFileDialog *pfd);
  5494. HRESULT OnSelectionChange([in] IFileDialog *pfd);
  5495. // Note: FOS_SHAREAWARE must be set in IFileDialog::SetOptions in order for this method to be called.
  5496. HRESULT OnShareViolation(
  5497. [in] IFileDialog *pfd,
  5498. [in] IShellItem *psi,
  5499. [out] FDE_SHAREVIOLATION_RESPONSE *pResponse);
  5500. HRESULT OnTypeChange([in] IFileDialog *pfd);
  5501. // Note: FOS_OVERWRITEPROMPT must be set in IFileDialog::SetOptions in order for this method to be called.
  5502. HRESULT OnOverwrite(
  5503. [in] IFileDialog *pfd,
  5504. [in] IShellItem *psi,
  5505. [out] FDE_OVERWRITE_RESPONSE *pResponse);
  5506. }
  5507. interface IShellItemFilter;
  5508. //
  5509. // Implemented by the common file dialog browser, used by clients to
  5510. // initialize, show, and get results from the dialog.
  5511. //
  5512. [
  5513. uuid(42f85136-db7e-439c-85f1-e4075d135fc8),
  5514. object,
  5515. pointer_default(unique)
  5516. ]
  5517. interface IFileDialog : IModalWindow
  5518. {
  5519. [v1_enum] enum _FILEOPENDIALOGOPTIONS
  5520. {
  5521. FOS_OVERWRITEPROMPT = 0x00000002, // (on by default in the save dialog)
  5522. FOS_STRICTFILETYPES = 0x00000004, // In the save dialog, only allow the user to choose a file that has
  5523. // one of the file extensions provided in SetFileTypes.
  5524. FOS_NOCHANGEDIR = 0x00000008, // Don't change the current working directory
  5525. FOS_PICKFOLDERS = 0x00000020, // Invoke the open dialog in folder picking mode.
  5526. FOS_FORCEFILESYSTEM = 0x00000040, // Ensure that items returned are filesystem items.
  5527. FOS_ALLNONSTORAGEITEMS = 0x00000080, // Allow choosing items that have no storage.
  5528. FOS_NOVALIDATE = 0x00000100,
  5529. FOS_ALLOWMULTISELECT = 0x00000200,
  5530. FOS_PATHMUSTEXIST = 0x00000800, // (on by default)
  5531. FOS_FILEMUSTEXIST = 0x00001000, // (on by default in the open dialog and folder picker)
  5532. FOS_CREATEPROMPT = 0x00002000,
  5533. FOS_SHAREAWARE = 0x00004000,
  5534. FOS_NOREADONLYRETURN = 0x00008000, // (on by default in the save dialog)
  5535. FOS_NOTESTFILECREATE = 0x00010000, // Avoid testing the creation of the chosen file in the save dialog
  5536. // (specifying this flag will circumvent some useful error handling, such as access denied)
  5537. FOS_HIDEMRUPLACES = 0x00020000, // (not used in Win7)
  5538. FOS_HIDEPINNEDPLACES = 0x00040000, // Don't display the standard namespace locations in the navigation pane.
  5539. // (generally used along with AddPlace)
  5540. FOS_NODEREFERENCELINKS = 0x00100000, // Don't treat shortcuts as their target files.
  5541. FOS_DONTADDTORECENT = 0x02000000, // Don't add the chosen file to the recent documents list (SHAddToRecentDocs)
  5542. FOS_FORCESHOWHIDDEN = 0x10000000, // Show all files including system and hidden files.
  5543. FOS_DEFAULTNOMINIMODE = 0x20000000, // (not used in Win7)
  5544. FOS_FORCEPREVIEWPANEON = 0x40000000
  5545. };
  5546. typedef DWORD FILEOPENDIALOGOPTIONS;
  5547. HRESULT SetFileTypes(
  5548. [in] UINT cFileTypes,
  5549. [in, size_is(cFileTypes)] const COMDLG_FILTERSPEC *rgFilterSpec);
  5550. HRESULT SetFileTypeIndex([in] UINT iFileType);
  5551. HRESULT GetFileTypeIndex([out] UINT *piFileType);
  5552. HRESULT Advise(
  5553. [in] IFileDialogEvents *pfde,
  5554. [out] DWORD *pdwCookie);
  5555. HRESULT Unadvise([in] DWORD dwCookie);
  5556. HRESULT SetOptions([in] FILEOPENDIALOGOPTIONS fos);
  5557. HRESULT GetOptions([out] FILEOPENDIALOGOPTIONS *pfos);
  5558. HRESULT SetDefaultFolder([in] IShellItem *psi);
  5559. HRESULT SetFolder([in] IShellItem *psi);
  5560. HRESULT GetFolder([out] IShellItem **ppsi);
  5561. HRESULT GetCurrentSelection([out] IShellItem **ppsi);
  5562. HRESULT SetFileName([in, string] LPCWSTR pszName);
  5563. HRESULT GetFileName([out, string] LPWSTR *pszName);
  5564. HRESULT SetTitle([in, string] LPCWSTR pszTitle);
  5565. HRESULT SetOkButtonLabel([in, string] LPCWSTR pszText);
  5566. HRESULT SetFileNameLabel([in, string] LPCWSTR pszLabel);
  5567. HRESULT GetResult([out] IShellItem **ppsi);
  5568. HRESULT AddPlace(
  5569. [in] IShellItem *psi,
  5570. [in] FDAP fdap);
  5571. HRESULT SetDefaultExtension([in, string] LPCWSTR pszDefaultExtension);
  5572. HRESULT Close([in] HRESULT hr);
  5573. HRESULT SetClientGuid([in] REFGUID guid);
  5574. HRESULT ClearClientData();
  5575. HRESULT SetFilter([in] IShellItemFilter *pFilter);
  5576. }
  5577. //
  5578. // Additional methods specific to the file save dialog
  5579. //
  5580. [
  5581. uuid(84bccd23-5fde-4cdb-aea4-af64b83d78ab),
  5582. object,
  5583. pointer_default(unique)
  5584. ]
  5585. interface IFileSaveDialog : IFileDialog
  5586. {
  5587. HRESULT SetSaveAsItem([in] IShellItem *psi);
  5588. HRESULT SetProperties([in] IPropertyStore *pStore);
  5589. HRESULT SetCollectedProperties(
  5590. [in] IPropertyDescriptionList *pList,
  5591. [in] BOOL fAppendDefault);
  5592. HRESULT GetProperties([out] IPropertyStore **ppStore);
  5593. HRESULT ApplyProperties(
  5594. [in] IShellItem *psi,
  5595. [in] IPropertyStore *pStore,
  5596. [in, unique] HWND hwnd,
  5597. [in, unique] IFileOperationProgressSink *pSink);
  5598. }
  5599. //
  5600. // Additional methods specific to the file open dialog
  5601. // (adding multiselect capability)
  5602. //
  5603. [
  5604. uuid(d57c7288-d4ad-4768-be02-9d969532d960),
  5605. object,
  5606. pointer_default(unique)
  5607. ]
  5608. interface IFileOpenDialog : IFileDialog
  5609. {
  5610. HRESULT GetResults([out] IShellItemArray **ppenum);
  5611. HRESULT GetSelectedItems([out] IShellItemArray **ppsai);
  5612. }
  5613. typedef [v1_enum] enum CDCONTROLSTATEF
  5614. {
  5615. CDCS_INACTIVE = 0x00000000,
  5616. CDCS_ENABLED = 0x00000001,
  5617. CDCS_VISIBLE = 0x00000002,
  5618. CDCS_ENABLEDVISIBLE = 0x00000003,
  5619. } CDCONTROLSTATEF;
  5620. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(CDCONTROLSTATEF)")
  5621. // Some facts:
  5622. // - Controls are added before the dialog is shown. Their relative layout is implied by the order in which
  5623. // they are added. Controls may be added below or above the standard set of controls.
  5624. // Controls can not be removed or added afterwards, but they may be hidden or disabled at any time.
  5625. // Their labels may be changed at any time.
  5626. // - Some controls are container controls: combobox, toolsmenu, opendropdown, radiogroup. These may have
  5627. // items added to them.
  5628. // - Items with a container control are "immutable", except for their enabled/visible state. They can be
  5629. // added and removed at will. There is no ability to position items within a container - they appear in the
  5630. // order they were added. IDs for items are scoped to their parent control.
  5631. // - Container controls have the notion of a "selected item", with the exception of the toolsmenu.
  5632. // - radiobuttongroups behave exactly like comboboxes. The radio buttons within the group are treated exactly
  5633. // like items in a combobox, one of which can be the "selected item".
  5634. [
  5635. uuid(e6fdd21a-163f-4975-9c8c-a69f1ba37034),
  5636. object,
  5637. pointer_default(unique)
  5638. ]
  5639. interface IFileDialogCustomize : IUnknown
  5640. {
  5641. // Methods for adding or enabling controls. All of these can have their
  5642. // enabled/visible state set, however the default is for them to be enabled and visible,
  5643. // so this parameter has been left off these methods.
  5644. HRESULT EnableOpenDropDown([in] DWORD dwIDCtl);
  5645. HRESULT AddMenu(
  5646. [in] DWORD dwIDCtl,
  5647. [in, string] LPCWSTR pszLabel);
  5648. HRESULT AddPushButton(
  5649. [in] DWORD dwIDCtl,
  5650. [in, string] LPCWSTR pszLabel);
  5651. HRESULT AddComboBox([in] DWORD dwIDCtl);
  5652. HRESULT AddRadioButtonList([in] DWORD dwIDCtl);
  5653. HRESULT AddCheckButton(
  5654. [in] DWORD dwIDCtl,
  5655. [in, string] LPCWSTR pszLabel,
  5656. [in] BOOL bChecked);
  5657. HRESULT AddEditBox(
  5658. [in] DWORD dwIDCtl,
  5659. [in, string] LPCWSTR pszText);
  5660. HRESULT AddSeparator([in] DWORD dwIDCtl);
  5661. HRESULT AddText(
  5662. [in] DWORD dwIDCtl,
  5663. [in, string] LPCWSTR pszText);
  5664. // Getting/setting attributes on controls on the fly
  5665. HRESULT SetControlLabel(
  5666. [in] DWORD dwIDCtl,
  5667. [in, string] LPCWSTR pszLabel);
  5668. HRESULT GetControlState(
  5669. [in] DWORD dwIDCtl,
  5670. [out] CDCONTROLSTATEF *pdwState);
  5671. HRESULT SetControlState(
  5672. [in] DWORD dwIDCtl,
  5673. [in] CDCONTROLSTATEF dwState);
  5674. HRESULT GetEditBoxText(
  5675. [in] DWORD dwIDCtl,
  5676. [out, string] WCHAR **ppszText);
  5677. HRESULT SetEditBoxText(
  5678. [in] DWORD dwIDCtl,
  5679. [in, string] LPCWSTR pszText);
  5680. HRESULT GetCheckButtonState(
  5681. [in] DWORD dwIDCtl,
  5682. [out] BOOL *pbChecked);
  5683. HRESULT SetCheckButtonState(
  5684. [in] DWORD dwIDCtl,
  5685. [in] BOOL bChecked);
  5686. // Method for adding items to "container controls" (radiogroup, combobox, opendropdown, toolsmenu)
  5687. HRESULT AddControlItem(
  5688. [in] DWORD dwIDCtl,
  5689. [in] DWORD dwIDItem,
  5690. [in] LPCWSTR pszLabel);
  5691. // Methods for removing items in the "container controls"
  5692. HRESULT RemoveControlItem(
  5693. [in] DWORD dwIDCtl,
  5694. [in] DWORD dwIDItem);
  5695. HRESULT RemoveAllControlItems([in] DWORD dwIDCtl);
  5696. // Getting/setting attributes on control items on the fly
  5697. // Items are considered immutable once created, except for their state:
  5698. HRESULT GetControlItemState(
  5699. [in] DWORD dwIDCtl,
  5700. [in] DWORD dwIDItem,
  5701. [out] CDCONTROLSTATEF *pdwState);
  5702. HRESULT SetControlItemState(
  5703. [in] DWORD dwIDCtl,
  5704. [in] DWORD dwIDItem,
  5705. [in] CDCONTROLSTATEF dwState);
  5706. // Methods for some "container controls": OpenDropDown, combobox, radiobuttongroup.
  5707. // These methods don't apply to the tools menu.
  5708. // These methods can be called after the dialog has closed, to determine the users final choice.
  5709. // For comboboxes and radiobuttongroups, these methods may also be called while the
  5710. // dialog is showing (which makes no sense for the OpenDropDown).
  5711. HRESULT GetSelectedControlItem(
  5712. [in] DWORD dwIDCtl,
  5713. [out] DWORD *pdwIDItem);
  5714. HRESULT SetSelectedControlItem(
  5715. [in] DWORD dwIDCtl,
  5716. [in] DWORD dwIDItem); // Not valid for OpenDropDown
  5717. // Controls can be grouped by wrapping their adds in StartVisualGroup/EndVisualGroup
  5718. // Groups have control IDs, and can be disabled/hidden, just like other controls.
  5719. HRESULT StartVisualGroup(
  5720. [in] DWORD dwIDCtl,
  5721. [in, string] LPCWSTR pszLabel);
  5722. HRESULT EndVisualGroup();
  5723. // One control may be marked as appearing prominently in the UI
  5724. HRESULT MakeProminent([in] DWORD dwIDCtl);
  5725. // Set the text of a control item (RadioButton, or item in an OpenDropDown or Menu)
  5726. HRESULT SetControlItemText(
  5727. [in] DWORD dwIDCtl,
  5728. [in] DWORD dwIDItem,
  5729. [in, string] LPCWSTR pszLabel);
  5730. }
  5731. // Event notifications from the controls, handled by an interface
  5732. // optionally implemented by the same IFileDialogEvents object supplied by the app.
  5733. [
  5734. uuid(36116642-D713-4b97-9B83-7484A9D00433),
  5735. object,
  5736. pointer_default(unique)
  5737. ]
  5738. interface IFileDialogControlEvents : IUnknown
  5739. {
  5740. // An item in a combobox, toolsmenu, or radiobutton group was selected.
  5741. // (this notification is *not* sent when an item is chosen from the open dropdown,
  5742. // as the action here is always the same: close the dialog as if the user clicked open.
  5743. // At that point, the app will then be able to call GetSelectedItem() for the open dropdown, to
  5744. // obtain the item that was chosen).
  5745. HRESULT OnItemSelected(
  5746. [in] IFileDialogCustomize *pfdc,
  5747. [in] DWORD dwIDCtl,
  5748. [in] DWORD dwIDItem);
  5749. // A pushbutton was clicked.
  5750. HRESULT OnButtonClicked(
  5751. [in] IFileDialogCustomize *pfdc,
  5752. [in] DWORD dwIDCtl);
  5753. // A checkbutton was toggled.
  5754. HRESULT OnCheckButtonToggled(
  5755. [in] IFileDialogCustomize *pfdc,
  5756. [in] DWORD dwIDCtl,
  5757. [in] BOOL bChecked);
  5758. // A combobox, toolsmenu or open dropdown is about to be "dropped down". At this point,
  5759. // the application may want to update the contents based on the current state of the dialog.
  5760. HRESULT OnControlActivating(
  5761. [in] IFileDialogCustomize *pfdc,
  5762. [in] DWORD dwIDCtl);
  5763. }
  5764. [
  5765. uuid(61744fc7-85b5-4791-a9b0-272276309b13),
  5766. object,
  5767. pointer_default(unique)
  5768. ]
  5769. interface IFileDialog2 : IFileDialog
  5770. {
  5771. // Changing the text on the Cancel button can be useful for a "basket mode" where IFileDialogEvents::OnFileOk
  5772. // is used to accumulate items, and Open/Cancel would be changed to Add/Done for example.
  5773. HRESULT SetCancelButtonLabel([in] LPCWSTR pszLabel);
  5774. // Replaces any items in the navigation pane with this item instead, to guide the user from navigating outside of
  5775. // this part of the namespace.
  5776. HRESULT SetNavigationRoot([in] IShellItem *psi);
  5777. }
  5778. typedef [v1_enum] enum ASSOCIATIONLEVEL
  5779. {
  5780. AL_MACHINE,
  5781. AL_EFFECTIVE,
  5782. AL_USER,
  5783. } ASSOCIATIONLEVEL;
  5784. typedef [v1_enum] enum ASSOCIATIONTYPE
  5785. {
  5786. AT_FILEEXTENSION,
  5787. AT_URLPROTOCOL,
  5788. AT_STARTMENUCLIENT,
  5789. AT_MIMETYPE,
  5790. } ASSOCIATIONTYPE;
  5791. // Application File Extension and URL Protocol Registration
  5792. [
  5793. object,
  5794. uuid(4e530b0a-e611-4c77-a3ac-9031d022281b),
  5795. pointer_default(unique)
  5796. ]
  5797. interface IApplicationAssociationRegistration : IUnknown
  5798. {
  5799. HRESULT QueryCurrentDefault(
  5800. [in, string] LPCWSTR pszQuery,
  5801. [in] ASSOCIATIONTYPE atQueryType,
  5802. [in] ASSOCIATIONLEVEL alQueryLevel,
  5803. [out, string] LPWSTR* ppszAssociation);
  5804. HRESULT QueryAppIsDefault(
  5805. [in, string] LPCWSTR pszQuery,
  5806. [in] ASSOCIATIONTYPE atQueryType,
  5807. [in] ASSOCIATIONLEVEL alQueryLevel,
  5808. [in, string] LPCWSTR pszAppRegistryName,
  5809. [out] BOOL* pfDefault);
  5810. HRESULT QueryAppIsDefaultAll(
  5811. [in] ASSOCIATIONLEVEL alQueryLevel,
  5812. [in, string] LPCWSTR pszAppRegistryName,
  5813. [out] BOOL* pfDefault);
  5814. HRESULT SetAppAsDefault(
  5815. [in, string] LPCWSTR pszAppRegistryName,
  5816. [in, string] LPCWSTR pszSet,
  5817. [in] ASSOCIATIONTYPE atSetType);
  5818. HRESULT SetAppAsDefaultAll(
  5819. [in, string] LPCWSTR pszAppRegistryName);
  5820. HRESULT ClearUserAssociations();
  5821. }
  5822. // SHCreateAssociationRegistration can be used to create an IApplicationAssociationRegistration
  5823. cpp_quote("SHSTDAPI SHCreateAssociationRegistration(__in REFIID riid, __deref_out void **ppv);")
  5824. // Application File Extension and URL Protocol Registration UI
  5825. [
  5826. object,
  5827. uuid(1f76a169-f994-40ac-8fc8-0959e8874710),
  5828. pointer_default(unique)
  5829. ]
  5830. interface IApplicationAssociationRegistrationUI : IUnknown
  5831. {
  5832. HRESULT LaunchAdvancedAssociationUI([in, string] LPCWSTR pszAppRegistryName);
  5833. }
  5834. cpp_quote("#endif // NTDDI_VISTA")
  5835. // New for XP, but used by downlevel code
  5836. //cpp_quote("#if (NTDDI_VERSION >= NTDDI_WINXP)")
  5837. //
  5838. // Delegate Item IDs are in a partially known format so the delegate (inner) and
  5839. // delgating (outer) folders share the pidl contents. the inner folder allocates
  5840. // its pidls using the IMalloc provided by the outer folder via SetItemAlloc()
  5841. // that pidl must conform to the delegate item format.
  5842. //
  5843. cpp_quote("#include <pshpack1.h>")
  5844. typedef struct DELEGATEITEMID
  5845. {
  5846. WORD cbSize; // size of entire item ID (points to the NULL or next item)
  5847. WORD wOuter; // Private data owned by the outer folder
  5848. WORD cbInner; // Size of delegate's data
  5849. BYTE rgb[1]; // Inner folder's data (opaque to outer folder)
  5850. // followed by outer folder's data.
  5851. } DELEGATEITEMID;
  5852. cpp_quote("#include <poppack.h>")
  5853. cpp_quote("typedef const UNALIGNED DELEGATEITEMID *PCDELEGATEITEMID;")
  5854. cpp_quote("typedef UNALIGNED DELEGATEITEMID *PDELEGATEITEMID;")
  5855. // shell name space delegate folder interface
  5856. [
  5857. uuid(ADD8BA80-002B-11D0-8F0F-00C04FD7D062),
  5858. object,
  5859. local,
  5860. pointer_default(unique)
  5861. ]
  5862. interface IDelegateFolder : IUnknown
  5863. {
  5864. // use to give the delegate folder the IMalloc interface that it
  5865. // needs to use to alloc and free item IDs.
  5866. // These IDs are in the form of DELEGATEITEMIDs
  5867. // and it is the delegates job to pack its data into the pidl
  5868. // in the delegate format
  5869. HRESULT SetItemAlloc([in, annotation("__in")] IMalloc *pmalloc);
  5870. }
  5871. //cpp_quote("#endif // NTDDI_WINXP")
  5872. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE60)")
  5873. cpp_quote("// INTERFACE: IBrowserFrameOptions")
  5874. cpp_quote("//")
  5875. cpp_quote("// This interface was implemented so a browser or host can ask a ShellView/ShelNameSpace what")
  5876. cpp_quote("// kind of 'Behavior' is appropriate for that view.")
  5877. cpp_quote("//")
  5878. cpp_quote("// IBrowserFrameOptions::GetBrowserOptions()")
  5879. cpp_quote("// dwMask is the logical OR of bits to look for. pdwOptions is not optional and")
  5880. cpp_quote("// it's return value will always equal or will be a subset of dwMask.")
  5881. cpp_quote("// If the function succeeds, the return value must be S_OK and pdwOptions needs to be filled in.")
  5882. cpp_quote("// If the function fails, pdwOptions needs to be filled in with BFO_NONE.")
  5883. cpp_quote("//")
  5884. [
  5885. uuid(10DF43C8-1DBE-11d3-8B34-006097DF5BD4),
  5886. object,
  5887. local
  5888. ]
  5889. interface IBrowserFrameOptions : IUnknown
  5890. {
  5891. typedef [unique] IBrowserFrameOptions * LPBROWSERFRAMEOPTIONS;
  5892. [v1_enum] enum _BROWSERFRAMEOPTIONS
  5893. {
  5894. BFO_NONE = 0x00000000, // Do nothing.
  5895. BFO_BROWSER_PERSIST_SETTINGS = 0x00000001, // Does this item want the browser stream? (Same window position as IE browser windows?)
  5896. BFO_RENAME_FOLDER_OPTIONS_TOINTERNET = 0x00000002, // Rename "Folder Options" to "Internet Options" in the Tools or View menu?
  5897. BFO_BOTH_OPTIONS = 0x00000004, // Keep both "Folder Options" and "Internet Options" in the Tools or View menu?
  5898. BIF_PREFER_INTERNET_SHORTCUT = 0x00000008, // NSE would prefer a .url shortcut over a .lnk shortcut
  5899. BFO_BROWSE_NO_IN_NEW_PROCESS = 0x00000010, // Specify this flag if you don't want the "Browse in New Process" via invoking a shortcut.
  5900. BFO_ENABLE_HYPERLINK_TRACKING = 0x00000020, // Does this NSE want it's display name tracked to determine when hyperlinks should be tagged as previously used?
  5901. BFO_USE_IE_OFFLINE_SUPPORT = 0x00000040, // Use "Internet Explorer"'s offline support?
  5902. BFO_SUBSTITUE_INTERNET_START_PAGE = 0x00000080, // Does this NSE want to use the Start Page support?
  5903. BFO_USE_IE_LOGOBANDING = 0x00000100, // Use the Brand block in the Toolbar. (Spinning globe or whatever it is this year)
  5904. BFO_ADD_IE_TOCAPTIONBAR = 0x00000200, // Should " - Internet Explorer" be appended to display name in the Captionbar
  5905. BFO_USE_DIALUP_REF = 0x00000400, // Should the DialUp ref count get a ref while the browse is navigated to this location? This will also enable the ICW and Software update.
  5906. BFO_USE_IE_TOOLBAR = 0x00000800, // Should the IE toolbar be used?
  5907. BFO_NO_PARENT_FOLDER_SUPPORT = 0x00001000, // Can you NOT navigate to a parent folder? Used for Backspace button to parent folder or the View.GoTo.ParentFolder feature.
  5908. BFO_NO_REOPEN_NEXT_RESTART = 0x00002000, // Browser windows are NOT reopened the next time the shell boots if the windows were left open on the previous logoff. Does this NSE want the same feature?
  5909. BFO_GO_HOME_PAGE = 0x00004000, // Add "Home Page" to menu (Go).
  5910. BFO_PREFER_IEPROCESS = 0x00008000, // prefers to use IEXPLORE.EXE over EXPLORER.EXE
  5911. BFO_SHOW_NAVIGATION_CANCELLED = 0x00010000, // If navigation is aborted, show the "Action Cancelled" HTML page.
  5912. BFO_USE_IE_STATUSBAR = 0x00020000, // Use the persisted IE status bar settings
  5913. BFO_QUERY_ALL = (int) 0xFFFFFFFF, // Return all values set.
  5914. };
  5915. typedef DWORD BROWSERFRAMEOPTIONS;
  5916. HRESULT GetFrameOptions(
  5917. [in, annotation("__in")] BROWSERFRAMEOPTIONS dwMask,
  5918. [out, annotation("__out")] BROWSERFRAMEOPTIONS * pdwOptions);
  5919. }
  5920. cpp_quote("#endif // _WIN32_IE_IE60")
  5921. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE60SP2)")
  5922. typedef [v1_enum] enum NWMF
  5923. {
  5924. NWMF_UNLOADING = 0x00000001, // The query is occuring during onBeforeUnload or onUnload
  5925. NWMF_USERINITED = 0x00000002, // The query is occuring in the context of what trident considers to be a user initiated action
  5926. NWMF_FIRST = 0x00000004, // This is the first query since the begining of the last user initiated action
  5927. NWMF_OVERRIDEKEY = 0x00000008, // The override key was pressed at the time the query was made
  5928. NWMF_SHOWHELP = 0x00000010, // New window is an HTML help window
  5929. NWMF_HTMLDIALOG = 0x00000020, // New window is an HTML dialog
  5930. NWMF_FROMDIALOGCHILD = 0x00000040, // Called from an HTML dialog - do not show UI in parent window
  5931. NWMF_USERREQUESTED = 0x00000080, // There is no doubt the user requested this window (from RClick->Open in New Window, or Shift+Clicked a link)
  5932. NWMF_USERALLOWED = 0x00000100, // This popup is the result of the user requesting a replay that resulted in a refresh
  5933. NWMF_FORCEWINDOW = 0x00010000, // This popup should be forced to open in a new window
  5934. NWMF_FORCETAB = 0x00020000, // This popup should be forced to open in a new tab
  5935. NWMF_SUGGESTWINDOW = 0x00040000, // This popup should open in a new window unless user forced pop-ups to a tab
  5936. NWMF_SUGGESTTAB = 0x00080000, // This popup should open in a new tab unless user forced pop-ups to a window
  5937. NWMF_INACTIVETAB = 0x00100000, // This popup came from an inactive tab
  5938. } NWMF;
  5939. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(NWMF)")
  5940. // Popup manager interface for WebOC hosts and Trident.
  5941. cpp_quote("#define SID_SNewWindowManager IID_INewWindowManager")
  5942. [
  5943. uuid(D2BC4C84-3F72-4a52-A604-7BCBF3982CBB),
  5944. object,
  5945. pointer_default(unique)
  5946. ]
  5947. interface INewWindowManager : IUnknown
  5948. {
  5949. HRESULT EvaluateNewWindow(
  5950. [in, string] LPCWSTR pszUrl,
  5951. [in, string] LPCWSTR pszName,
  5952. [in, string] LPCWSTR pszUrlContext,
  5953. [in, string] LPCWSTR pszFeatures,
  5954. [in] BOOL fReplace,
  5955. [in] DWORD dwFlags,
  5956. [in] DWORD dwUserActionTime);
  5957. }
  5958. //-------------------------------------------------------------------------
  5959. // IAttachmentExecute
  5960. [
  5961. object,
  5962. uuid(73db1241-1e85-4581-8e4f-a81e1d0f8c57), // IID_IAttachmentExecute
  5963. local,
  5964. pointer_default(unique),
  5965. ]
  5966. interface IAttachmentExecute : IUnknown
  5967. {
  5968. typedef [v1_enum] enum ATTACHMENT_PROMPT
  5969. {
  5970. ATTACHMENT_PROMPT_NONE = 0x0000,
  5971. ATTACHMENT_PROMPT_SAVE = 0x0001,
  5972. ATTACHMENT_PROMPT_EXEC = 0x0002,
  5973. ATTACHMENT_PROMPT_EXEC_OR_SAVE = 0x0003,
  5974. } ATTACHMENT_PROMPT;
  5975. typedef [v1_enum] enum ATTACHMENT_ACTION
  5976. {
  5977. ATTACHMENT_ACTION_CANCEL = 0x0000,
  5978. ATTACHMENT_ACTION_SAVE = 0x0001,
  5979. ATTACHMENT_ACTION_EXEC = 0x0002,
  5980. } ATTACHMENT_ACTION;
  5981. //
  5982. // IAttachmentExecute - COM object designed to help client applications
  5983. // safely manage saving and opening attachments for users.
  5984. // clients are assumed to have some policy/settings already
  5985. // to determine the support and behavior for attachments.
  5986. // this API assumes that the client is interactive with the user
  5987. //
  5988. // ClientTitle - (optional) caller specific title for the prompt
  5989. // if unset, the prompts come with a default title of "File Download"
  5990. HRESULT SetClientTitle([in, string, annotation("__in")] LPCWSTR pszTitle);
  5991. // ClientGuid - (optional) for storing user specific settings
  5992. // someprompts are allowed to be avoided in the future if the user
  5993. // chooses. that choice is stored on per-client basis indexed by the ClientGuid
  5994. //
  5995. // Specific Example: In the User Trust Prompt there is a check box that is checked
  5996. // by default, but may be unchecked by the user. this option is stored under the ClientGuid
  5997. // based on the file type.
  5998. //
  5999. // ClearClientState() will reset any user options stored on the clients behalf.
  6000. HRESULT SetClientGuid([in, annotation("__in")] REFGUID guid);
  6001. // EVIDENCE properties
  6002. // LocalPath - (REQUIRED) path that would be passed to ShellExecute()
  6003. // if FileName was already used for the Check() and Prompt() calls,
  6004. // and the LocalPath points to a different handler than predicted,
  6005. // previous trust may be revoked, and the Policy and User trust re-verified.
  6006. HRESULT SetLocalPath([in, string, annotation("__in")] LPCWSTR pszLocalPath);
  6007. // FileName - (optional) proposed name (not path) to be used to construct LocalPath
  6008. // optionally use this if the caller wants to perform Check() before copying
  6009. // the file to the LocalPath. (eg, Check() proposed download)
  6010. HRESULT SetFileName([in, string, annotation("__in")] LPCWSTR pszFileName);
  6011. // Source - (optional) alternate identity path or URL for a file transfer
  6012. // used as the primary Zone determinant. if this is NULL default to the Restricted Zone.
  6013. // may also be used in the Prompt() UI for the "From" field
  6014. // may also be sent to handlers that can process URLs
  6015. HRESULT SetSource([in, string, annotation("__in")] LPCWSTR pszSource);
  6016. // Referrer - (optional) Zone determinant for container or link types
  6017. // only used for Zone/Policy
  6018. // container formats like ZIP and OLE packager use the Referrer to
  6019. // indicate indirect inheritance and avoid Zone elevation.
  6020. // Shortcuts can also use it to limit elevation based on parameters
  6021. HRESULT SetReferrer([in, string, annotation("__in")] LPCWSTR pszReferrer);
  6022. // CheckPolicy() - examines available evidence and checks the resultant policy
  6023. // * requires FileName or LocalPath
  6024. //
  6025. // Returns S_OK for enable
  6026. // S_FALSE for prompt
  6027. // FAILURE for disable
  6028. //
  6029. HRESULT CheckPolicy();
  6030. // Prompt() - application can force UI at an earlier point,
  6031. // even before the file has been copied to disk
  6032. // * requires FileName or LocalPath
  6033. HRESULT Prompt(
  6034. [in, annotation("__in")] HWND hwnd,
  6035. [in, annotation("__in")] ATTACHMENT_PROMPT prompt,
  6036. [out, annotation("__out")] ATTACHMENT_ACTION *paction);
  6037. // Save() - should always be called if LocalPath is in not in a temp dir
  6038. // * requires valid LocalPath
  6039. // * called after the file has been copied to LocalPath
  6040. // * may run virus scanners or other trust services to validate the file.
  6041. // these services may delete or alter the file
  6042. // * may attach evidence to the LocalPath
  6043. HRESULT Save();
  6044. // Execute() - will call Prompt() if necessary, with the EXEC action
  6045. // * requires valid LocalPath
  6046. // * called after the file has been copied to LocalPath
  6047. // * may run virus scanners or other trust services to validate the file.
  6048. // these services may delete or alter the file
  6049. // * may attach evidence to the LocalPath
  6050. //
  6051. // phProcess - if non-NULL Execute() will be synchronous and return an HPROCESS if available
  6052. // if null Execute() will be async, implies that you have a message pump and a long lived window
  6053. //
  6054. HRESULT Execute(
  6055. [in, annotation("__in")] HWND hwnd,
  6056. [in, string, annotation("__in")] LPCWSTR pszVerb,
  6057. [out, annotation("__out_opt")] HANDLE *phProcess);
  6058. // SaveWithUI() - superset of Save() that can show modal error UI, but still does not call Prompt()
  6059. // * requires valid LocalPath
  6060. // * called after the file has been copied to LocalPath
  6061. // * may run virus scanners or other trust services to validate the file.
  6062. // these services may delete or alter the file
  6063. // * may attach evidence to the LocalPath
  6064. HRESULT SaveWithUI([in, annotation("__in")] HWND hwnd);
  6065. // ClearClientState() - removes any state that is stored based on the ClientGuid
  6066. // * requires SetClientGuid() to be called first
  6067. HRESULT ClearClientState();
  6068. }
  6069. cpp_quote("#endif // _WIN32_IE_IE60SP2")
  6070. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE60)")
  6071. cpp_quote("#include <pshpack8.h>")
  6072. typedef struct tagSMDATA
  6073. {
  6074. DWORD dwMask; // SMDM_* values
  6075. DWORD dwFlags; // Not used
  6076. HMENU hmenu; // Static HMENU portion.
  6077. HWND hwnd; // HWND owning the HMENU
  6078. UINT uId; // Id of the item in the menu (-1 for menu itself)
  6079. UINT uIdParent; // Id of the item spawning this menu
  6080. UINT uIdAncestor; // Id of the very top item in the chain of ShellFolders
  6081. IUnknown* punk; // IUnkown of the menuband
  6082. PIDLIST_ABSOLUTE pidlFolder;// pidl of the ShellFolder portion
  6083. PUITEMID_CHILD pidlItem; // pidl of the item in the ShellFolder portion
  6084. IShellFolder* psf; // IShellFolder for the shell folder portion
  6085. void* pvUserData; // User defined Data associated with a pane.
  6086. } SMDATA, *LPSMDATA;
  6087. cpp_quote("// Mask")
  6088. cpp_quote("#define SMDM_SHELLFOLDER 0x00000001 // This is for an item in the band")
  6089. cpp_quote("#define SMDM_HMENU 0x00000002 // This is for the Band itself")
  6090. cpp_quote("#define SMDM_TOOLBAR 0x00000004 // Plain toolbar, not associated with a shell folder or hmenu")
  6091. cpp_quote("// Flags (bitmask)")
  6092. typedef struct tagSMINFO
  6093. {
  6094. DWORD dwMask; // SMIM_*
  6095. DWORD dwType; // SMIT_*
  6096. DWORD dwFlags; // SMIF_*
  6097. int iIcon;
  6098. } SMINFO, * PSMINFO;
  6099. typedef struct SHCSCHANGENOTIFYSTRUCT
  6100. {
  6101. long lEvent; // Change notify Event
  6102. PCIDLIST_ABSOLUTE pidl1; // Pidl 1 Passed in from the Change notify
  6103. PCIDLIST_ABSOLUTE pidl2; // Pidl 2 Passed in from the Change notify
  6104. } SMCSHCHANGENOTIFYSTRUCT, *PSMCSHCHANGENOTIFYSTRUCT;
  6105. cpp_quote("#include <poppack.h>") /* Return to byte packing */
  6106. // Mask flags
  6107. enum tagSMINFOMASK
  6108. {
  6109. SMIM_TYPE = 0x00000001,
  6110. SMIM_FLAGS = 0x00000002,
  6111. SMIM_ICON = 0x00000004
  6112. };
  6113. // Types for mbiinfo.dwType
  6114. enum tagSMINFOTYPE
  6115. {
  6116. SMIT_SEPARATOR = 0x00000001,
  6117. SMIT_STRING = 0x00000002
  6118. };
  6119. // Flags for mbiinfo.dwFlags
  6120. enum tagSMINFOFLAGS
  6121. {
  6122. SMIF_ICON = 0x00000001, // Show an icon
  6123. SMIF_ACCELERATOR = 0x00000002, // Underline the character marked w/ '&'
  6124. SMIF_DROPTARGET = 0x00000004, // Item is a drop target
  6125. SMIF_SUBMENU = 0x00000008, // Item has a submenu
  6126. SMIF_CHECKED = 0x00000020, // Item has a Checkmark
  6127. SMIF_DROPCASCADE = 0x00000040, // Item can cascade out during drag/drop
  6128. SMIF_HIDDEN = 0x00000080, // Don't display item
  6129. SMIF_DISABLED = 0x00000100, // Should be unselectable. Gray.
  6130. SMIF_TRACKPOPUP = 0x00000200, // Should be unselectable. Gray.
  6131. SMIF_DEMOTED = 0x00000400, // Display item in "Demoted" state.
  6132. SMIF_ALTSTATE = 0x00000800, // Displayed in "Altered State"
  6133. SMIF_DRAGNDROP = 0x00001000, // If item that is being dragged hovers over an item for long enough then it SMC_EXECs that item
  6134. SMIF_NEW = 0x00002000, // Item is newly-installed or otherwise attractive (XP)
  6135. };
  6136. cpp_quote("#define SMC_INITMENU 0x00000001 // The callback is called to init a menuband")
  6137. cpp_quote("#define SMC_CREATE 0x00000002")
  6138. cpp_quote("#define SMC_EXITMENU 0x00000003 // The callback is called when menu is collapsing")
  6139. cpp_quote("#define SMC_GETINFO 0x00000005 // The callback is called to return DWORD values")
  6140. cpp_quote("#define SMC_GETSFINFO 0x00000006 // The callback is called to return DWORD values")
  6141. cpp_quote("#define SMC_GETOBJECT 0x00000007 // The callback is called to get some object")
  6142. cpp_quote("#define SMC_GETSFOBJECT 0x00000008 // The callback is called to get some object")
  6143. cpp_quote("#define SMC_SFEXEC 0x00000009 // The callback is called to execute an shell folder item")
  6144. cpp_quote("#define SMC_SFSELECTITEM 0x0000000A // The callback is called when an item is selected")
  6145. cpp_quote("#define SMC_REFRESH 0x00000010 // Menus have completely refreshed. Reset your state.")
  6146. cpp_quote("#define SMC_DEMOTE 0x00000011 // Demote an item")
  6147. cpp_quote("#define SMC_PROMOTE 0x00000012 // Promote an item, wParam = SMINV_* flag")
  6148. cpp_quote("#define SMC_DEFAULTICON 0x00000016 // Returns Default icon location in wParam, index in lParam")
  6149. cpp_quote("#define SMC_NEWITEM 0x00000017 // Notifies item is not in the order stream.")
  6150. cpp_quote("#define SMC_CHEVRONEXPAND 0x00000019 // Notifies of a expansion via the chevron")
  6151. cpp_quote("#define SMC_DISPLAYCHEVRONTIP 0x0000002A // S_OK display, S_FALSE not.")
  6152. cpp_quote("#define SMC_SETSFOBJECT 0x0000002D // Called to save the passed object")
  6153. cpp_quote("#define SMC_SHCHANGENOTIFY 0x0000002E // Called when a Change notify is received. lParam points to SMCSHCHANGENOTIFYSTRUCT")
  6154. cpp_quote("#define SMC_CHEVRONGETTIP 0x0000002F // Called to get the chevron tip text. wParam = Tip title, Lparam = TipText Both MAX_PATH")
  6155. cpp_quote("#define SMC_SFDDRESTRICTED 0x00000030 // Called requesting if it's ok to drop. wParam = IDropTarget.")
  6156. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  6157. cpp_quote("#define SMC_SFEXEC_MIDDLE 0x00000031 // Same as SFEXEC, but the middle mouse button caused the exec.")
  6158. cpp_quote("#define SMC_GETAUTOEXPANDSTATE 0x00000041 // callback returns the default autoexpand state lParam = LPDWORD to recieve flags")
  6159. cpp_quote("#define SMC_AUTOEXPANDCHANGE 0x00000042 // Notify that the menu is expanding/contracting")
  6160. cpp_quote("#define SMC_GETCONTEXTMENUMODIFIER 0x00000043 // Used to add items to a context menu")
  6161. cpp_quote("#define SMC_GETBKCONTEXTMENU 0x00000044 // used to get a context menu to display when user right clicks on the background")
  6162. cpp_quote("#define SMC_OPEN 0x00000045 // allows client to overwrite open/explore verb action on an item")
  6163. cpp_quote("// Flags for return value from SMC_GETAUTOEXPANDSTATE and SMC_AUTOEXPANDCHANGE:")
  6164. cpp_quote("#define SMAE_EXPANDED 0x00000001 // The menu is or should start expanded")
  6165. cpp_quote("#define SMAE_CONTRACTED 0x00000002 // The menu is or should start contracted")
  6166. cpp_quote(" // SMAE_EXPANDED and SMAE_CONTRACTED are mutually exclusive")
  6167. cpp_quote("#define SMAE_USER 0x00000004 // Indicates that the menu expansion/contraction is a reflection")
  6168. cpp_quote(" // of user choice")
  6169. cpp_quote("#define SMAE_VALID 0x00000007")
  6170. cpp_quote("#endif // _WIN32_IE_IE70")
  6171. [
  6172. uuid(4CA300A1-9B8D-11d1-8B22-00C04FD918D0),
  6173. object,
  6174. pointer_default(unique),
  6175. local // cannot marshal because method has polymorphic parameters
  6176. ]
  6177. interface IShellMenuCallback : IUnknown
  6178. {
  6179. // psmd is [in,out] because SMC_MAPACCELERATOR returns a value in uId
  6180. HRESULT CallbackSM(
  6181. [in, out, annotation("__inout")] LPSMDATA psmd,
  6182. [in, annotation("__in")] UINT uMsg,
  6183. [in, annotation("__in")] WPARAM wParam,
  6184. [in, annotation("__in")] LPARAM lParam);
  6185. }
  6186. //-------------------------------------------------------------------------
  6187. //
  6188. // IShellMenu interface
  6189. //
  6190. //-------------------------------------------------------------------------
  6191. cpp_quote("#define SMINIT_DEFAULT 0x00000000 // No Options")
  6192. cpp_quote("#define SMINIT_RESTRICT_DRAGDROP 0x00000002 // Don't allow Drag and Drop")
  6193. cpp_quote("#define SMINIT_TOPLEVEL 0x00000004 // This is the top band.")
  6194. cpp_quote("#define SMINIT_CACHED 0x00000010")
  6195. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  6196. cpp_quote("#define SMINIT_AUTOEXPAND 0x00000100 // automatically expand/contract menu band")
  6197. cpp_quote("#define SMINIT_AUTOTOOLTIP 0x00000200 // regular tooltip support")
  6198. cpp_quote("#define SMINIT_DROPONCONTAINER 0x00000400 // allow drop on a container")
  6199. cpp_quote("#endif // _WIN32_IE_IE70")
  6200. // These are mutually Exclusive
  6201. cpp_quote("#define SMINIT_VERTICAL 0x10000000 // This is a vertical menu")
  6202. cpp_quote("#define SMINIT_HORIZONTAL 0x20000000 // This is a horizontal menu (does not inherit)")
  6203. cpp_quote("#define ANCESTORDEFAULT (UINT)-1")
  6204. cpp_quote("#define SMSET_TOP 0x10000000 // Bias this namespace to the top of the menu")
  6205. cpp_quote("#define SMSET_BOTTOM 0x20000000 // Bias this namespace to the bottom of the menu")
  6206. cpp_quote("#define SMSET_DONTOWN 0x00000001 // The Menuband doesn't own the non-ref counted object")
  6207. // and should not destroy it.
  6208. cpp_quote("#define SMINV_REFRESH 0x00000001")
  6209. cpp_quote("#define SMINV_ID 0x00000008")
  6210. [
  6211. uuid(EE1F7637-E138-11d1-8379-00C04FD918D0),
  6212. object,
  6213. pointer_default(unique), /* some of our pointers can be NULL (as noted) */
  6214. local
  6215. ]
  6216. interface IShellMenu : IUnknown
  6217. {
  6218. HRESULT Initialize(
  6219. [in, unique, annotation("__in_opt")] IShellMenuCallback* psmc,
  6220. [in, annotation("__in")] UINT uId,
  6221. [in, annotation("__in")] UINT uIdAncestor,
  6222. [in, annotation("__in")] DWORD dwFlags);
  6223. HRESULT GetMenuInfo(
  6224. [out, annotation("__deref_opt_out")] IShellMenuCallback** ppsmc,
  6225. [out, annotation("__out_opt")] UINT* puId,
  6226. [out, annotation("__out_opt")] UINT* puIdAncestor,
  6227. [out, annotation("__out_opt")] DWORD* pdwFlags);
  6228. HRESULT SetShellFolder(
  6229. [in, unique, annotation("__in_opt")] IShellFolder* psf,
  6230. [in, unique, annotation("__in_opt")] PCIDLIST_ABSOLUTE pidlFolder,
  6231. [in, unique, annotation("__in_opt")] HKEY hKey,
  6232. [in, annotation("__in")] DWORD dwFlags);
  6233. HRESULT GetShellFolder(
  6234. [out, annotation("__out")] DWORD* pdwFlags,
  6235. [out, annotation("__deref_out")] PIDLIST_ABSOLUTE* ppidl,
  6236. [in] REFIID riid,
  6237. [out, iid_is(riid), annotation("__deref_out")] void** ppv);
  6238. HRESULT SetMenu(
  6239. [in, unique, annotation("__in_opt")] HMENU hmenu,
  6240. [in, unique, annotation("__in_opt")] HWND hwnd,
  6241. [in, annotation("__in")] DWORD dwFlags);
  6242. HRESULT GetMenu(
  6243. [out, annotation("__out_opt")] HMENU* phmenu,
  6244. [out, annotation("__out_opt")] HWND* phwnd,
  6245. [out, annotation("__out_opt")] DWORD* pdwFlags);
  6246. HRESULT InvalidateItem(
  6247. [in, annotation("__in_opt")] LPSMDATA psmd,
  6248. [in, annotation("__in")] DWORD dwFlags);
  6249. HRESULT GetState([out, annotation("__out")] LPSMDATA psmd);
  6250. HRESULT SetMenuToolbar(
  6251. [in, annotation("__in")] IUnknown* punk,
  6252. [in, annotation("__in")] DWORD dwFlags);
  6253. }
  6254. cpp_quote("#endif // _WIN32_IE_IE60")
  6255. [
  6256. uuid(fce4bde0-4b68-4b80-8e9c-7426315a7388),
  6257. object,
  6258. pointer_default(ref),
  6259. local,
  6260. ]
  6261. interface IShellRunDll : IUnknown
  6262. {
  6263. HRESULT Run([in, string, annotation("__in")] LPCWSTR pszArgs);
  6264. }
  6265. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  6266. typedef [v1_enum] enum KF_CATEGORY
  6267. {
  6268. KF_CATEGORY_VIRTUAL = 1, // virtual folders, have not file system path
  6269. KF_CATEGORY_FIXED = 2, // fixed, predefined OS folders, might be different for different users
  6270. KF_CATEGORY_COMMON = 3, // Public folders shared by all users, can be redirected
  6271. KF_CATEGORY_PERUSER = 4, // User folders, can be redirected
  6272. } KF_CATEGORY;
  6273. [v1_enum] enum _KF_DEFINITION_FLAGS
  6274. {
  6275. KFDF_LOCAL_REDIRECT_ONLY = 0x00000002, // Can only be redirected to a local disk
  6276. KFDF_ROAMABLE = 0x00000004, // Can be roamed via PC to PC sync
  6277. KFDF_PRECREATE = 0x00000008, // Pre create folder
  6278. KFDF_STREAM = 0x00000010, // folder is actually a file
  6279. KFDF_PUBLISHEXPANDEDPATH = 0x00000020, // Expanded path is published in the registry under HKCU
  6280. };
  6281. typedef DWORD KF_DEFINITION_FLAGS;
  6282. [v1_enum] enum _KF_REDIRECT_FLAGS
  6283. {
  6284. KF_REDIRECT_USER_EXCLUSIVE = 0x00000001, // Give user exclusive permission
  6285. KF_REDIRECT_COPY_SOURCE_DACL = 0x00000002, // Copy the DACL of the source directory to target
  6286. // Ownership checks for the target folder if the folder exists, by default, the API does not do any ownership checks
  6287. KF_REDIRECT_OWNER_USER = 0x00000004, // The owner of the folder must be the user itself
  6288. KF_REDIRECT_SET_OWNER_EXPLICIT = 0x00000008, // The owner of any newly created folder will be set explicitly
  6289. // by default if user belongs to Administrators group Administrators will be the owner
  6290. // Check if the redirection is already done, S_OK if yes, S_FALSE if some actions need to be done.
  6291. KF_REDIRECT_CHECK_ONLY = 0x00000010,
  6292. // Enable user interaction when redirecting
  6293. KF_REDIRECT_WITH_UI = 0x00000020,
  6294. // CSC related settings
  6295. KF_REDIRECT_UNPIN = 0x00000040, // Unpin the source folder
  6296. KF_REDIRECT_PIN = 0x00000080, // Pin the target folder
  6297. KF_REDIRECT_COPY_CONTENTS = 0x00000200, // Copy the contents (both files and subfolders) under the known folder
  6298. KF_REDIRECT_DEL_SOURCE_CONTENTS = 0x00000400, // Delete source, valid only if KF_REDIRECT_COPY_CONTENTS set
  6299. KF_REDIRECT_EXCLUDE_ALL_KNOWN_SUBFOLDERS
  6300. = 0x00000800, // Exclude all known subfolders from redirection
  6301. };
  6302. typedef DWORD KF_REDIRECT_FLAGS;
  6303. [v1_enum] enum _KF_REDIRECTION_CAPABILITIES
  6304. {
  6305. KF_REDIRECTION_CAPABILITIES_ALLOW_ALL = 0x000000FF, // if any of these flags set this means that
  6306. // the folder can potentially be redirected unless
  6307. // any deny flag is set
  6308. KF_REDIRECTION_CAPABILITIES_REDIRECTABLE = 0x00000001, // the folder can potentially be redirected
  6309. // currently we only allow redirection for
  6310. // common and user's folders.
  6311. // Fixed and virtual can not be redirected
  6312. KF_REDIRECTION_CAPABILITIES_DENY_ALL = 0x000FFF00, // If any of there flags set then redirection is blocked
  6313. KF_REDIRECTION_CAPABILITIES_DENY_POLICY_REDIRECTED = 0x00000100, // Folder can not be redirected because it is redirected by group policy
  6314. KF_REDIRECTION_CAPABILITIES_DENY_POLICY = 0x00000200, // Folder can not be redirected because the policy prohibits redirecting this folder
  6315. KF_REDIRECTION_CAPABILITIES_DENY_PERMISSIONS = 0x00000400, // Folder can not be redirected because the caller does not have sufficient permissions
  6316. };
  6317. typedef DWORD KF_REDIRECTION_CAPABILITIES;
  6318. typedef struct KNOWNFOLDER_DEFINITION
  6319. {
  6320. KF_CATEGORY category;
  6321. LPWSTR pszName;
  6322. LPWSTR pszDescription;
  6323. KNOWNFOLDERID fidParent;
  6324. LPWSTR pszRelativePath;
  6325. LPWSTR pszParsingName;
  6326. LPWSTR pszTooltip;
  6327. LPWSTR pszLocalizedName;
  6328. LPWSTR pszIcon;
  6329. LPWSTR pszSecurity;
  6330. DWORD dwAttributes;
  6331. KF_DEFINITION_FLAGS kfdFlags;
  6332. FOLDERTYPEID ftidType;
  6333. } KNOWNFOLDER_DEFINITION;
  6334. // Known Folder Interface
  6335. [
  6336. uuid(3AA7AF7E-9B36-420c-A8E3-F77D4674A488),
  6337. object,
  6338. version(1.0),
  6339. pointer_default(ref)
  6340. ]
  6341. interface IKnownFolder : IUnknown
  6342. {
  6343. HRESULT GetId([out] KNOWNFOLDERID *pkfid);
  6344. HRESULT GetCategory([out] KF_CATEGORY* pCategory);
  6345. // get the ShellItem (IShellItem or derived interface) for this known folder
  6346. HRESULT GetShellItem(
  6347. [in] DWORD /* KNOWN_FOLDER_FLAG */ dwFlags,
  6348. [in] REFIID riid,
  6349. [out, iid_is(riid)] void **ppv);
  6350. HRESULT GetPath(
  6351. [in] DWORD /* KNOWN_FOLDER_FLAG */ dwFlags,
  6352. [out, string] LPWSTR *ppszPath);
  6353. HRESULT SetPath(
  6354. [in] DWORD /* KNOWN_FOLDER_FLAG */ dwFlags,
  6355. [in, string] LPCWSTR pszPath);
  6356. HRESULT GetIDList(
  6357. [in] DWORD /* KNOWN_FOLDER_FLAG */ dwFlags,
  6358. [out] PIDLIST_ABSOLUTE *ppidl);
  6359. HRESULT GetFolderType([out] FOLDERTYPEID *pftid);
  6360. HRESULT GetRedirectionCapabilities([out] KF_REDIRECTION_CAPABILITIES * pCapabilities);
  6361. HRESULT GetFolderDefinition([out] KNOWNFOLDER_DEFINITION *pKFD);
  6362. }
  6363. // Known Folder Manager
  6364. [
  6365. uuid(8BE2D872-86AA-4d47-B776-32CCA40C7018),
  6366. object,
  6367. version(1.0),
  6368. pointer_default(ref)
  6369. ]
  6370. interface IKnownFolderManager : IUnknown
  6371. {
  6372. typedef [v1_enum] enum FFFP_MODE
  6373. {
  6374. FFFP_EXACTMATCH,
  6375. FFFP_NEARESTPARENTMATCH,
  6376. } FFFP_MODE;
  6377. HRESULT FolderIdFromCsidl(
  6378. [in] int nCsidl,
  6379. [out] KNOWNFOLDERID *pfid);
  6380. HRESULT FolderIdToCsidl(
  6381. [in] REFKNOWNFOLDERID rfid,
  6382. [out] int *pnCsidl);
  6383. HRESULT GetFolderIds(
  6384. [out, size_is( , *pCount)] KNOWNFOLDERID ** ppKFId,
  6385. [in, out] UINT *pCount);
  6386. HRESULT GetFolder(
  6387. [in] REFKNOWNFOLDERID rfid,
  6388. [out] IKnownFolder **ppkf);
  6389. HRESULT GetFolderByName(
  6390. [in, string] LPCWSTR pszCanonicalName,
  6391. [out] IKnownFolder **ppkf);
  6392. HRESULT RegisterFolder(
  6393. [in] REFKNOWNFOLDERID rfid,
  6394. [in] KNOWNFOLDER_DEFINITION const *pKFD);
  6395. HRESULT UnregisterFolder([in] REFKNOWNFOLDERID rfid);
  6396. HRESULT FindFolderFromPath(
  6397. [in, string] LPCWSTR pszPath,
  6398. [in] FFFP_MODE mode,
  6399. [out] IKnownFolder **ppkf);
  6400. HRESULT FindFolderFromIDList(
  6401. [in] PCIDLIST_ABSOLUTE pidl,
  6402. [out] IKnownFolder **ppkf);
  6403. [local]
  6404. HRESULT Redirect(
  6405. [in, annotation("__in")] REFKNOWNFOLDERID rfid,
  6406. [in, unique, annotation("__in_opt")] HWND hwnd,
  6407. [in, annotation("__in")] KF_REDIRECT_FLAGS flags,
  6408. [in, unique, string, annotation("__in_opt")] LPCWSTR pszTargetPath,
  6409. [in, annotation("__in")] UINT cFolders,
  6410. [in, size_is(cFolders), unique, annotation("__in_ecount_opt(cFolders)")] KNOWNFOLDERID const *pExclusion,
  6411. [out, string, annotation("__deref_opt_out_opt")] LPWSTR* ppszError);
  6412. [call_as(Redirect)]
  6413. HRESULT RemoteRedirect(
  6414. [in] REFKNOWNFOLDERID rfid,
  6415. [in, unique] HWND hwnd,
  6416. [in] KF_REDIRECT_FLAGS flags,
  6417. [in, unique, string] LPCWSTR pszTargetPath,
  6418. [in] UINT cFolders,
  6419. [in, size_is(cFolders), unique] GUID const *pExclusion,
  6420. [out, string] LPWSTR* ppszError);
  6421. }
  6422. // use this to free the allocated fields in the result from IKnownFolderManager::GetFolderDefinition(&kfd)
  6423. cpp_quote("__inline void FreeKnownFolderDefinitionFields(__in KNOWNFOLDER_DEFINITION *pKFD)")
  6424. cpp_quote("{")
  6425. cpp_quote(" CoTaskMemFree(pKFD->pszName);")
  6426. cpp_quote(" CoTaskMemFree(pKFD->pszDescription);")
  6427. cpp_quote(" CoTaskMemFree(pKFD->pszRelativePath);")
  6428. cpp_quote(" CoTaskMemFree(pKFD->pszParsingName);")
  6429. cpp_quote(" CoTaskMemFree(pKFD->pszTooltip);")
  6430. cpp_quote(" CoTaskMemFree(pKFD->pszLocalizedName);")
  6431. cpp_quote(" CoTaskMemFree(pKFD->pszIcon);")
  6432. cpp_quote(" CoTaskMemFree(pKFD->pszSecurity);")
  6433. cpp_quote("}")
  6434. typedef [v1_enum] enum SHARE_ROLE
  6435. {
  6436. SHARE_ROLE_INVALID = -1,
  6437. SHARE_ROLE_READER = 0,
  6438. SHARE_ROLE_CONTRIBUTOR = 1,
  6439. SHARE_ROLE_CO_OWNER = 2,
  6440. SHARE_ROLE_OWNER = 3,
  6441. SHARE_ROLE_CUSTOM = 4,
  6442. SHARE_ROLE_MIXED = 5,
  6443. }
  6444. SHARE_ROLE;
  6445. typedef [v1_enum] enum DEF_SHARE_ID
  6446. {
  6447. DEFSHAREID_USERS = 1,
  6448. DEFSHAREID_PUBLIC = 2,
  6449. }
  6450. DEF_SHARE_ID;
  6451. // Sharing Configuration Manager
  6452. [
  6453. object,
  6454. uuid(B4CD448A-9C86-4466-9201-2E62105B87AE)
  6455. ]
  6456. interface ISharingConfigurationManager : IUnknown
  6457. {
  6458. HRESULT CreateShare(
  6459. [in] DEF_SHARE_ID dsid,
  6460. [in] SHARE_ROLE role);
  6461. HRESULT DeleteShare([in] DEF_SHARE_ID dsid);
  6462. // returns S_OK if the share exists, S_FALSE otherwise
  6463. HRESULT ShareExists([in] DEF_SHARE_ID dsid);
  6464. HRESULT GetSharePermissions(
  6465. [in] DEF_SHARE_ID dsid,
  6466. [out] SHARE_ROLE* pRole);
  6467. HRESULT SharePrinters();
  6468. HRESULT StopSharingPrinters();
  6469. HRESULT ArePrintersShared();
  6470. }
  6471. cpp_quote("#endif // NTDDI_VISTA")
  6472. [
  6473. object,
  6474. uuid(76e54780-ad74-48e3-a695-3ba9a0aff10d),
  6475. pointer_default(unique),
  6476. local
  6477. ]
  6478. interface IPreviousVersionsInfo : IUnknown
  6479. {
  6480. HRESULT AreSnapshotsAvailable(
  6481. [in, string, annotation("__in")] LPCWSTR pszPath,
  6482. [in, annotation("__in")] BOOL fOkToBeSlow,
  6483. [out, annotation("__out")] BOOL *pfAvailable);
  6484. }
  6485. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  6486. // Base interface from which to derive "related items"
  6487. // with specific relationships, and identical method signatures.
  6488. //
  6489. // Use with
  6490. // IShellItem::BindToHandler, BHID_SFObject
  6491. // IShellFolder::BindToObject
  6492. [
  6493. object,
  6494. uuid(a73ce67a-8ab1-44f1-8d43-d2fcbf6b1cd0),
  6495. pointer_default(unique)
  6496. ]
  6497. interface IRelatedItem : IUnknown
  6498. {
  6499. HRESULT GetItemIDList([out] PIDLIST_ABSOLUTE *ppidl);
  6500. HRESULT GetItem([out] IShellItem **ppsi);
  6501. }
  6502. // Used to obtain the true identity of the item, so it can be
  6503. // determined if two items actually represent the same item.
  6504. [
  6505. object,
  6506. uuid(7d903fca-d6f9-4810-8332-946c0177e247),
  6507. pointer_default(unique)
  6508. ]
  6509. interface IIdentityName : IRelatedItem
  6510. {
  6511. }
  6512. // Used to obtain the delegate item of an item, where the
  6513. // item is delegating to the underlying "delegate" item.
  6514. // Unlike IIdentityName, IDelegateItem only "unwraps" one
  6515. // level of aliasing.
  6516. [
  6517. object,
  6518. uuid(3c5a1c94-c951-4cb7-bb6d-3b93f30cce93),
  6519. pointer_default(unique)
  6520. ]
  6521. interface IDelegateItem : IRelatedItem
  6522. {
  6523. }
  6524. // If an item represents a snapshot of an item taken at a previous time,
  6525. // ICurrentItem will let you obtain the current version of the item.
  6526. [
  6527. object,
  6528. uuid(240a7174-d653-4a1d-a6d3-d4943cfbfe3d),
  6529. pointer_default(unique)
  6530. ]
  6531. interface ICurrentItem : IRelatedItem
  6532. {
  6533. }
  6534. // used to find the transfer object. that is the object that should be
  6535. // queried and enumerated for copy/move/delete.
  6536. [
  6537. object,
  6538. uuid(77f295d5-2d6f-4e19-b8ae-322f3e721ab5),
  6539. pointer_default(unique)
  6540. ]
  6541. interface ITransferMediumItem : IRelatedItem
  6542. {
  6543. }
  6544. // used to find the item that should be used when browsing to this item (used by pagespace control)
  6545. [
  6546. object,
  6547. uuid(05edda5c-98a3-4717-8adb-c5e7da991eb1),
  6548. pointer_default(unique)
  6549. ]
  6550. interface IUseToBrowseItem : IRelatedItem
  6551. {
  6552. }
  6553. // IDisplayItem provides the item to show UI on (used by the copy engine dialogs)
  6554. [
  6555. object,
  6556. uuid(c6fd5997-9f6b-4888-8703-94e80e8cde3f),
  6557. pointer_default(unique)
  6558. ]
  6559. interface IDisplayItem : IRelatedItem
  6560. {
  6561. }
  6562. // IViewStateIdentityItem is used to provide a canonical persistence item
  6563. // This is item for which view customizations will be remembered
  6564. // (example: the orignal folder item minus the search query)
  6565. [
  6566. object,
  6567. uuid(9D264146-A94F-4195-9F9F-3BB12CE0C955),
  6568. pointer_default(unique)
  6569. ]
  6570. interface IViewStateIdentityItem : IRelatedItem
  6571. {
  6572. }
  6573. // IPreviewItem provides an item to show in the preview pane
  6574. [
  6575. object,
  6576. uuid(36149969-0A8F-49c8-8B00-4AECB20222FB),
  6577. pointer_default(unique)
  6578. ]
  6579. interface IPreviewItem : IRelatedItem
  6580. {
  6581. }
  6582. // and many more to come "related items"...
  6583. //
  6584. // "public partner" - like to SharedPics from MyPics
  6585. // "private partner" - link to MyPics from SharedPics
  6586. // "recyle bin root" - where (and if) recycle bin is supported
  6587. // "machine root" - for "open containing machine"
  6588. cpp_quote("#endif // NTDDI_VISTA")
  6589. // New for Vista, but used by downlevel code
  6590. //cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  6591. [
  6592. uuid(8a87781b-39a7-4a1f-aab3-a39b9c34a7d9),
  6593. object,
  6594. pointer_default(unique)
  6595. ]
  6596. interface IDestinationStreamFactory : IUnknown
  6597. {
  6598. HRESULT GetDestinationStream([out] IStream **ppstm);
  6599. }
  6600. //cpp_quote("#endif // NTDDI_VISTA")
  6601. [v1_enum] enum _NMCII_FLAGS
  6602. {
  6603. NMCII_ITEMS = 0x0001,
  6604. NMCII_FOLDERS = 0x0002,
  6605. };
  6606. typedef int NMCII_FLAGS;
  6607. [v1_enum] enum _NMCSAEI_FLAGS
  6608. {
  6609. NMCSAEI_SELECT = 0x0000,
  6610. NMCSAEI_EDIT = 0x0001,
  6611. };
  6612. typedef int NMCSAEI_FLAGS;
  6613. [
  6614. uuid(dcb07fdc-3bb5-451c-90be-966644fed7b0),
  6615. pointer_default(unique)
  6616. ]
  6617. interface INewMenuClient : IUnknown
  6618. {
  6619. HRESULT IncludeItems([out] NMCII_FLAGS *pflags);
  6620. HRESULT SelectAndEditItem(
  6621. [in] PCIDLIST_ABSOLUTE pidlItem,
  6622. [in] NMCSAEI_FLAGS flags);
  6623. };
  6624. cpp_quote("#define SID_SNewMenuClient IID_INewMenuClient")
  6625. // SID_SCommandBarState: {B99EAA5C-3850-4400-BC33-2CE534048BF8}
  6626. cpp_quote("DEFINE_GUID(SID_SCommandBarState, 0xB99EAA5C, 0x3850, 0x4400, 0xBC, 0x33, 0x2C, 0xE5, 0x34, 0x04, 0x8B, 0xF8);")
  6627. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  6628. [
  6629. object,
  6630. uuid(71c0d2bc-726d-45cc-a6c0-2e31c1db2159),
  6631. pointer_default(unique)
  6632. ]
  6633. interface IInitializeWithBindCtx : IUnknown
  6634. {
  6635. HRESULT Initialize([in] IBindCtx *pbc);
  6636. }
  6637. [
  6638. object,
  6639. uuid(2659B475-EEB8-48b7-8F07-B378810F48CF),
  6640. pointer_default(unique)
  6641. ]
  6642. interface IShellItemFilter : IUnknown
  6643. {
  6644. HRESULT IncludeItem([in] IShellItem *psi);
  6645. HRESULT GetEnumFlagsForItem(
  6646. [in] IShellItem *psi,
  6647. [out] SHCONTF *pgrfFlags);
  6648. }
  6649. cpp_quote("#endif // (_WIN32_IE >= _WIN32_IE_IE70)")
  6650. // New for Vista, but used by downlevel code
  6651. //cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  6652. [
  6653. object,
  6654. uuid(028212A3-B627-47e9-8856-C14265554E4F)
  6655. ]
  6656. interface INameSpaceTreeControl : IUnknown
  6657. {
  6658. [v1_enum] enum _NSTCSTYLE
  6659. {
  6660. NSTCS_HASEXPANDOS = 0x00000001,
  6661. NSTCS_HASLINES = 0x00000002,
  6662. NSTCS_SINGLECLICKEXPAND = 0x00000004,
  6663. NSTCS_FULLROWSELECT = 0x00000008,
  6664. NSTCS_SPRINGEXPAND = 0x00000010,
  6665. NSTCS_HORIZONTALSCROLL = 0x00000020,
  6666. NSTCS_ROOTHASEXPANDO = 0x00000040,
  6667. NSTCS_SHOWSELECTIONALWAYS = 0x00000080,
  6668. NSTCS_NOINFOTIP = 0x00000200,
  6669. NSTCS_EVENHEIGHT = 0x00000400,
  6670. NSTCS_NOREPLACEOPEN = 0x00000800,
  6671. NSTCS_DISABLEDRAGDROP = 0x00001000,
  6672. NSTCS_NOORDERSTREAM = 0x00002000,
  6673. NSTCS_RICHTOOLTIP = 0x00004000,
  6674. NSTCS_BORDER = 0x00008000,
  6675. NSTCS_NOEDITLABELS = 0x00010000,
  6676. NSTCS_TABSTOP = 0x00020000,
  6677. NSTCS_FAVORITESMODE = 0x00080000, // temporary
  6678. NSTCS_AUTOHSCROLL = 0x00100000,
  6679. NSTCS_FADEINOUTEXPANDOS = 0x00200000,
  6680. NSTCS_EMPTYTEXT = 0x00400000, // insert empty text when folder is empty
  6681. NSTCS_CHECKBOXES = 0x00800000,
  6682. NSTCS_PARTIALCHECKBOXES = 0x01000000,
  6683. NSTCS_EXCLUSIONCHECKBOXES = 0x02000000,
  6684. NSTCS_DIMMEDCHECKBOXES = 0x04000000,
  6685. NSTCS_NOINDENTCHECKS = 0x08000000,
  6686. NSTCS_ALLOWJUNCTIONS = 0x10000000,
  6687. NSTCS_SHOWTABSBUTTON = 0x20000000,
  6688. NSTCS_SHOWDELETEBUTTON = 0x40000000,
  6689. NSTCS_SHOWREFRESHBUTTON = (int) 0x80000000,
  6690. };
  6691. typedef DWORD NSTCSTYLE;
  6692. [v1_enum] enum _NSTCROOTSTYLE
  6693. {
  6694. NSTCRS_VISIBLE = 0x0000,
  6695. NSTCRS_HIDDEN = 0x0001,
  6696. NSTCRS_EXPANDED = 0x0002,
  6697. };
  6698. typedef DWORD NSTCROOTSTYLE;
  6699. [v1_enum] enum _NSTCITEMSTATE
  6700. {
  6701. NSTCIS_NONE = 0x0000,
  6702. NSTCIS_SELECTED = 0x0001,
  6703. NSTCIS_EXPANDED = 0x0002,
  6704. NSTCIS_BOLD = 0x0004,
  6705. NSTCIS_DISABLED = 0x0008,
  6706. NSTCIS_SELECTEDNOEXPAND = 0x0010,
  6707. };
  6708. typedef DWORD NSTCITEMSTATE;
  6709. typedef [v1_enum] enum NSTCGNI
  6710. {
  6711. NSTCGNI_NEXT = 0,
  6712. NSTCGNI_NEXTVISIBLE = 1,
  6713. NSTCGNI_PREV = 2,
  6714. NSTCGNI_PREVVISIBLE = 3,
  6715. NSTCGNI_PARENT = 4,
  6716. NSTCGNI_CHILD = 5,
  6717. NSTCGNI_FIRSTVISIBLE = 6,
  6718. NSTCGNI_LASTVISIBLE = 7,
  6719. } NSTCGNI;
  6720. HRESULT Initialize(
  6721. [in] HWND hwndParent,
  6722. [in, unique] RECT *prc,
  6723. [in] NSTCSTYLE nsctsFlags);
  6724. HRESULT TreeAdvise(
  6725. [in] IUnknown *punk,
  6726. [out] DWORD *pdwCookie);
  6727. HRESULT TreeUnadvise([in] DWORD dwCookie);
  6728. HRESULT AppendRoot(
  6729. [in] IShellItem *psiRoot,
  6730. [in] SHCONTF grfEnumFlags,
  6731. [in] NSTCROOTSTYLE grfRootStyle,
  6732. [in, unique] IShellItemFilter *pif);
  6733. HRESULT InsertRoot(
  6734. [in] int iIndex,
  6735. [in] IShellItem *psiRoot,
  6736. [in] SHCONTF grfEnumFlags,
  6737. [in] NSTCROOTSTYLE grfRootStyle,
  6738. [in, unique] IShellItemFilter *pif);
  6739. HRESULT RemoveRoot([in] IShellItem *psiRoot);
  6740. HRESULT RemoveAllRoots();
  6741. HRESULT GetRootItems([out] IShellItemArray **ppsiaRootItems);
  6742. HRESULT SetItemState(
  6743. [in] IShellItem *psi,
  6744. [in] NSTCITEMSTATE nstcisMask,
  6745. [in] NSTCITEMSTATE nstcisFlags);
  6746. HRESULT GetItemState(
  6747. [in] IShellItem *psi,
  6748. [in] NSTCITEMSTATE nstcisMask,
  6749. [out] NSTCITEMSTATE *pnstcisFlags);
  6750. HRESULT GetSelectedItems([out] IShellItemArray **psiaItems);
  6751. HRESULT GetItemCustomState(
  6752. [in] IShellItem *psi,
  6753. [out] int *piStateNumber);
  6754. HRESULT SetItemCustomState(
  6755. [in] IShellItem *psi,
  6756. [in] int iStateNumber);
  6757. HRESULT EnsureItemVisible([in] IShellItem *psi);
  6758. HRESULT SetTheme([in, string] LPCWSTR pszTheme);
  6759. HRESULT GetNextItem(
  6760. [in, unique] IShellItem *psi,
  6761. [in] NSTCGNI nstcgi,
  6762. [out] IShellItem **ppsiNext);
  6763. HRESULT HitTest(
  6764. [in] POINT *ppt,
  6765. [out] IShellItem **ppsiOut);
  6766. HRESULT GetItemRect(
  6767. [in] IShellItem *psi,
  6768. [out] RECT *prect);
  6769. HRESULT CollapseAll();
  6770. }
  6771. [
  6772. object,
  6773. uuid(7cc7aed8-290e-49bc-8945-c1401cc9306c),
  6774. ]
  6775. interface INameSpaceTreeControl2 : INameSpaceTreeControl
  6776. {
  6777. typedef [v1_enum] enum NSTCSTYLE2
  6778. {
  6779. NSTCS2_DEFAULT = 0x00000000,
  6780. NSTCS2_INTERRUPTNOTIFICATIONS = 0x00000001,
  6781. NSTCS2_SHOWNULLSPACEMENU = 0x00000002,
  6782. NSTCS2_DISPLAYPADDING = 0x00000004,
  6783. NSTCS2_DISPLAYPINNEDONLY = 0x00000008, // Filters items based on PKEY_IsPinnedToNameSpaceTree
  6784. NTSCS2_NOSINGLETONAUTOEXPAND = 0x00000010, // Prevent auto expansion of singleton nodes in tree
  6785. NTSCS2_NEVERINSERTNONENUMERATED = 0x00000020, // Don't insert non-enumerated (SFGAO_NONENUMERATED) items
  6786. } NSTCSTYLE2;
  6787. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(NSTCSTYLE2)")
  6788. HRESULT SetControlStyle(
  6789. [in] NSTCSTYLE nstcsMask,
  6790. [in] NSTCSTYLE nstcsStyle);
  6791. HRESULT GetControlStyle(
  6792. [in] NSTCSTYLE nstcsMask,
  6793. [out] NSTCSTYLE *pnstcsStyle);
  6794. HRESULT SetControlStyle2(
  6795. [in] NSTCSTYLE2 nstcsMask,
  6796. [in] NSTCSTYLE2 nstcsStyle);
  6797. HRESULT GetControlStyle2(
  6798. [in] NSTCSTYLE2 nstcsMask,
  6799. [out] NSTCSTYLE2 *pnstcsStyle);
  6800. }
  6801. cpp_quote("#define NSTCS2_ALLMASK (NSTCS2_INTERRUPTNOTIFICATIONS | NSTCS2_SHOWNULLSPACEMENU | NSTCS2_DISPLAYPADDING)")
  6802. cpp_quote("#define SID_SNavigationPane IID_INameSpaceTreeControl // nearest service that you can proffer to")
  6803. cpp_quote("#define ISLBUTTON(x) (NSTCECT_LBUTTON == ((x) & NSTCECT_BUTTON))")
  6804. cpp_quote("#define ISMBUTTON(x) (NSTCECT_MBUTTON == ((x) & NSTCECT_BUTTON))")
  6805. cpp_quote("#define ISRBUTTON(x) (NSTCECT_RBUTTON == ((x) & NSTCECT_BUTTON))")
  6806. cpp_quote("#define ISDBLCLICK(x) (NSTCECT_DBLCLICK == ((x) & NSTCECT_DBLCLICK))")
  6807. [
  6808. object,
  6809. uuid(93D77985-B3D8-4484-8318-672CDDA002CE),
  6810. local
  6811. ]
  6812. interface INameSpaceTreeControlEvents : IUnknown
  6813. {
  6814. [v1_enum] enum _NSTCEHITTEST
  6815. {
  6816. // items up to 0x00ff reflect the TVHITTESTINFO flags
  6817. NSTCEHT_NOWHERE = 0x0001,
  6818. NSTCEHT_ONITEMICON = 0x0002,
  6819. NSTCEHT_ONITEMLABEL = 0x0004,
  6820. NSTCEHT_ONITEMINDENT = 0x0008,
  6821. NSTCEHT_ONITEMBUTTON = 0x0010,
  6822. NSTCEHT_ONITEMRIGHT = 0x0020,
  6823. NSTCEHT_ONITEMSTATEICON = 0x0040,
  6824. NSTCEHT_ONITEM = 0x0046,
  6825. // items below don't reflect the TVHITTESTINFO flags
  6826. NSTCEHT_ONITEMTABBUTTON = 0x1000,
  6827. };
  6828. typedef DWORD NSTCEHITTEST;
  6829. [v1_enum] enum _NSTCECLICKTYPE
  6830. {
  6831. NSTCECT_LBUTTON = 0x0001,
  6832. NSTCECT_MBUTTON = 0x0002,
  6833. NSTCECT_RBUTTON = 0x0003,
  6834. NSTCECT_BUTTON = 0x0003,
  6835. NSTCECT_DBLCLICK = 0x0004,
  6836. };
  6837. typedef DWORD NSTCECLICKTYPE;
  6838. HRESULT OnItemClick(
  6839. [in, annotation("__in")] IShellItem *psi,
  6840. [in, annotation("__in")] NSTCEHITTEST nstceHitTest,
  6841. [in, annotation("__in")] NSTCECLICKTYPE nstceClickType);
  6842. HRESULT OnPropertyItemCommit([in, annotation("__in")] IShellItem *psi);
  6843. HRESULT OnItemStateChanging(
  6844. [in, annotation("__in")] IShellItem *psi,
  6845. [in, annotation("__in")] NSTCITEMSTATE nstcisMask,
  6846. [in, annotation("__in")] NSTCITEMSTATE nstcisState);
  6847. HRESULT OnItemStateChanged(
  6848. [in, annotation("__in")] IShellItem *psi,
  6849. [in, annotation("__in")] NSTCITEMSTATE nstcisMask,
  6850. [in, annotation("__in")] NSTCITEMSTATE nstcisState);
  6851. HRESULT OnSelectionChanged([in, annotation("__in")] IShellItemArray *psiaSelection);
  6852. HRESULT OnKeyboardInput(
  6853. [in, annotation("__in")] UINT uMsg,
  6854. [in, annotation("__in")] WPARAM wParam,
  6855. [in, annotation("__in")] LPARAM lParam);
  6856. HRESULT OnBeforeExpand([in, annotation("__in")] IShellItem *psi);
  6857. HRESULT OnAfterExpand([in, annotation("__in")] IShellItem *psi);
  6858. HRESULT OnBeginLabelEdit([in, annotation("__in")] IShellItem *psi);
  6859. HRESULT OnEndLabelEdit([in, annotation("__in")] IShellItem *psi);
  6860. HRESULT OnGetToolTip(
  6861. [in, annotation("__in")] IShellItem *psi,
  6862. [out, string, size_is(cchTip), annotation("__out_ecount(cchTip)")] LPWSTR pszTip,
  6863. [in, annotation("__in")] int cchTip);
  6864. HRESULT OnBeforeItemDelete([in, annotation("__in")] IShellItem *psi);
  6865. HRESULT OnItemAdded(
  6866. [in, annotation("__in")] IShellItem *psi,
  6867. [in, annotation("__in")] BOOL fIsRoot);
  6868. HRESULT OnItemDeleted(
  6869. [in, annotation("__in")] IShellItem *psi,
  6870. [in, annotation("__in")] BOOL fIsRoot);
  6871. HRESULT OnBeforeContextMenu(
  6872. [in, unique, annotation("__in_opt")] IShellItem *psi,
  6873. [in, annotation("__in")] REFIID riid,
  6874. [out, iid_is(riid), annotation("__deref_out")] void **ppv);
  6875. // psi can only be NULL if NSTCS2_SHOWNULLSPACEMENU is set
  6876. HRESULT OnAfterContextMenu(
  6877. [in, annotation("__in_opt")] IShellItem *psi,
  6878. [in, annotation("__in")] IContextMenu *pcmIn,
  6879. [in, annotation("__in")] REFIID riid,
  6880. [out, iid_is(riid), annotation("__deref_out")] void **ppv);
  6881. HRESULT OnBeforeStateImageChange([in, annotation("__in")] IShellItem *psi);
  6882. HRESULT OnGetDefaultIconIndex(
  6883. [in, annotation("__in")] IShellItem *psi,
  6884. [out, annotation("__out")] int *piDefaultIcon,
  6885. [out, annotation("__out")] int *piOpenIcon);
  6886. }
  6887. cpp_quote("#define NSTCDHPOS_ONTOP -1")
  6888. [
  6889. object,
  6890. uuid(F9C665D6-C2F2-4c19-BF33-8322D7352F51),
  6891. local
  6892. ]
  6893. interface INameSpaceTreeControlDropHandler : IUnknown
  6894. {
  6895. HRESULT OnDragEnter(
  6896. [in, unique, annotation("__in_opt")] IShellItem *psiOver,
  6897. [in, annotation("__in")] IShellItemArray *psiaData,
  6898. [in, annotation("__in")] BOOL fOutsideSource,
  6899. [in, annotation("__in")] DWORD grfKeyState,
  6900. [in, out, annotation("__inout")] DWORD *pdwEffect);
  6901. HRESULT OnDragOver(
  6902. [in, unique, annotation("__in_opt")] IShellItem *psiOver,
  6903. [in, annotation("__in")] IShellItemArray *psiaData,
  6904. [in, annotation("__in")] DWORD grfKeyState,
  6905. [in, out, annotation("__inout")] DWORD *pdwEffect);
  6906. HRESULT OnDragPosition(
  6907. [in, unique, annotation("__in_opt")] IShellItem *psiOver,
  6908. [in, annotation("__in")] IShellItemArray *psiaData,
  6909. [in, annotation("__in")] int iNewPosition,
  6910. [in, annotation("__in")] int iOldPosition);
  6911. HRESULT OnDrop(
  6912. [in, unique, annotation("__in_opt")] IShellItem *psiOver,
  6913. [in, annotation("__in")] IShellItemArray *psiaData,
  6914. [in, annotation("__in")] int iPosition,
  6915. [in, annotation("__in")] DWORD grfKeyState,
  6916. [in, out, annotation("__inout")] DWORD *pdwEffect);
  6917. HRESULT OnDropPosition(
  6918. [in, unique, annotation("__in_opt")] IShellItem *psiOver,
  6919. [in, annotation("__in")] IShellItemArray *psiaData,
  6920. [in, annotation("__in")] int iNewPosition,
  6921. [in, annotation("__in")] int iOldPosition);
  6922. HRESULT OnDragLeave([in, unique, annotation("__in_opt")] IShellItem *psiOver);
  6923. };
  6924. [
  6925. object,
  6926. uuid(71f312de-43ed-4190-8477-e9536b82350b),
  6927. local
  6928. ]
  6929. interface INameSpaceTreeAccessible : IUnknown
  6930. {
  6931. HRESULT OnGetDefaultAccessibilityAction(
  6932. [in, annotation("__in")] IShellItem *psi,
  6933. [out, annotation("__deref_out")] BSTR *pbstrDefaultAction);
  6934. HRESULT OnDoDefaultAccessibilityAction([in, annotation("__in")] IShellItem *psi);
  6935. HRESULT OnGetAccessibilityRole(
  6936. [in, annotation("__in")] IShellItem *psi,
  6937. [out, annotation("__out")] VARIANT *pvarRole);
  6938. }
  6939. [
  6940. object,
  6941. uuid(2D3BA758-33EE-42d5-BB7B-5F3431D86C78),
  6942. local
  6943. ]
  6944. interface INameSpaceTreeControlCustomDraw : IUnknown
  6945. {
  6946. typedef struct NSTCCUSTOMDRAW
  6947. {
  6948. IShellItem *psi;
  6949. UINT uItemState; // CDIS_xxx values
  6950. NSTCITEMSTATE nstcis;
  6951. LPCWSTR pszText;
  6952. int iImage;
  6953. HIMAGELIST himl;
  6954. int iLevel;
  6955. int iIndent;
  6956. } NSTCCUSTOMDRAW;
  6957. HRESULT PrePaint(
  6958. [in, annotation("__in")] HDC hdc,
  6959. [in, annotation("__in")] RECT *prc,
  6960. [out, annotation("__out")] LRESULT *plres);
  6961. HRESULT PostPaint(
  6962. [in, annotation("__in")] HDC hdc,
  6963. [in, annotation("__in")] RECT *prc);
  6964. HRESULT ItemPrePaint(
  6965. [in, annotation("__in")] HDC hdc,
  6966. [in, annotation("__in")] RECT *prc,
  6967. [in, annotation("__in")] NSTCCUSTOMDRAW *pnstccdItem,
  6968. [in, out, annotation("__inout")] COLORREF *pclrText,
  6969. [in, out, annotation("__inout")] COLORREF *pclrTextBk,
  6970. [out, annotation("__out")] LRESULT *plres);
  6971. HRESULT ItemPostPaint(
  6972. [in, annotation("__in")] HDC hdc,
  6973. [in, annotation("__in")] RECT *prc,
  6974. [in, annotation("__in")] NSTCCUSTOMDRAW *pnstccdItem);
  6975. }
  6976. //cpp_quote("#endif // NTDDI_VISTA")
  6977. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  6978. [
  6979. object,
  6980. uuid(e9701183-e6b3-4ff2-8568-813615fec7be),
  6981. local
  6982. ]
  6983. interface INameSpaceTreeControlFolderCapabilities : IUnknown
  6984. {
  6985. typedef [v1_enum] enum NSTCFOLDERCAPABILITIES
  6986. {
  6987. NSTCFC_NONE = 0x00000000,
  6988. NSTCFC_PINNEDITEMFILTERING = 0x00000001, // Supports filtering based on PKEY_IsPinnedToNameSpaceTree
  6989. NSTCFC_DELAY_REGISTER_NOTIFY = 0x00000002, // Delays registration for change notifications until expanded in navigation pane
  6990. } NSTCFOLDERCAPABILITIES;
  6991. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(NSTCFOLDERCAPABILITIES)")
  6992. HRESULT GetFolderCapabilities([in, annotation("__in")] NSTCFOLDERCAPABILITIES nfcMask, [out, annotation("__out")] NSTCFOLDERCAPABILITIES *pnfcValue);
  6993. }
  6994. cpp_quote("#endif // NTDDI_VISTA")
  6995. // New for Vista, but used by downlevel code
  6996. //cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  6997. // IPreviewHandler::DoPreview error codes
  6998. cpp_quote("#define E_PREVIEWHANDLER_DRM_FAIL _HRESULT_TYPEDEF_(0x86420001L)") // blocked by digital rights management
  6999. cpp_quote("#define E_PREVIEWHANDLER_NOAUTH _HRESULT_TYPEDEF_(0x86420002L)") // blocked by file permissions
  7000. cpp_quote("#define E_PREVIEWHANDLER_NOTFOUND _HRESULT_TYPEDEF_(0x86420003L)") // item was not found
  7001. cpp_quote("#define E_PREVIEWHANDLER_CORRUPT _HRESULT_TYPEDEF_(0x86420004L)") // item was corrupt
  7002. [
  7003. object,
  7004. uuid(8895b1c6-b41f-4c1c-a562-0d564250836f),
  7005. ]
  7006. interface IPreviewHandler : IUnknown
  7007. {
  7008. HRESULT SetWindow(
  7009. [in] HWND hwnd,
  7010. [in] const RECT *prc);
  7011. HRESULT SetRect([in] const RECT *prc);
  7012. HRESULT DoPreview();
  7013. HRESULT Unload();
  7014. HRESULT SetFocus();
  7015. HRESULT QueryFocus([out] HWND* phwnd);
  7016. HRESULT TranslateAccelerator([in] MSG* pmsg);
  7017. }
  7018. [
  7019. object,
  7020. uuid(fec87aaf-35f9-447a-adb7-20234491401a),
  7021. pointer_default(unique)
  7022. ]
  7023. interface IPreviewHandlerFrame: IUnknown
  7024. {
  7025. typedef struct
  7026. {
  7027. HACCEL haccel;
  7028. UINT cAccelEntries;
  7029. } PREVIEWHANDLERFRAMEINFO;
  7030. HRESULT GetWindowContext([out] PREVIEWHANDLERFRAMEINFO* pinfo);
  7031. HRESULT TranslateAccelerator([in] MSG* pmsg);
  7032. };
  7033. //cpp_quote("#endif // NTDDI_VISTA")
  7034. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  7035. //
  7036. // for show/hide deskbands
  7037. //
  7038. [
  7039. object,
  7040. uuid(6D67E846-5B9C-4db8-9CBC-DDE12F4254F1),
  7041. pointer_default(unique)
  7042. ]
  7043. interface ITrayDeskBand : IUnknown
  7044. {
  7045. HRESULT ShowDeskBand([in] REFCLSID clsid);
  7046. HRESULT HideDeskBand([in] REFCLSID clsid);
  7047. HRESULT IsDeskBandShown([in] REFCLSID clsid);
  7048. HRESULT DeskBandRegistrationChanged();
  7049. }
  7050. [
  7051. uuid(B9075C7C-D48E-403f-AB99-D6C77A1084AC),
  7052. object,
  7053. pointer_default(unique)
  7054. ]
  7055. interface IBandHost : IUnknown
  7056. {
  7057. HRESULT CreateBand(
  7058. [in] REFCLSID rclsidBand,
  7059. [in] BOOL fAvailable,
  7060. [in] BOOL fVisible,
  7061. [in] REFIID riid,
  7062. [out, iid_is(riid)]void **ppv);
  7063. HRESULT SetBandAvailability(
  7064. [in] REFCLSID rclsidBand,
  7065. [in] BOOL fAvailable);
  7066. HRESULT DestroyBand([in] REFCLSID rclsidBand);
  7067. }
  7068. cpp_quote("#define SID_SBandHost IID_IBandHost")
  7069. typedef GUID EXPLORERPANE; // identifies panes
  7070. // these typedefs are used only for the MIDL pass, everyone else gets the cpp_quote stuff
  7071. cpp_quote("#if 0")
  7072. typedef EXPLORERPANE *REFEXPLORERPANE;
  7073. cpp_quote("#endif // 0")
  7074. cpp_quote("#ifdef __cplusplus")
  7075. cpp_quote("#define REFEXPLORERPANE const EXPLORERPANE &")
  7076. cpp_quote("#else // !__cplusplus")
  7077. cpp_quote("#define REFEXPLORERPANE const EXPLORERPANE * __MIDL_CONST")
  7078. cpp_quote("#endif // __cplusplus")
  7079. [
  7080. object,
  7081. uuid(e07010ec-bc17-44c0-97b0-46c7c95b9edc),
  7082. local,
  7083. pointer_default(unique)
  7084. ]
  7085. interface IExplorerPaneVisibility : IUnknown
  7086. {
  7087. [v1_enum] enum _EXPLORERPANESTATE
  7088. {
  7089. // ordinals
  7090. EPS_DONTCARE = 0x0000, // don't impact the pane at all
  7091. EPS_DEFAULT_ON = 0x0001, // set its default state to "on", however user-modified persisted state is respected.
  7092. EPS_DEFAULT_OFF = 0x0002, // " " " "off".
  7093. EPS_STATEMASK = 0xFFFF,
  7094. // flags
  7095. // not all ExplorerPanes will necessarily respect these flags
  7096. EPS_INITIALSTATE = 0x00010000, // ignore persisted state from the user, but user can still modify the state.
  7097. EPS_FORCE = 0x00020000, // user can't modify the state (i.e. hide affordances for show/hide). implies EPS_INITIALSTATE.
  7098. };
  7099. typedef DWORD EXPLORERPANESTATE;
  7100. // each pane has its own semantic, for example the NavPane is opt-out, so EPS_DONTCARE means you'll typically have the
  7101. // NavPane displayed, clients who want it to never show will pass EPS_DEFAULT_OFF | EPS_FORCE.
  7102. // QueryPane is opt-in, so it will only show for clients who pass EPS_DEFAULT_ON. however its default persisted state
  7103. // is "off" so if you want to force it on you have to pass EPS_DEFAULT_ON | EPS_INITIALSTATE.
  7104. // IExplorerPaneVisibility client can provide default states by returning EXPLORERPANESTATE here,
  7105. // failure of GetPaneState corresponds to EPS_DONTCARE.
  7106. HRESULT GetPaneState([in, annotation("__in")] REFEXPLORERPANE ep, [out, annotation("__out")] EXPLORERPANESTATE *peps);
  7107. }
  7108. cpp_quote("#define SID_ExplorerPaneVisibility IID_IExplorerPaneVisibility")
  7109. // controls the behavior of the SHCreateDefaultContextMenu()
  7110. [
  7111. object,
  7112. uuid(3409E930-5A39-11d1-83FA-00A0C90DC849),
  7113. pointer_default(unique),
  7114. local
  7115. ]
  7116. interface IContextMenuCB : IUnknown
  7117. {
  7118. // uMsg is one of DFM_XXX values
  7119. HRESULT CallBack(
  7120. [in, unique, annotation("__in_opt")] IShellFolder *psf,
  7121. [in, unique, annotation("__in_opt")] HWND hwndOwner,
  7122. [in, unique, annotation("__in_opt")] IDataObject *pdtobj,
  7123. [in, annotation("__in")] UINT uMsg,
  7124. [in, annotation("__in")] WPARAM wParam,
  7125. [in, annotation("__in")] LPARAM lParam);
  7126. }
  7127. cpp_quote("#endif // NTDDI_VISTA")
  7128. [
  7129. object,
  7130. uuid(41ded17d-d6b3-4261-997d-88c60e4b1d58),
  7131. local,
  7132. pointer_default(unique)
  7133. ]
  7134. interface IDefaultExtractIconInit : IUnknown
  7135. {
  7136. // set IExtractIcon GIL_XXX flags
  7137. HRESULT SetFlags([in, annotation("__in")] UINT uFlags);
  7138. // set the registry key to load "DefaultIcon" value from
  7139. HRESULT SetKey([in, annotation("__in")] HKEY hkey);
  7140. // set the various forms of icons, if pszFile is NULL iIcon is SHSTOCKICONID (SIID_) value
  7141. HRESULT SetNormalIcon(
  7142. [in, unique, string, annotation("__in_opt")] LPCWSTR pszFile,
  7143. [in, annotation("__in")] int iIcon);
  7144. HRESULT SetOpenIcon(
  7145. [in, unique, string, annotation("__in_opt")] LPCWSTR pszFile,
  7146. [in, annotation("__in")] int iIcon);
  7147. HRESULT SetShortcutIcon(
  7148. [in, unique, string, annotation("__in_opt")] LPCWSTR pszFile,
  7149. [in, annotation("__in")] int iIcon);
  7150. HRESULT SetDefaultIcon(
  7151. [in, unique, string, annotation("__in_opt")] LPCWSTR pszFile,
  7152. [in, annotation("__in")] int iIcon);
  7153. }
  7154. // "Default" IExtractIcon implementation useful for implementation of ::GetUIObjectOf(IID_IExtractIcon)
  7155. cpp_quote("STDAPI SHCreateDefaultExtractIcon(__in REFIID riid, __deref_out void **ppv);")
  7156. interface IEnumExplorerCommand;
  7157. [
  7158. uuid(a08ce4d0-fa25-44ab-b57c-c7b1c323e0b9),
  7159. pointer_default(unique)
  7160. ]
  7161. interface IExplorerCommand : IUnknown
  7162. {
  7163. [v1_enum] enum _EXPCMDSTATE
  7164. {
  7165. ECS_ENABLED = 0x00,
  7166. ECS_DISABLED = 0x01,
  7167. ECS_HIDDEN = 0x02,
  7168. ECS_CHECKBOX = 0x04,
  7169. ECS_CHECKED = 0x08,
  7170. ECS_RADIOCHECK = 0x10,
  7171. };
  7172. typedef DWORD EXPCMDSTATE;
  7173. [v1_enum] enum _EXPCMDFLAGS
  7174. {
  7175. ECF_DEFAULT = 0x00,
  7176. ECF_HASSUBCOMMANDS = 0x01,
  7177. ECF_HASSPLITBUTTON = 0x02,
  7178. ECF_HIDELABEL = 0x04,
  7179. ECF_ISSEPARATOR = 0x08,
  7180. ECF_HASLUASHIELD = 0x10,
  7181. ECF_SEPARATORBEFORE = 0x20,
  7182. ECF_SEPARATORAFTER = 0x40,
  7183. ECF_ISDROPDOWN = 0x80,
  7184. };
  7185. typedef DWORD EXPCMDFLAGS;
  7186. HRESULT GetTitle(
  7187. [in, unique] IShellItemArray *psiItemArray,
  7188. [out, string] LPWSTR *ppszName);
  7189. HRESULT GetIcon(
  7190. [in, unique] IShellItemArray *psiItemArray,
  7191. [out, string] LPWSTR *ppszIcon); // we support icon resource strings like: "shell32,-123"
  7192. HRESULT GetToolTip(
  7193. [in, unique] IShellItemArray *psiItemArray,
  7194. [out, string] LPWSTR *ppszInfotip);
  7195. HRESULT GetCanonicalName([out] GUID* pguidCommandName);
  7196. HRESULT GetState(
  7197. [in] IShellItemArray *psiItemArray,
  7198. [in] BOOL fOkToBeSlow,
  7199. [out] EXPCMDSTATE *pCmdState);
  7200. HRESULT Invoke(
  7201. [in] IShellItemArray *psiItemArray,
  7202. [in, unique] IBindCtx *pbc);
  7203. HRESULT GetFlags([out] EXPCMDFLAGS *pFlags);
  7204. HRESULT EnumSubCommands([out] IEnumExplorerCommand **ppEnum);
  7205. };
  7206. [
  7207. uuid(bddacb60-7657-47ae-8445-d23e1acf82ae),
  7208. object,
  7209. pointer_default(unique)
  7210. ]
  7211. interface IExplorerCommandState : IUnknown
  7212. {
  7213. HRESULT GetState([in] IShellItemArray *psiItemArray, [in] BOOL fOkToBeSlow, [out] EXPCMDSTATE *pCmdState);
  7214. }
  7215. [
  7216. object,
  7217. uuid(85075acf-231f-40ea-9610-d26b7b58f638),
  7218. pointer_default(unique)
  7219. ]
  7220. interface IInitializeCommand : IUnknown
  7221. {
  7222. HRESULT Initialize([in, string] LPCWSTR pszCommandName, [in] IPropertyBag *ppb);
  7223. }
  7224. [
  7225. uuid(a88826f8-186f-4987-aade-ea0cef8fbfe8),
  7226. object,
  7227. pointer_default(unique)
  7228. ]
  7229. interface IEnumExplorerCommand : IUnknown
  7230. {
  7231. [local]
  7232. HRESULT Next(
  7233. [in, annotation("__in")] ULONG celt,
  7234. [out, size_is(celt), length_is(*pceltFetched), annotation("__out_ecount_part(celt, *pceltFetched)")] IExplorerCommand** pUICommand,
  7235. [out, annotation("__out_opt __deref_out_range(0, celt)")] ULONG *pceltFetched);
  7236. [call_as(Next)]
  7237. HRESULT RemoteNext(
  7238. [in] ULONG celt,
  7239. [out, size_is(celt), length_is(*pceltFetched)] IExplorerCommand** pUICommand,
  7240. [out] ULONG *pceltFetched);
  7241. HRESULT Skip([in] ULONG celt);
  7242. HRESULT Reset();
  7243. HRESULT Clone([out] IEnumExplorerCommand **ppenum);
  7244. };
  7245. [
  7246. uuid(64961751-0835-43c0-8ffe-d57686530e64),
  7247. pointer_default(unique)
  7248. ]
  7249. interface IExplorerCommandProvider : IUnknown
  7250. {
  7251. // IEnumExplorerCommand
  7252. HRESULT GetCommands(
  7253. [in] IUnknown *punkSite,
  7254. [in] REFIID riid,
  7255. [out, iid_is(riid)] void **ppv);
  7256. // IExplorerCommand
  7257. HRESULT GetCommand(
  7258. [in] REFGUID rguidCommandId,
  7259. [in] REFIID riid,
  7260. [out, iid_is(riid)] void **ppv);
  7261. };
  7262. typedef HANDLE HTHEME;
  7263. [
  7264. object,
  7265. uuid(6e0f9881-42a8-4f2a-97f8-8af4e026d92d),
  7266. pointer_default(unique)
  7267. ]
  7268. interface IInitializeNetworkFolder : IUnknown
  7269. {
  7270. HRESULT Initialize(
  7271. [in, unique] PCIDLIST_ABSOLUTE pidl,
  7272. [in, unique] PCIDLIST_ABSOLUTE pidlTarget,
  7273. [in] UINT uDisplayType, // RESOURCEDISPLAYTYPE_ values
  7274. [in, unique, string] LPCWSTR pszResName, // server or server share name
  7275. [in, unique, string] LPCWSTR pszProvider); // network provider name
  7276. };
  7277. typedef [v1_enum] enum CPVIEW
  7278. {
  7279. CPVIEW_CLASSIC = 0,
  7280. CPVIEW_ALLITEMS = CPVIEW_CLASSIC,
  7281. CPVIEW_CATEGORY = 1,
  7282. CPVIEW_HOME = CPVIEW_CATEGORY,
  7283. } CPVIEW;
  7284. [
  7285. object,
  7286. uuid(D11AD862-66DE-4DF4-BF6C-1F5621996AF1),
  7287. ]
  7288. interface IOpenControlPanel : IUnknown
  7289. {
  7290. HRESULT Open(
  7291. [in, unique, string] LPCWSTR pszName,
  7292. [in, unique, string] LPCWSTR pszPage,
  7293. [in, unique] IUnknown *punkSite);
  7294. HRESULT GetPath(
  7295. [in, unique, string] LPCWSTR pszName,
  7296. [out, string, size_is(cchPath)] LPWSTR pszPath,
  7297. [in] UINT cchPath);
  7298. HRESULT GetCurrentView([out] CPVIEW *pView);
  7299. };
  7300. [
  7301. object,
  7302. uuid(0DF60D92-6818-46d6-B358-D66170DDE466),
  7303. pointer_default(unique)
  7304. ]
  7305. interface IComputerInfoChangeNotify : IUnknown
  7306. {
  7307. HRESULT ComputerInfoChanged();
  7308. };
  7309. // IShellFolder IBindCtx parameter: "File System Bind Data".
  7310. //
  7311. // The IUnknown for this is accessed through IBindCtx::RegisterObjectParam/GetObjectParam.
  7312. //
  7313. // Use this to provide the data needed to create IDLists through IShellFolder::ParseDisplayName().
  7314. //
  7315. // This data applies to the last element of the name that is parsed (c:\foo\bar.txt,
  7316. // data applies to bar.txt).
  7317. //
  7318. // This makes creating these IDLists much faster than supplying the name only.
  7319. // This is sometimes referred to as "simple parsing".
  7320. cpp_quote("#define STR_FILE_SYS_BIND_DATA L\"File System Bind Data\"")
  7321. [
  7322. object,
  7323. uuid(01E18D10-4D8B-11d2-855D-006008059367),
  7324. pointer_default(unique),
  7325. local
  7326. ]
  7327. interface IFileSystemBindData : IUnknown
  7328. {
  7329. HRESULT SetFindData([in] const WIN32_FIND_DATAW *pfd);
  7330. HRESULT GetFindData([out] WIN32_FIND_DATAW *pfd);
  7331. };
  7332. [
  7333. object,
  7334. uuid(3acf075f-71db-4afa-81f0-3fc4fdf2a5b8),
  7335. pointer_default(unique),
  7336. local
  7337. ]
  7338. interface IFileSystemBindData2 : IFileSystemBindData
  7339. {
  7340. HRESULT SetFileID([in] LARGE_INTEGER liFileID);
  7341. HRESULT GetFileID([out] LARGE_INTEGER *pliFileID);
  7342. HRESULT SetJunctionCLSID([in] REFCLSID clsid);
  7343. HRESULT GetJunctionCLSID([out] CLSID *pclsid);
  7344. };
  7345. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WIN7)")
  7346. // Custom Destination List
  7347. [
  7348. uuid(6332debf-87b5-4670-90c0-5e57b408a49e),
  7349. object,
  7350. pointer_default(unique),
  7351. ]
  7352. interface ICustomDestinationList : IUnknown
  7353. {
  7354. typedef [v1_enum] enum KNOWNDESTCATEGORY
  7355. {
  7356. KDC_FREQUENT = 1,
  7357. KDC_RECENT,
  7358. } KNOWNDESTCATEGORY;
  7359. HRESULT SetAppID([in, string] LPCWSTR pszAppID);
  7360. // Retrieve IObjectArray of IShellItems or IShellLinks that represent removed destinations
  7361. HRESULT BeginList(
  7362. [out] UINT *pcMinSlots,
  7363. [in] REFIID riid,
  7364. [out, iid_is(riid)] void **ppv);
  7365. HRESULT AppendCategory(
  7366. [in, string] LPCWSTR pszCategory,
  7367. [in] IObjectArray *poa);
  7368. HRESULT AppendKnownCategory([in] KNOWNDESTCATEGORY category);
  7369. HRESULT AddUserTasks([in] IObjectArray *poa);
  7370. HRESULT CommitList();
  7371. // Retrieve IObjectCollection of IShellItems
  7372. HRESULT GetRemovedDestinations(
  7373. [in] REFIID riid,
  7374. [out, iid_is(riid)] void **ppv);
  7375. HRESULT DeleteList([in, unique, string] LPCWSTR pszAppID);
  7376. HRESULT AbortList();
  7377. };
  7378. // Used to remove items from the automatic destination lists created when apps or the system call SHAddToRecentDocs to report usage of a document.
  7379. [
  7380. uuid(12337d35-94c6-48a0-bce7-6a9c69d4d600),
  7381. object,
  7382. pointer_default(unique),
  7383. ]
  7384. interface IApplicationDestinations : IUnknown
  7385. {
  7386. // Set the App User Model ID for the application removing destinations from its list. If an AppID is not provided
  7387. // via this method, the system will use a heuristically determined ID. This method must be called before
  7388. // RemoveDestination or RemoveAllDestinations.
  7389. HRESULT SetAppID([in] LPCWSTR pszAppID);
  7390. // Remove an IShellItem or an IShellLink from the automatic destination list
  7391. HRESULT RemoveDestination([in] IUnknown *punk);
  7392. // Clear the frequent and recent destination lists for this application.
  7393. HRESULT RemoveAllDestinations();
  7394. };
  7395. // Allows an application to retrieve the most recent and frequent documents opened in that app, as reported via SHAddToRecentDocs
  7396. [
  7397. uuid(3c594f9f-9f30-47a1-979a-c9e83d3d0a06),
  7398. object,
  7399. pointer_default(unique),
  7400. ]
  7401. interface IApplicationDocumentLists : IUnknown
  7402. {
  7403. typedef [v1_enum] enum APPDOCLISTTYPE
  7404. {
  7405. ADLT_RECENT = 0, // The recently used documents list
  7406. ADLT_FREQUENT, // The frequently used documents list
  7407. } APPDOCLISTTYPE;
  7408. // Set the App User Model ID for the application retrieving this list. If an AppID is not provided via this method,
  7409. // the system will use a heuristically determined ID. This method must be called before GetList.
  7410. HRESULT SetAppID([in] LPCWSTR pszAppID);
  7411. // Retrieve an IEnumObjects or IObjectArray for IShellItems and/or IShellLinks.
  7412. // Items may appear in both the frequent and recent lists.
  7413. HRESULT GetList([in] APPDOCLISTTYPE listtype, [in] UINT cItemsDesired, [in] REFIID riid, [out, iid_is(riid)] void **ppv);
  7414. };
  7415. // Provides access to the App User Model ID on objects supporting this value
  7416. [
  7417. uuid(36db0196-9665-46d1-9ba7-d3709eecf9ed),
  7418. object,
  7419. pointer_default(unique)
  7420. ]
  7421. interface IObjectWithAppUserModelID : IUnknown
  7422. {
  7423. HRESULT SetAppID([in, string] LPCWSTR pszAppID);
  7424. HRESULT GetAppID([out, string] LPWSTR *ppszAppID);
  7425. };
  7426. // Provides access to the ProgID associated with an object
  7427. [
  7428. uuid(71e806fb-8dee-46fc-bf8c-7748a8a1ae13),
  7429. object,
  7430. pointer_default(unique)
  7431. ]
  7432. interface IObjectWithProgID : IUnknown
  7433. {
  7434. HRESULT SetProgID([in, string] LPCWSTR pszProgID);
  7435. HRESULT GetProgID([out, string] LPWSTR *ppszProgID);
  7436. };
  7437. [
  7438. uuid(6589b6d2-5f8d-4b9e-b7e0-23cdd9717d8c),
  7439. local,
  7440. pointer_default(unique)
  7441. ]
  7442. interface IUpdateIDList : IUnknown
  7443. {
  7444. // Implemented by an IShellFolder implementation, this method updates the provided child IDList based on the
  7445. // parameters specified by the provided IBindCtx. If pbc is NULL, or does not contain any parameters that
  7446. // apply to the current Shell Folder, pidlIn should simply be cloned into ppidlOut.
  7447. HRESULT Update(
  7448. [in, unique, annotation("__in_opt")] IBindCtx *pbc,
  7449. [in, annotation("__in")] PCUITEMID_CHILD pidlIn,
  7450. [out, annotation("__deref_out")] PITEMID_CHILD *ppidlOut);
  7451. };
  7452. // Sets the User Model AppID for the current process, enabling Windows to retrieve this ID
  7453. cpp_quote("SHSTDAPI SetCurrentProcessExplicitAppUserModelID(__in PCWSTR AppID);")
  7454. // Retrieves the User Model AppID that has been explicitly set for the current process via
  7455. // SetCurrentProcessExplicitAppUserModelID
  7456. cpp_quote("SHSTDAPI GetCurrentProcessExplicitAppUserModelID(__deref_out PWSTR *AppID);")
  7457. cpp_quote("#endif // NTDDI_WIN7")
  7458. [
  7459. object,
  7460. uuid(c1646bc4-f298-4f91-a204-eb2dd1709d1a),
  7461. ]
  7462. interface IDesktopGadget : IUnknown
  7463. {
  7464. HRESULT RunGadget([in] LPCWSTR gadgetPath);
  7465. };
  7466. cpp_quote("#define HOMEGROUP_SECURITY_GROUP L\"HomeUsers\"")
  7467. // IHomeGroup
  7468. [
  7469. uuid(7a3bd1d9-35a9-4fb3-a467-f48cac35e2d0),
  7470. object,
  7471. local
  7472. ]
  7473. interface IHomeGroup : IUnknown
  7474. {
  7475. typedef [v1_enum] enum HOMEGROUPSHARINGCHOICES
  7476. {
  7477. HGSC_NONE = 0x00000000,
  7478. HGSC_MUSICLIBRARY = 0x00000001,
  7479. HGSC_PICTURESLIBRARY = 0x00000002,
  7480. HGSC_VIDEOSLIBRARY = 0x00000004,
  7481. HGSC_DOCUMENTSLIBRARY = 0x00000008,
  7482. HGSC_PRINTERS = 0x00000010,
  7483. } HOMEGROUPSHARINGCHOICES;
  7484. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(HOMEGROUPSHARINGCHOICES)")
  7485. HRESULT IsMember([out] BOOL *member);
  7486. HRESULT ShowSharingWizard([in] HWND owner, [out] HOMEGROUPSHARINGCHOICES *sharingchoices);
  7487. };
  7488. [
  7489. helpstring("Initialize With IPropertyStore"),
  7490. uuid(C3E12EB5-7D8D-44f8-B6DD-0E77B34D6DE4),
  7491. object,
  7492. pointer_default(unique)
  7493. ]
  7494. interface IInitializeWithPropertyStore : IUnknown
  7495. {
  7496. HRESULT Initialize([in] IPropertyStore *pps);
  7497. };
  7498. [
  7499. helpstring("OpenSearch Data Source API"),
  7500. uuid(F0EE7333-E6FC-479b-9F25-A860C234A38E),
  7501. object,
  7502. pointer_default(unique),
  7503. ]
  7504. interface IOpenSearchSource : IUnknown
  7505. {
  7506. HRESULT GetResults(
  7507. [in] HWND hwnd,
  7508. [in] LPCWSTR pszQuery,
  7509. [in] DWORD dwStartIndex,
  7510. [in] DWORD dwCount,
  7511. [in] REFIID riid,
  7512. [out, iid_is(riid)] void **ppv); // return IStream
  7513. };
  7514. // Library API
  7515. [
  7516. helpstring("Shell Library API"),
  7517. uuid(11a66efa-382e-451a-9234-1e0e12ef3085),
  7518. object,
  7519. pointer_default(unique),
  7520. ]
  7521. interface IShellLibrary : IUnknown
  7522. {
  7523. typedef [v1_enum] enum LIBRARYFOLDERFILTER
  7524. {
  7525. LFF_FORCEFILESYSTEM = 1, // Return only file system items.
  7526. LFF_STORAGEITEMS = 2, // Return any items that can be bound to an IStorage. (default)
  7527. LFF_ALLITEMS = 3, // Return all items.
  7528. } LIBRARYFOLDERFILTER;
  7529. typedef [v1_enum] enum LIBRARYOPTIONFLAGS
  7530. {
  7531. LOF_DEFAULT = 0x00000000,
  7532. LOF_PINNEDTONAVPANE = 0x00000001, // Specifies that this library is pinned to the navigation pane.
  7533. LOF_MASK_ALL = 0x00000001,
  7534. } LIBRARYOPTIONFLAGS;
  7535. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(LIBRARYOPTIONFLAGS)")
  7536. typedef [v1_enum] enum DEFAULTSAVEFOLDERTYPE
  7537. {
  7538. DSFT_DETECT = 1, // Specifies the save folder for the current user depending on whether or not they are the owner of the library
  7539. DSFT_PRIVATE, // Specifies the private save folder for the owner of the library
  7540. DSFT_PUBLIC, // Specifies the public save folder for non-owners of the library
  7541. } DEFAULTSAVEFOLDERTYPE;
  7542. typedef [v1_enum] enum LIBRARYSAVEFLAGS
  7543. {
  7544. LSF_FAILIFTHERE = 0x00000000, // if a library with the same name exists fail to save
  7545. LSF_OVERRIDEEXISTING = 0x00000001, // will override existing library with the same name if there or create a new one if not
  7546. LSF_MAKEUNIQUENAME = 0x00000002, // if a library with the same name exists create a unique name by adding a number in parenthesis
  7547. } LIBRARYSAVEFLAGS;
  7548. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(LIBRARYSAVEFLAGS)")
  7549. HRESULT LoadLibraryFromItem([in] IShellItem *psiLibrary, [in] DWORD grfMode);
  7550. HRESULT LoadLibraryFromKnownFolder([in] REFKNOWNFOLDERID kfidLibrary, [in] DWORD grfMode);
  7551. HRESULT AddFolder([in] IShellItem *psiLocation);
  7552. HRESULT RemoveFolder([in] IShellItem *psiLocation);
  7553. // may return S_FALSE if some folders were omitted due to errors during enumeration
  7554. HRESULT GetFolders(
  7555. [in] LIBRARYFOLDERFILTER lff,
  7556. [in] REFIID riid,
  7557. [out, iid_is(riid)] void **ppv); // returns IShellItemArray
  7558. // returns S_FALSE if no resolution was necessary; resolved folder will not be saved until Save[InKnownFolder] or Commit is called
  7559. HRESULT ResolveFolder(
  7560. [in] IShellItem *psiFolderToResolve,
  7561. [in] DWORD dwTimeout,
  7562. [in] REFIID riid,
  7563. [out, iid_is(riid)] void **ppv); // returns IShellItem
  7564. HRESULT GetDefaultSaveFolder(
  7565. [in] DEFAULTSAVEFOLDERTYPE dsft,
  7566. [in] REFIID riid,
  7567. [out, iid_is(riid)] void **ppv); // returns IShellItem
  7568. HRESULT SetDefaultSaveFolder([in] DEFAULTSAVEFOLDERTYPE dsft, [in] IShellItem *psi);
  7569. HRESULT GetOptions([out] LIBRARYOPTIONFLAGS *plofOptions);
  7570. HRESULT SetOptions([in] LIBRARYOPTIONFLAGS lofMask, [in] LIBRARYOPTIONFLAGS lofOptions);
  7571. HRESULT GetFolderType([out] FOLDERTYPEID *pftid);
  7572. HRESULT SetFolderType([in] REFFOLDERTYPEID ftid);
  7573. HRESULT GetIcon([out, string] LPWSTR *ppszIcon);
  7574. HRESULT SetIcon([in, string] LPCWSTR pszIcon);
  7575. HRESULT Commit();
  7576. HRESULT Save(
  7577. [in] IShellItem *psiFolderToSaveIn,
  7578. [in, string] LPCWSTR pszLibraryName, // name without an extension
  7579. [in] LIBRARYSAVEFLAGS lsf,
  7580. [out] IShellItem **ppsiSavedTo);
  7581. HRESULT SaveInKnownFolder(
  7582. [in] REFKNOWNFOLDERID kfidToSaveIn,
  7583. [in, string] LPCWSTR pszLibraryName, // name without an extension
  7584. [in] LIBRARYSAVEFLAGS lsf,
  7585. [out] IShellItem **ppsiSavedTo);
  7586. };
  7587. //
  7588. // NOTE - this typelib is never registered anywhere
  7589. // objects that want their typelibs to be registered
  7590. // in shell32 should add their coclass to shldisp.idl
  7591. //
  7592. // Microsoft Shell Objects
  7593. [
  7594. uuid(50a7e9b1-70ef-11d1-b75a-00a0c90564fe), // LIBID_ShellObjects
  7595. lcid(0x0000),
  7596. version(1.0)
  7597. ]
  7598. library ShellObjects
  7599. {
  7600. // CLSID_ShellDesktop
  7601. [ uuid(00021400-0000-0000-C000-000000000046) ] coclass ShellDesktop { interface IShellFolder2; }
  7602. // CLSID_ShellFSFolder
  7603. [ uuid(F3364BA0-65B9-11CE-A9BA-00AA004AE837) ] coclass ShellFSFolder { interface IShellFolder2; }
  7604. // CLSID_NetworkPlaces
  7605. [ uuid(208D2C60-3AEA-1069-A2D7-08002B30309D) ] coclass NetworkPlaces { interface IShellFolder2; }
  7606. // CLSID_ShellLink
  7607. [ uuid(00021401-0000-0000-C000-000000000046) ] coclass ShellLink { interface IShellLinkW; }
  7608. // CLSID_QueryCancelAutoPlay
  7609. [ uuid(331F1768-05A9-4ddd-B86E-DAE34DDC998A) ] coclass QueryCancelAutoPlay { interface IQueryCancelAutoPlay; }
  7610. // CLSID_DriveSizeCategorizer
  7611. [ uuid(94357B53-CA29-4b78-83AE-E8FE7409134F) ] coclass DriveSizeCategorizer { interface ICategorizer; }
  7612. // CLSID_DriveTypeCategorizer
  7613. [ uuid(B0A8F3CF-4333-4bab-8873-1CCB1CADA48B) ] coclass DriveTypeCategorizer { interface ICategorizer; }
  7614. // CLSID_FreeSpaceCategorizer
  7615. [ uuid(B5607793-24AC-44c7-82E2-831726AA6CB7) ] coclass FreeSpaceCategorizer { interface ICategorizer; }
  7616. // CLSID_TimeCategorizer
  7617. [ uuid(3bb4118f-ddfd-4d30-a348-9fb5d6bf1afe) ] coclass TimeCategorizer { interface ICategorizer; }
  7618. // CLSID_SizeCategorizer
  7619. [ uuid(55d7b852-f6d1-42f2-aa75-8728a1b2d264) ] coclass SizeCategorizer { interface ICategorizer; }
  7620. // CLSID_AlphabeticalCategorizer
  7621. [ uuid(3c2654c6-7372-4f6b-b310-55d6128f49d2) ] coclass AlphabeticalCategorizer { interface ICategorizer; }
  7622. // CLSID_MergedCategorizer
  7623. [ uuid(8e827c11-33e7-4bc1-b242-8cd9a1c2b304) ] coclass MergedCategorizer { interface ICategorizer; }
  7624. // CLSID_ImageProperties
  7625. [ uuid(7ab770c7-0e23-4d7a-8aa2-19bfad479829) ] coclass ImageProperties { interface IPersistFile; }
  7626. // CLSID_PropertiesUI
  7627. [ uuid(d912f8cf-0396-4915-884e-fb425d32943b) ] coclass PropertiesUI { interface IPropertyUI; }
  7628. // CLSID_UserNotification
  7629. [ uuid(0010890e-8789-413c-adbc-48f5b511b3af) ] coclass UserNotification { interface IUserNotification; }
  7630. // CLSID_CDBurn
  7631. [ uuid(fbeb8a05-beee-4442-804e-409d6c4515e9) ] coclass CDBurn { interface ICDBurn; }
  7632. // CLSID_TaskbarList
  7633. [ uuid(56FDF344-FD6D-11d0-958A-006097C9A090) ] coclass TaskbarList { interface ITaskbarList4; }
  7634. // CLSID_StartMenuPin
  7635. [ uuid(a2a9545d-a0c2-42b4-9708-a0b2badd77c8) ] coclass StartMenuPin { interface IStartMenuPinnedList; }
  7636. // For supporting HTML wizard extensions we provide this object, it implements the IWizardExtenion
  7637. // and allows the site to specific via an IPropertyBag an URL which should be displayed. The property
  7638. // bag is requested from the SID_WebWizardHost, and it used inturn to return parameter information
  7639. // back to the site (eg. any information that the displayed HTML would like to communicate).
  7640. // CLSID_WebWizardHost
  7641. [ uuid(c827f149-55c1-4d28-935e-57e47caed973) ] coclass WebWizardHost { interface IWebWizardExtension; }
  7642. // CLSID_PublishDropTarget
  7643. [ uuid(CC6EEFFB-43F6-46c5-9619-51D571967F7D) ] coclass PublishDropTarget { interface IDropTarget; }
  7644. // CLSID_PublishingWizard
  7645. [ uuid(6b33163c-76a5-4b6c-bf21-45de9cd503a1) ] coclass PublishingWizard { interface IPublishingWizard; }
  7646. cpp_quote("#define SID_PublishingWizard CLSID_PublishingWizard")
  7647. // CLSID_InternetPrintOrdering
  7648. [ uuid(add36aa8-751a-4579-a266-d66f5202ccbb) ] coclass InternetPrintOrdering { interface IDropTarget; }
  7649. // CLSID_FolderViewHost
  7650. [ uuid(20b1cb23-6968-4eb9-b7d4-a66d00d07cee) ] coclass FolderViewHost { interface IFolderViewHost; }
  7651. // CLSID_ExplorerBrowser
  7652. [ uuid(71f96385-ddd6-48d3-a0c1-ae06e8b055fb) ] coclass ExplorerBrowser { interface IExplorerBrowser; }
  7653. // CLSID_ImageRecompress
  7654. [ uuid(6e33091c-d2f8-4740-b55e-2e11d1477a2c) ] coclass ImageRecompress { interface IImageRecompress; }
  7655. // CLSID_TrayBandSiteService
  7656. [ uuid(F60AD0A0-E5E1-45cb-B51A-E15B9F8B2934) ] coclass TrayBandSiteService { interface IBandSite; }
  7657. // CLSID_TrayDeskBand
  7658. [ uuid(E6442437-6C68-4f52-94DD-2CFED267EFB9) ] coclass TrayDeskBand { interface ITrayDeskBand; }
  7659. // CLSID_AttachmentServices
  7660. [ uuid(4125dd96-e03a-4103-8f70-e0597d803b9c) ] coclass AttachmentServices { interface IAttachmentExecute; }
  7661. // CLSID_DocPropShellExtension
  7662. [ uuid(883373C3-BF89-11D1-BE35-080036B11A03) ] coclass DocPropShellExtension { interface IShellExtInit; }
  7663. // CLSID_ShellItem
  7664. [ uuid(9ac9fbe1-e0a2-4ad6-b4ee-e212013ea917) ] coclass ShellItem { interface IShellItem2; }
  7665. // CLSID_NamespaceWalker
  7666. [ uuid(72eb61e0-8672-4303-9175-f2e4c68b2e7c) ] coclass NamespaceWalker { interface INamespaceWalk; }
  7667. // CLSID_FileOperation
  7668. [ uuid(3ad05575-8857-4850-9277-11b85bdb8e09) ] coclass FileOperation { interface IFileOperation; }
  7669. // CLSID_FileOpenDialog
  7670. [ uuid(DC1C5A9C-E88A-4dde-A5A1-60F82A20AEF7) ] coclass FileOpenDialog { interface IFileOpenDialog; }
  7671. // CLSID_FileSaveDialog
  7672. [ uuid(C0B4E2F3-BA21-4773-8DBA-335EC946EB8B) ] coclass FileSaveDialog { interface IFileSaveDialog; }
  7673. // CLSID_KnownFolderManager
  7674. [ uuid(4df0c730-df9d-4ae3-9153-aa6b82e9795a) ] coclass KnownFolderManager { interface IKnownFolderManager; }
  7675. // CLSID_FSCopyHandler
  7676. [ uuid(D197380A-0A79-4dc8-A033-ED882C2FA14B) ] coclass FSCopyHandler { interface IUnknown; }
  7677. // CLSID_SharingConfigurationManager
  7678. [ uuid(49F371E1-8C5C-4d9c-9A3B-54A6827F513C) ] coclass SharingConfigurationManager { interface ISharingConfigurationManager; }
  7679. // CLSID_PreviousVersions
  7680. [ uuid(596AB062-B4D2-4215-9F74-E9109B0A8153) ] coclass PreviousVersions { interface IPreviousVersionsInfo; }
  7681. // CLSID_NetworkConnections
  7682. [ uuid(7007ACC7-3202-11D1-AAD2-00805FC1270E) ] coclass NetworkConnections { interface IShellFolder2; }
  7683. // CLSID_NamespaceTreeControl
  7684. [ uuid(AE054212-3535-4430-83ED-D501AA6680E6) ] coclass NamespaceTreeControl { interface INameSpaceTreeControl2; }
  7685. // CLSID_IENamespaceTreeControl
  7686. [ uuid(ACE52D03-E5CD-4b20-82FF-E71B11BEAE1D) ] coclass IENamespaceTreeControl { interface IUnknown; }
  7687. // CLSID_ScheduledTasks
  7688. [ uuid(D6277990-4C6A-11CF-8D87-00AA0060F5BF) ] coclass ScheduledTasks { interface IShellFolder2; }
  7689. // CLSID_ApplicationAssociationRegistration
  7690. [ uuid(591209c7-767b-42b2-9fba-44ee4615f2c7) ] coclass ApplicationAssociationRegistration { interface IApplicationAssociationRegistration; }
  7691. // CLSID_ApplicationAssociationRegistrationUI
  7692. [ uuid(1968106d-f3b5-44cf-890e-116fcb9ecef1) ] coclass ApplicationAssociationRegistrationUI { interface IApplicationAssociationRegistrationUI; }
  7693. // CLSID_SearchFolderItemFactory
  7694. [ uuid(14010e02-bbbd-41f0-88e3-eda371216584) ] coclass SearchFolderItemFactory { interface ISearchFolderItemFactory; }
  7695. // CLSID_OpenControlPanel
  7696. [ uuid(06622D85-6856-4460-8DE1-A81921B41C4B) ] coclass OpenControlPanel { interface IOpenControlPanel; }
  7697. // CLSID_MailRecipient
  7698. [ uuid(9E56BE60-C50F-11CF-9A2C-00A0C90A90CE) ] coclass MailRecipient { interface IDropTarget; }
  7699. // CLSID_NetworkExplorerFolder
  7700. [ uuid(F02C1A0D-BE21-4350-88B0-7367FC96EF3C) ] coclass NetworkExplorerFolder { interface IShellFolder2; }
  7701. // CLSID_DestinationList
  7702. [ uuid(77f10cf0-3db5-4966-b520-b7c54fd35ed6) ] coclass DestinationList { interface ICustomDestinationList; }
  7703. // CLSID_ApplicationDestinations
  7704. [ uuid(86c14003-4d6b-4ef3-a7b4-0506663b2e68) ] coclass ApplicationDestinations { interface IApplicationDestinations; }
  7705. // CLSID_ApplicationDocumentLists
  7706. [ uuid(86bec222-30f2-47e0-9f25-60d11cd75c28) ] coclass ApplicationDocumentLists { interface IApplicationDocumentLists; }
  7707. // CLSID_HomeGroup
  7708. [ uuid(DE77BA04-3C92-4d11-A1A5-42352A53E0E3) ] coclass HomeGroup { interface IHomeGroup; }
  7709. // CLSID_ShellLibrary
  7710. [ uuid(d9b3211d-e57f-4426-aaef-30a806add397) ] coclass ShellLibrary { interface IShellLibrary; }
  7711. // CLSID_AppStartupLink
  7712. [ uuid(273eb5e7-88b0-4843-bfef-e2c81d43aae5) ] coclass AppStartupLink { interface IShellLinkW; }
  7713. // CLSID_EnumerableObjectCollection
  7714. [ uuid(2d3468c1-36a7-43b6-ac24-d3f02fd9607a) ] coclass EnumerableObjectCollection { interface IEnumObjects; }
  7715. // CLSID_DesktopGadget
  7716. [ uuid(924ccc1b-6562-4c85-8657-d177925222b6) ] coclass DesktopGadget { interface IDesktopGadget; }
  7717. };
  7718. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  7719. cpp_quote("SHSTDAPI SHGetTemporaryPropertyForItem(__in IShellItem *psi, __in REFPROPERTYKEY propkey, __out PROPVARIANT *ppropvar);")
  7720. cpp_quote("SHSTDAPI SHSetTemporaryPropertyForItem(__in IShellItem *psi, __in REFPROPERTYKEY propkey, __in REFPROPVARIANT propvar);")
  7721. cpp_quote("#endif // NTDDI_VISTA")
  7722. // helper APIs to simplify initializing an instance of IShellLibrary and working with file system paths
  7723. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WIN7)")
  7724. cpp_quote("#if (_WIN32_IE >= _WIN32_IE_IE70)")
  7725. typedef [v1_enum] enum LIBRARYMANAGEDIALOGOPTIONS
  7726. {
  7727. LMD_DEFAULT = 0x00000000,
  7728. LMD_ALLOWUNINDEXABLENETWORKLOCATIONS = 0x00000001, // The caller of SHShowManageLibraryUI does not want to show any warning dialogs about network locations that cannot be indexed
  7729. } LIBRARYMANAGEDIALOGOPTIONS;
  7730. cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(LIBRARYMANAGEDIALOGOPTIONS)")
  7731. cpp_quote("SHSTDAPI SHShowManageLibraryUI(__in IShellItem *psiLibrary, __in HWND hwndOwner, __in_opt LPCWSTR pszTitle, __in_opt LPCWSTR pszInstruction, __in LIBRARYMANAGEDIALOGOPTIONS lmdOptions);")
  7732. cpp_quote("SHSTDAPI SHResolveLibrary(__in IShellItem *psiLibrary);")
  7733. cpp_quote("#ifdef __cplusplus")
  7734. cpp_quote("")
  7735. cpp_quote("__inline HRESULT SHCreateLibrary(__in REFIID riid, __deref_out void **ppv)")
  7736. cpp_quote("{")
  7737. cpp_quote(" return CoCreateInstance(CLSID_ShellLibrary, NULL, CLSCTX_INPROC_SERVER, riid, ppv);")
  7738. cpp_quote("}")
  7739. cpp_quote("")
  7740. cpp_quote("__inline HRESULT SHLoadLibraryFromItem(__in IShellItem *psiLibrary, __in DWORD grfMode, __in REFIID riid, __deref_out void **ppv)")
  7741. cpp_quote("{")
  7742. cpp_quote(" *ppv = NULL;")
  7743. cpp_quote(" IShellLibrary *plib;")
  7744. cpp_quote(" HRESULT hr = CoCreateInstance(CLSID_ShellLibrary, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&plib));")
  7745. cpp_quote(" if (SUCCEEDED(hr))")
  7746. cpp_quote(" {")
  7747. cpp_quote(" hr = plib->LoadLibraryFromItem(psiLibrary, grfMode);")
  7748. cpp_quote(" if (SUCCEEDED(hr))")
  7749. cpp_quote(" {")
  7750. cpp_quote(" hr = plib->QueryInterface(riid, ppv);")
  7751. cpp_quote(" }")
  7752. cpp_quote(" plib->Release();")
  7753. cpp_quote(" }")
  7754. cpp_quote(" return hr;")
  7755. cpp_quote("}")
  7756. cpp_quote("")
  7757. cpp_quote("__inline HRESULT SHLoadLibraryFromKnownFolder(__in REFKNOWNFOLDERID kfidLibrary, __in DWORD grfMode, __in REFIID riid, __deref_out void **ppv)")
  7758. cpp_quote("{")
  7759. cpp_quote(" *ppv = NULL;")
  7760. cpp_quote(" IShellLibrary *plib;")
  7761. cpp_quote(" HRESULT hr = CoCreateInstance(CLSID_ShellLibrary, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&plib));")
  7762. cpp_quote(" if (SUCCEEDED(hr))")
  7763. cpp_quote(" {")
  7764. cpp_quote(" hr = plib->LoadLibraryFromKnownFolder(kfidLibrary, grfMode);")
  7765. cpp_quote(" if (SUCCEEDED(hr))")
  7766. cpp_quote(" {")
  7767. cpp_quote(" hr = plib->QueryInterface(riid, ppv);")
  7768. cpp_quote(" }")
  7769. cpp_quote(" plib->Release();")
  7770. cpp_quote(" }")
  7771. cpp_quote(" return hr;")
  7772. cpp_quote("}")
  7773. cpp_quote("")
  7774. cpp_quote("__inline HRESULT SHLoadLibraryFromParsingName(__in PCWSTR pszParsingName, __in DWORD grfMode, __in REFIID riid, __deref_out void **ppv)")
  7775. cpp_quote("{")
  7776. cpp_quote(" *ppv = NULL;")
  7777. cpp_quote(" IShellItem *psiLibrary;")
  7778. cpp_quote(" HRESULT hr = SHCreateItemFromParsingName(pszParsingName, NULL, IID_PPV_ARGS(&psiLibrary));")
  7779. cpp_quote(" if (SUCCEEDED(hr))")
  7780. cpp_quote(" {")
  7781. cpp_quote(" hr = SHLoadLibraryFromItem(psiLibrary, grfMode, riid, ppv);")
  7782. cpp_quote(" psiLibrary->Release();")
  7783. cpp_quote(" }")
  7784. cpp_quote(" return hr;")
  7785. cpp_quote("}")
  7786. cpp_quote("")
  7787. cpp_quote("__inline HRESULT SHAddFolderPathToLibrary(__in IShellLibrary *plib, __in PCWSTR pszFolderPath)")
  7788. cpp_quote("{")
  7789. cpp_quote(" IShellItem *psiFolder;")
  7790. cpp_quote(" HRESULT hr = SHCreateItemFromParsingName(pszFolderPath, NULL, IID_PPV_ARGS(&psiFolder));")
  7791. cpp_quote(" if (SUCCEEDED(hr))")
  7792. cpp_quote(" {")
  7793. cpp_quote(" hr = plib->AddFolder(psiFolder);")
  7794. cpp_quote(" psiFolder->Release();")
  7795. cpp_quote(" }")
  7796. cpp_quote(" return hr;")
  7797. cpp_quote("}")
  7798. cpp_quote("")
  7799. cpp_quote("__inline HRESULT SHRemoveFolderPathFromLibrary(__in IShellLibrary *plib, __in PCWSTR pszFolderPath)")
  7800. cpp_quote("{")
  7801. cpp_quote(" PIDLIST_ABSOLUTE pidlFolder = SHSimpleIDListFromPath(pszFolderPath);")
  7802. cpp_quote(" HRESULT hr = pidlFolder ? S_OK : E_INVALIDARG;")
  7803. cpp_quote(" if (SUCCEEDED(hr))")
  7804. cpp_quote(" {")
  7805. cpp_quote(" IShellItem *psiFolder;")
  7806. cpp_quote(" hr = SHCreateItemFromIDList(pidlFolder, IID_PPV_ARGS(&psiFolder));")
  7807. cpp_quote(" if (SUCCEEDED(hr))")
  7808. cpp_quote(" {")
  7809. cpp_quote(" hr = plib->RemoveFolder(psiFolder);")
  7810. cpp_quote(" psiFolder->Release();")
  7811. cpp_quote(" }")
  7812. cpp_quote(" CoTaskMemFree(pidlFolder);")
  7813. cpp_quote(" }")
  7814. cpp_quote(" return hr;")
  7815. cpp_quote("}")
  7816. cpp_quote("")
  7817. cpp_quote("__inline HRESULT SHResolveFolderPathInLibrary(__in IShellLibrary *plib, __in PCWSTR pszFolderPath, __in DWORD dwTimeout, __deref_out PWSTR *ppszResolvedPath)")
  7818. cpp_quote("{")
  7819. cpp_quote(" *ppszResolvedPath = NULL;")
  7820. cpp_quote(" PIDLIST_ABSOLUTE pidlFolder = SHSimpleIDListFromPath(pszFolderPath);")
  7821. cpp_quote(" HRESULT hr = pidlFolder ? S_OK : E_INVALIDARG;")
  7822. cpp_quote(" if (SUCCEEDED(hr))")
  7823. cpp_quote(" {")
  7824. cpp_quote(" IShellItem *psiFolder;")
  7825. cpp_quote(" hr = SHCreateItemFromIDList(pidlFolder, IID_PPV_ARGS(&psiFolder));")
  7826. cpp_quote(" if (SUCCEEDED(hr))")
  7827. cpp_quote(" {")
  7828. cpp_quote(" IShellItem *psiResolved;")
  7829. cpp_quote(" hr = plib->ResolveFolder(psiFolder, dwTimeout, IID_PPV_ARGS(&psiResolved));")
  7830. cpp_quote(" if (SUCCEEDED(hr))")
  7831. cpp_quote(" {")
  7832. cpp_quote(" hr = psiResolved->GetDisplayName(SIGDN_DESKTOPABSOLUTEPARSING, ppszResolvedPath);")
  7833. cpp_quote(" psiResolved->Release();")
  7834. cpp_quote(" }")
  7835. cpp_quote(" psiFolder->Release();")
  7836. cpp_quote(" }")
  7837. cpp_quote(" CoTaskMemFree(pidlFolder);")
  7838. cpp_quote(" }")
  7839. cpp_quote(" return hr;")
  7840. cpp_quote("}")
  7841. cpp_quote("")
  7842. cpp_quote("__inline HRESULT SHSaveLibraryInFolderPath(__in IShellLibrary *plib, __in PCWSTR pszFolderPath, __in PCWSTR pszLibraryName, __in LIBRARYSAVEFLAGS lsf, __deref_opt_out PWSTR *ppszSavedToPath)")
  7843. cpp_quote("{")
  7844. cpp_quote(" if (ppszSavedToPath)")
  7845. cpp_quote(" {")
  7846. cpp_quote(" *ppszSavedToPath = NULL;")
  7847. cpp_quote(" }")
  7848. cpp_quote("")
  7849. cpp_quote(" IShellItem *psiFolder;")
  7850. cpp_quote(" HRESULT hr = SHCreateItemFromParsingName(pszFolderPath, NULL, IID_PPV_ARGS(&psiFolder));")
  7851. cpp_quote(" if (SUCCEEDED(hr))")
  7852. cpp_quote(" {")
  7853. cpp_quote(" IShellItem *psiSavedTo;")
  7854. cpp_quote(" hr = plib->Save(psiFolder, pszLibraryName, lsf, &psiSavedTo);")
  7855. cpp_quote(" if (SUCCEEDED(hr))")
  7856. cpp_quote(" {")
  7857. cpp_quote(" if (ppszSavedToPath)")
  7858. cpp_quote(" {")
  7859. cpp_quote(" hr = psiSavedTo->GetDisplayName(SIGDN_DESKTOPABSOLUTEPARSING, ppszSavedToPath);")
  7860. cpp_quote(" }")
  7861. cpp_quote(" psiSavedTo->Release();")
  7862. cpp_quote(" }")
  7863. cpp_quote(" psiFolder->Release();")
  7864. cpp_quote(" }")
  7865. cpp_quote(" return hr;")
  7866. cpp_quote("}")
  7867. cpp_quote("#endif // __cplusplus")
  7868. cpp_quote("#endif // _WIN32_IE >= _WIN32_IE_IE70")
  7869. cpp_quote("#endif // NTDDI_WIN7")
  7870. cpp_quote("#if (NTDDI_VERSION >= NTDDI_VISTA)")
  7871. //
  7872. // SHAssocEnumHandlers returns an IEnumAssocHandlers object.
  7873. //
  7874. // Invoke an associated app handler
  7875. [
  7876. uuid(92218CAB-ECAA-4335-8133-807FD234C2EE),
  7877. object,
  7878. pointer_default(unique),
  7879. local
  7880. ]
  7881. interface IAssocHandlerInvoker : IUnknown
  7882. {
  7883. // Returns S_OK if selection is supported, S_FALSE if not.
  7884. HRESULT SupportsSelection();
  7885. HRESULT Invoke();
  7886. };
  7887. // Enumerate handlers
  7888. [
  7889. uuid(F04061AC-1659-4a3f-A954-775AA57FC083),
  7890. object,
  7891. pointer_default(unique),
  7892. local
  7893. ]
  7894. interface IAssocHandler : IUnknown
  7895. {
  7896. HRESULT GetName([string, out, annotation("__deref_out")] LPWSTR *ppsz);
  7897. HRESULT GetUIName([string, out, annotation("__deref_out")] LPWSTR *ppsz);
  7898. HRESULT GetIconLocation(
  7899. [string, out, annotation("__deref_out")] LPWSTR *ppszPath,
  7900. [out, annotation("__out")] int *pIndex);
  7901. HRESULT IsRecommended();
  7902. HRESULT MakeDefault([in, string, annotation("__in")] LPCWSTR pszDescription);
  7903. HRESULT Invoke([in, annotation("__in")] IDataObject *pdo);
  7904. HRESULT CreateInvoker(
  7905. [in, annotation("__in")] IDataObject *pdo,
  7906. [out, annotation("__deref_out")] IAssocHandlerInvoker **ppInvoker);
  7907. };
  7908. // Enumerate handlers
  7909. [
  7910. uuid(973810ae-9599-4b88-9e4d-6ee98c9552da),
  7911. object,
  7912. pointer_default(unique),
  7913. local
  7914. ]
  7915. interface IEnumAssocHandlers : IUnknown
  7916. {
  7917. HRESULT Next(
  7918. [in, annotation("__in")] ULONG celt,
  7919. [out, size_is(celt), length_is(*pceltFetched), annotation("__out_ecount_part(celt, *pceltFetched)")] IAssocHandler **rgelt,
  7920. [out, annotation("__out_range(0,celt) __exceptthat __maybenull")] ULONG *pceltFetched);
  7921. };
  7922. enum _ASSOC_FILTER
  7923. {
  7924. ASSOC_FILTER_NONE = 0x0,
  7925. ASSOC_FILTER_RECOMMENDED = 0x1,
  7926. };
  7927. typedef int ASSOC_FILTER;
  7928. cpp_quote("SHSTDAPI SHAssocEnumHandlers(__in LPCWSTR pszExtra, __in ASSOC_FILTER afFilter, __deref_out IEnumAssocHandlers **ppEnumHandler);")
  7929. cpp_quote("#endif // NTDDI_VISTA")
  7930. cpp_quote("#if (NTDDI_VERSION >= NTDDI_WIN7)")
  7931. cpp_quote("SHSTDAPI SHAssocEnumHandlersForProtocolByApplication(__in PCWSTR protocol, __in REFIID riid, __deref_out void **enumHandlers);")
  7932. cpp_quote("#endif // NTDDI_WIN7")