Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11926 lines
498 KiB

  1. //===========================================================================
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // File: shlobj.h
  6. //
  7. //===========================================================================
  8. ;begin_internal
  9. //***************************************************************************
  10. // --- SHELLAPI.W SHSEMIP.H SHLOBJ.W SHOBJIDL.IDL SHLDISP.IDL SHPRIV.IDL ---
  11. // Which header is best for my new API?
  12. //
  13. // SHLOBJ - *AVOID NEW USAGE*, PREFER OTHER HEADERS
  14. // used primarily for legacy compatibility
  15. //
  16. // SHELLAPI - ALL NEW SHELL32 EXPORTS public and private
  17. // used for both public and private exports from shell32
  18. //
  19. // SHSEMIP - *AVOID _ALL_ USAGE*, NO EXPORTS, SUPER PRIVATE
  20. // used for very private shell defines.
  21. //
  22. // SHOBJIDL - ALL NEW SHELL PUBLIC INTERFACES
  23. // primary file for public shell (shell32+) interfaces
  24. //
  25. // SHLDISP - ALL NEW SHELL AUTOMATION INTERFACES
  26. // automation interfaces are always public
  27. //
  28. // SHPRIV - ALL NEW SHELL PRIVATE INTERFACES
  29. // private interfaces used anywhere in the shell
  30. //
  31. //
  32. // SHLOBJ was originally the file that defined all of shell32's interfaces.
  33. // it devolved into a dumping ground of public and private APIs and
  34. // interfaces. in the effort to better support COM and better API management
  35. // we are attempting to avoid using shlobj
  36. //***************************************************************************
  37. ;end_internal
  38. #ifndef _SHLOBJ_H_
  39. #define _SHLOBJ_H_
  40. #ifndef _SHLOBJP_H_ ;Internal
  41. #define _SHLOBJP_H_ ;Internal
  42. #ifndef _WINRESRC_
  43. #ifndef _WIN32_IE
  44. #define _WIN32_IE 0x0501
  45. #else
  46. #if (_WIN32_IE < 0x0400) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
  47. #error _WIN32_IE setting conflicts with _WIN32_WINNT setting
  48. #endif
  49. #endif
  50. #endif
  51. #ifndef SNDMSG
  52. #ifdef __cplusplus
  53. #define SNDMSG ::SendMessage
  54. #else
  55. #define SNDMSG SendMessage
  56. #endif
  57. #endif // ifndef SNDMSG
  58. //
  59. // Define API decoration for direct importing of DLL references.
  60. //
  61. #ifndef WINSHELLAPI
  62. #if defined(_SHELL32_)
  63. #define WINSHELLAPI
  64. #else
  65. #define WINSHELLAPI DECLSPEC_IMPORT
  66. #endif
  67. #endif // WINSHELLAPI
  68. #ifndef SHSTDAPI
  69. #if defined(_SHELL32_)
  70. #define SHSTDAPI STDAPI
  71. #define SHSTDAPI_(type) STDAPI_(type)
  72. #else
  73. #define SHSTDAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  74. #define SHSTDAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  75. #endif
  76. #endif // SHSTDAPI
  77. #ifndef SHDOCAPI
  78. #if defined(_SHDOCVW_)
  79. #define SHDOCAPI STDAPI
  80. #define SHDOCAPI_(type) STDAPI_(type)
  81. #else
  82. #define SHDOCAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  83. #define SHDOCAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  84. #endif
  85. #endif // SHDOCAPI
  86. // shell32 APIs that are also exported from shdocvw
  87. #ifndef SHSTDDOCAPI
  88. #if defined(_SHDOCVW_) || defined(_SHELL32_)
  89. #define SHSTDDOCAPI STDAPI
  90. #define SHSTDDOCAPI_(type) STDAPI_(type)
  91. #else
  92. #define SHSTDDOCAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  93. #define SHSTDDOCAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  94. #endif
  95. #endif // SHSTDDOCAPI
  96. #ifndef BROWSEUIAPI
  97. #if defined(_BROWSEUI_)
  98. #define BROWSEUIAPI STDAPI
  99. #define BROWSEUIAPI_(type) STDAPI_(type)
  100. #else
  101. #define BROWSEUIAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  102. #define BROWSEUIAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  103. #endif // defined(_BROWSEUI_)
  104. #endif // BROWSEUIAPI
  105. // shell32 APIs that are also exported from shfolder
  106. #ifndef SHFOLDERAPI
  107. #if defined(_SHFOLDER_) || defined(_SHELL32_)
  108. #define SHFOLDERAPI STDAPI
  109. #else
  110. #define SHFOLDERAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  111. #endif
  112. #endif
  113. #define NO_MONIKER ;Internal
  114. #include <ole2.h>
  115. #ifndef _PRSHT_H_
  116. #include <prsht.h>
  117. #endif
  118. #ifndef _INC_COMMCTRL
  119. #include <commctrl.h> // for LPTBBUTTON
  120. #endif
  121. #ifndef INITGUID
  122. #include <shlguid.h>
  123. #endif /* !INITGUID */
  124. #include <docobj.h> ;Internal
  125. #include <shldisp.h> ;Internal
  126. ;begin_both
  127. #include <pshpack1.h> /* Assume byte packing throughout */
  128. #ifdef __cplusplus
  129. extern "C" { /* Assume C declarations for C++ */
  130. #endif /* __cplusplus */
  131. #include <shtypes.h>
  132. ;end_both
  133. #include <shobjidl.h>
  134. #include <shpriv.h> ;Internal
  135. #include <iepriv.h> ;Internal
  136. ;begin_internal
  137. // HMONITOR is already declared in NT 5's windef.h.
  138. #if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500)
  139. DECLARE_HANDLE(HMONITOR);
  140. #define HMONITOR_DECLARED
  141. #endif
  142. #include <tlog.h>
  143. ;end_internal
  144. //===========================================================================
  145. //
  146. // Task allocator API
  147. //
  148. // All the shell extensions MUST use the task allocator (see OLE 2.0
  149. // programming guild for its definition) when they allocate or free
  150. // memory objects (mostly ITEMIDLIST) that are returned across any
  151. // shell interfaces. There are two ways to access the task allocator
  152. // from a shell extension depending on whether or not it is linked with
  153. // OLE32.DLL or not (purely for efficiency).
  154. //
  155. // (1) A shell extension which calls any OLE API (i.e., linked with
  156. // OLE32.DLL) should call OLE's task allocator (by retrieving
  157. // the task allocator by calling CoGetMalloc API).
  158. //
  159. // (2) A shell extension which does not call any OLE API (i.e., not linked
  160. // with OLE32.DLL) should call the shell task allocator API (defined
  161. // below), so that the shell can quickly loads it when OLE32.DLL is not
  162. // loaded by any application at that point.
  163. //
  164. // Notes:
  165. // In next version of Windowso release, SHGetMalloc will be replaced by
  166. // the following macro.
  167. //
  168. // #define SHGetMalloc(ppmem) CoGetMalloc(MEMCTX_TASK, ppmem)
  169. //
  170. //===========================================================================
  171. SHSTDAPI SHGetMalloc(LPMALLOC * ppMalloc);
  172. ;begin_internal
  173. // DOC'ed for DOJ compliance
  174. ;end_internal
  175. SHSTDAPI_(void *) SHAlloc(SIZE_T cb);
  176. SHSTDAPI_(void *) SHRealloc(void * pv, SIZE_T cbNew); ;Internal
  177. SHSTDAPI_(SIZE_T) SHGetSize(void * pv); ;Internal
  178. ;begin_internal
  179. // DOC'ed for DOJ compliance
  180. ;end_internal
  181. SHSTDAPI_(void) SHFree(void * pv);
  182. //===========================================================================
  183. //
  184. // IContextMenu interface
  185. //
  186. // [OverView]
  187. //
  188. // The shell uses the IContextMenu interface in following three cases.
  189. //
  190. // case-1: The shell is loading context menu extensions.
  191. //
  192. // When the user clicks the right mouse button on an item within the shell's
  193. // name space (i.g., file, directory, server, work-group, etc.), it creates
  194. // the default context menu for its type, then loads context menu extensions
  195. // that are registered for that type (and its base type) so that they can
  196. // add extra menu items. Those context menu extensions are registered at
  197. // HKCR\{ProgID}\shellex\ContextMenuHandlers.
  198. //
  199. // case-2: The shell is retrieving a context menu of sub-folders in extended
  200. // name-space.
  201. //
  202. // When the explorer's name space is extended by name space extensions,
  203. // the shell calls their IShellFolder::GetUIObjectOf to get the IContextMenu
  204. // objects when it creates context menus for folders under those extended
  205. // name spaces.
  206. //
  207. // case-3: The shell is loading non-default drag and drop handler for directories.
  208. //
  209. // When the user performed a non-default drag and drop onto one of file
  210. // system folders (i.e., directories), it loads shell extensions that are
  211. // registered at HKCR\{ProgID}\DragDropHandlers.
  212. //
  213. //
  214. // [Member functions]
  215. //
  216. //
  217. // IContextMenu::QueryContextMenu
  218. //
  219. // This member function may insert one or more menuitems to the specified
  220. // menu (hmenu) at the specified location (indexMenu which is never be -1).
  221. // The IDs of those menuitem must be in the specified range (idCmdFirst and
  222. // idCmdLast). It returns the maximum menuitem ID offset (ushort) in the
  223. // 'code' field (low word) of the scode.
  224. //
  225. // The uFlags specify the context. It may have one or more of following
  226. // flags.
  227. //
  228. // CMF_DEFAULTONLY: This flag is passed if the user is invoking the default
  229. // action (typically by double-clicking, case 1 and 2 only). Context menu
  230. // extensions (case 1) should not add any menu items, and returns NOERROR.
  231. //
  232. // CMF_VERBSONLY: The explorer passes this flag if it is constructing
  233. // a context menu for a short-cut object (case 1 and case 2 only). If this
  234. // flag is passed, it should not add any menu-items that is not appropriate
  235. // from a short-cut.
  236. // A good example is the "Delete" menuitem, which confuses the user
  237. // because it is not clear whether it deletes the link source item or the
  238. // link itself.
  239. //
  240. // CMF_EXPLORER: The explorer passes this flag if it has the left-side pane
  241. // (case 1 and 2 only). Context menu extensions should ignore this flag.
  242. //
  243. // High word (16-bit) are reserved for context specific communications
  244. // and the rest of flags (13-bit) are reserved by the system.
  245. //
  246. //
  247. // IContextMenu::InvokeCommand
  248. //
  249. // This member is called when the user has selected one of menuitems that
  250. // are inserted by previous QueryContextMenu member. In this case, the
  251. // LOWORD(lpici->lpVerb) contains the menuitem ID offset (menuitem ID -
  252. // idCmdFirst).
  253. //
  254. // This member function may also be called programmatically. In such a case,
  255. // lpici->lpVerb specifies the canonical name of the command to be invoked,
  256. // which is typically retrieved by GetCommandString member previously.
  257. //
  258. // Parameters in lpci:
  259. // cbSize -- Specifies the size of this structure (sizeof(*lpci))
  260. // hwnd -- Specifies the owner window for any message/dialog box.
  261. // fMask -- Specifies whether or not dwHotkey/hIcon paramter is valid.
  262. // lpVerb -- Specifies the command to be invoked.
  263. // lpParameters -- Parameters (optional)
  264. // lpDirectory -- Working directory (optional)
  265. // nShow -- Specifies the flag to be passed to ShowWindow (SW_*).
  266. // dwHotKey -- Hot key to be assigned to the app after invoked (optional).
  267. // hIcon -- Specifies the icon (optional).
  268. // hMonitor -- Specifies the default monitor (optional).
  269. //
  270. //
  271. // IContextMenu::GetCommandString
  272. //
  273. // This member function is called by the explorer either to get the
  274. // canonical (language independent) command name (uFlags == GCS_VERB) or
  275. // the help text ((uFlags & GCS_HELPTEXT) != 0) for the specified command.
  276. // The retrieved canonical string may be passed to its InvokeCommand
  277. // member function to invoke a command programmatically. The explorer
  278. // displays the help texts in its status bar; therefore, the length of
  279. // the help text should be reasonably short (<40 characters).
  280. //
  281. // Parameters:
  282. // idCmd -- Specifies menuitem ID offset (from idCmdFirst)
  283. // uFlags -- Either GCS_VERB or GCS_HELPTEXT
  284. // pwReserved -- Reserved (must pass NULL when calling, must ignore when called)
  285. // pszName -- Specifies the string buffer.
  286. // cchMax -- Specifies the size of the string buffer.
  287. //
  288. //===========================================================================
  289. // QueryContextMenu uFlags
  290. #define CMF_NORMAL 0x00000000
  291. #define CMF_DEFAULTONLY 0x00000001
  292. #define CMF_VERBSONLY 0x00000002
  293. #define CMF_EXPLORE 0x00000004
  294. #define CMF_NOVERBS 0x00000008
  295. #define CMF_CANRENAME 0x00000010
  296. #define CMF_NODEFAULT 0x00000020
  297. #define CMF_INCLUDESTATIC 0x00000040
  298. #define CMF_FINDHACK 0x00000080 // This is a hack - we should remove this bit ;Internal
  299. #define CMF_EXTENDEDVERBS 0x00000100 // rarely used verbs
  300. #define CMF_RESERVED 0xffff0000 // View specific
  301. ;begin_internal
  302. //
  303. // Private QueryContextMenuFlag passed from DefView
  304. //
  305. #define CMF_DVFILE 0x00010000 // "File" pulldown
  306. #define CMF_ICM3 0x00020000 // QueryContextMenu can assume IContextMenu3 semantics (i.e.,
  307. // will receive WM_INITMENUPOPUP, WM_MEASUREITEM, WM_DRAWITEM,
  308. // and WM_MENUCHAR, via HandleMenuMsg2)
  309. ;end_internal
  310. // GetCommandString uFlags
  311. #define GCS_VERBA 0x00000000 // canonical verb
  312. #define GCS_HELPTEXTA 0x00000001 // help text (for status bar)
  313. #define GCS_VALIDATEA 0x00000002 // validate command exists
  314. #define GCS_VERBW 0x00000004 // canonical verb (unicode)
  315. #define GCS_HELPTEXTW 0x00000005 // help text (unicode version)
  316. #define GCS_VALIDATEW 0x00000006 // validate command exists (unicode)
  317. #define GCS_UNICODE 0x00000004 // for bit testing - Unicode string
  318. #ifdef UNICODE
  319. #define GCS_VERB GCS_VERBW
  320. #define GCS_HELPTEXT GCS_HELPTEXTW
  321. #define GCS_VALIDATE GCS_VALIDATEW
  322. #else
  323. #define GCS_VERB GCS_VERBA
  324. #define GCS_HELPTEXT GCS_HELPTEXTA
  325. #define GCS_VALIDATE GCS_VALIDATEA
  326. #endif
  327. #define CMDSTR_NEWFOLDERA "NewFolder"
  328. #define CMDSTR_VIEWLISTA "ViewList"
  329. #define CMDSTR_VIEWDETAILSA "ViewDetails"
  330. #define CMDSTR_NEWFOLDERW L"NewFolder"
  331. #define CMDSTR_VIEWLISTW L"ViewList"
  332. #define CMDSTR_VIEWDETAILSW L"ViewDetails"
  333. #ifdef UNICODE
  334. #define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERW
  335. #define CMDSTR_VIEWLIST CMDSTR_VIEWLISTW
  336. #define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSW
  337. #else
  338. #define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERA
  339. #define CMDSTR_VIEWLIST CMDSTR_VIEWLISTA
  340. #define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSA
  341. #endif
  342. #define CMIC_MASK_HOTKEY SEE_MASK_HOTKEY
  343. #define CMIC_MASK_ICON SEE_MASK_ICON
  344. #define CMIC_MASK_FLAG_NO_UI SEE_MASK_FLAG_NO_UI
  345. #define CMIC_MASK_UNICODE SEE_MASK_UNICODE
  346. #define CMIC_MASK_NO_CONSOLE SEE_MASK_NO_CONSOLE
  347. #define CMIC_MASK_HASLINKNAME SEE_MASK_HASLINKNAME
  348. #define CMIC_MASK_FLAG_SEP_VDM SEE_MASK_FLAG_SEPVDM
  349. #define CMIC_MASK_HASTITLE SEE_MASK_HASTITLE
  350. #define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK
  351. #if (_WIN32_IE >= 0x0501)
  352. #define CMIC_MASK_SHIFT_DOWN 0x10000000
  353. #define CMIC_MASK_CONTROL_DOWN 0x40000000
  354. #endif // (_WIN32_IE >= 0x501)
  355. #if (_WIN32_IE >= 0x0560)
  356. #define CMIC_MASK_FLAG_LOG_USAGE SEE_MASK_FLAG_LOG_USAGE
  357. #define CMIC_MASK_NOZONECHECKS SEE_MASK_NOZONECHECKS
  358. #endif // (_WIN32_IE >= 0x560)
  359. #if (_WIN32_IE >= 0x0400)
  360. #define CMIC_MASK_PTINVOKE 0x20000000
  361. #define CMICEXSIZE_NT4 (SIZEOF(CMINVOKECOMMANDINFOEX) - SIZEOF(POINT)) ;Internal
  362. #endif
  363. #define CMIC_MASK_NO_HOOKS SEE_MASK_NO_HOOKS ;internal_win40
  364. #define CMIC_MASK_DATAOBJECT 0x40000000 // lpPara is IDataObject* ;Internal
  365. #define CMIC_MASK_MODAL 0x80000000 ;Internal
  366. #define CMIC_VALID_SEE_FLAGS SEE_VALID_CMIC_FLAGS ;Internal
  367. #include <pshpack8.h>
  368. //NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor
  369. typedef struct _CMINVOKECOMMANDINFO {
  370. DWORD cbSize; // sizeof(CMINVOKECOMMANDINFO)
  371. DWORD fMask; // any combination of CMIC_MASK_*
  372. HWND hwnd; // might be NULL (indicating no owner window)
  373. LPCSTR lpVerb; // either a string or MAKEINTRESOURCE(idOffset)
  374. LPCSTR lpParameters; // might be NULL (indicating no parameter)
  375. LPCSTR lpDirectory; // might be NULL (indicating no specific directory)
  376. int nShow; // one of SW_ values for ShowWindow() API
  377. DWORD dwHotKey;
  378. HANDLE hIcon;
  379. } CMINVOKECOMMANDINFO, *LPCMINVOKECOMMANDINFO;
  380. typedef struct _CMInvokeCommandInfoEx {
  381. DWORD cbSize; // must be sizeof(CMINVOKECOMMANDINFOEX)
  382. DWORD fMask; // any combination of CMIC_MASK_*
  383. HWND hwnd; // might be NULL (indicating no owner window)
  384. LPCSTR lpVerb; // either a string or MAKEINTRESOURCE(idOffset)
  385. LPCSTR lpParameters; // might be NULL (indicating no parameter)
  386. LPCSTR lpDirectory; // might be NULL (indicating no specific directory)
  387. int nShow; // one of SW_ values for ShowWindow() API
  388. DWORD dwHotKey;
  389. HANDLE hIcon;
  390. LPCSTR lpTitle; // For CreateProcess-StartupInfo.lpTitle
  391. LPCWSTR lpVerbW; // Unicode verb (for those who can use it)
  392. LPCWSTR lpParametersW; // Unicode parameters (for those who can use it)
  393. LPCWSTR lpDirectoryW; // Unicode directory (for those who can use it)
  394. LPCWSTR lpTitleW; // Unicode title (for those who can use it)
  395. #if (_WIN32_IE >= 0x0400)
  396. POINT ptInvoke; // Point where it's invoked
  397. #endif
  398. } CMINVOKECOMMANDINFOEX, *LPCMINVOKECOMMANDINFOEX;
  399. #include <poppack.h> /* Return to byte packing */
  400. ;begin_internal
  401. #include <pshpack8.h>
  402. // the struct below is used for cross-process passing of CMINVOKECOMMANDINFOEX structs
  403. // we store offsets for the strings into ourself and we are win64 safe
  404. typedef struct {
  405. DWORD cbSize; // size of the struct
  406. DWORD fMask; // any combination of CMIC_MASK_*
  407. DWORD dwHwnd; // might be NULL (indicating no owner window)
  408. int nShow; // one of SW_ values for ShowWindow() API
  409. DWORD dwHotKey;
  410. POINT ptInvoke; // Point where it's invoked
  411. DWORD dwVerbW; // offset from struct to lpVerbW
  412. DWORD dwParametersW; // offset from struct to lpParametersW - might be NULL (indicating no parameter)
  413. DWORD dwDirectoryW; // offset from struct to lpDirectoryW - might be NULL (indicating no specific directory)
  414. DWORD dwTitleW; // offset from struct to lpTitleW - might be NULL (indicating no title)
  415. }ICIX_PERSIST;
  416. #include <poppack.h>
  417. ;end_internal
  418. #undef INTERFACE
  419. #define INTERFACE IContextMenu
  420. DECLARE_INTERFACE_(IContextMenu, IUnknown)
  421. {
  422. // *** IUnknown methods ***
  423. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  424. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  425. STDMETHOD_(ULONG,Release) (THIS) PURE;
  426. STDMETHOD(QueryContextMenu)(THIS_
  427. HMENU hmenu,
  428. UINT indexMenu,
  429. UINT idCmdFirst,
  430. UINT idCmdLast,
  431. UINT uFlags) PURE;
  432. STDMETHOD(InvokeCommand)(THIS_
  433. LPCMINVOKECOMMANDINFO lpici) PURE;
  434. STDMETHOD(GetCommandString)(THIS_
  435. UINT_PTR idCmd,
  436. UINT uType,
  437. UINT * pwReserved,
  438. LPSTR pszName,
  439. UINT cchMax) PURE;
  440. };
  441. typedef IContextMenu * LPCONTEXTMENU;
  442. #define CONTEXTMENU_IDCMD_FIRST 1 // minimal QueryContextMenu idCmdFirst value // ;internal
  443. #define CONTEXTMENU_IDCMD_LAST 0x7fff // maximal QueryContextMenu idCmdLast value // ;internal
  444. //
  445. // IContextMenu2 (IContextMenu with one new member)
  446. //
  447. // IContextMenu2::HandleMenuMsg
  448. //
  449. // This function is called, if the client of IContextMenu is aware of
  450. // IContextMenu2 interface and receives one of following messages while
  451. // it is calling TrackPopupMenu (in the window proc of hwnd):
  452. // WM_INITPOPUP, WM_DRAWITEM and WM_MEASUREITEM
  453. // The callee may handle these messages to draw owner draw menuitems.
  454. //
  455. #undef INTERFACE
  456. #define INTERFACE IContextMenu2
  457. DECLARE_INTERFACE_(IContextMenu2, IContextMenu)
  458. {
  459. // *** IUnknown methods ***
  460. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  461. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  462. STDMETHOD_(ULONG,Release) (THIS) PURE;
  463. // *** IContextMenu methods ***
  464. STDMETHOD(QueryContextMenu)(THIS_
  465. HMENU hmenu,
  466. UINT indexMenu,
  467. UINT idCmdFirst,
  468. UINT idCmdLast,
  469. UINT uFlags) PURE;
  470. STDMETHOD(InvokeCommand)(THIS_
  471. LPCMINVOKECOMMANDINFO lpici) PURE;
  472. STDMETHOD(GetCommandString)(THIS_
  473. UINT_PTR idCmd,
  474. UINT uType,
  475. UINT * pwReserved,
  476. LPSTR pszName,
  477. UINT cchMax) PURE;
  478. // *** IContextMenu2 methods ***
  479. STDMETHOD(HandleMenuMsg)(THIS_
  480. UINT uMsg,
  481. WPARAM wParam,
  482. LPARAM lParam) PURE;
  483. };
  484. typedef IContextMenu2 * LPCONTEXTMENU2;
  485. //
  486. // IContextMenu3 (IContextMenu with one new member)
  487. //
  488. // IContextMenu3::HandleMenuMsg2
  489. //
  490. // This function is called, if the client of IContextMenu is aware of
  491. // IContextMenu3 interface and receives a menu message while
  492. // it is calling TrackPopupMenu (in the window proc of hwnd):
  493. //
  494. #undef INTERFACE
  495. #define INTERFACE IContextMenu3
  496. DECLARE_INTERFACE_(IContextMenu3, IContextMenu2)
  497. {
  498. // *** IUnknown methods ***
  499. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  500. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  501. STDMETHOD_(ULONG,Release) (THIS) PURE;
  502. // *** IContextMenu methods ***
  503. STDMETHOD(QueryContextMenu)(THIS_
  504. HMENU hmenu,
  505. UINT indexMenu,
  506. UINT idCmdFirst,
  507. UINT idCmdLast,
  508. UINT uFlags) PURE;
  509. STDMETHOD(InvokeCommand)(THIS_
  510. LPCMINVOKECOMMANDINFO lpici) PURE;
  511. STDMETHOD(GetCommandString)(THIS_
  512. UINT_PTR idCmd,
  513. UINT uType,
  514. UINT * pwReserved,
  515. LPSTR pszName,
  516. UINT cchMax) PURE;
  517. // *** IContextMenu2 methods ***
  518. STDMETHOD(HandleMenuMsg)(THIS_
  519. UINT uMsg,
  520. WPARAM wParam,
  521. LPARAM lParam) PURE;
  522. // *** IContextMenu3 methods ***
  523. STDMETHOD(HandleMenuMsg2)(THIS_
  524. UINT uMsg,
  525. WPARAM wParam,
  526. LPARAM lParam,
  527. LRESULT* plResult) PURE;
  528. };
  529. typedef IContextMenu3 * LPCONTEXTMENU3;
  530. //---------------------------------------------------------------------------- ;Internal
  531. // Internal helper macro ;Internal
  532. //---------------------------------------------------------------------------- ;Internal
  533. ;Internal
  534. #define _IOffset(class, itf) ((UINT_PTR)&(((class *)0)->itf)) ;Internal
  535. #define IToClass(class, itf, pitf) ((class *)(((LPSTR)pitf)-_IOffset(class, itf))) ;Internal
  536. #define IToClassN(class, itf, pitf) IToClass(class, itf, pitf) ;Internal
  537. ;Internal
  538. // ;Internal
  539. // Helper macro definitions ;Internal
  540. // ;Internal
  541. #define S_BOOL(f) MAKE_SCODE(SEVERITY_SUCCESS, 0, f) ;Internal
  542. ;Internal
  543. #ifdef DEBUG ;Internal
  544. #define ReleaseAndAssert(punk) Assert(punk->lpVtbl->Release(punk)==0) ;Internal
  545. #else ;Internal
  546. #define ReleaseAndAssert(punk) (punk->lpVtbl->Release(punk)) ;Internal
  547. #endif ;Internal
  548. #if (_WIN32_IE >= 0x0500)
  549. #undef INTERFACE
  550. #define INTERFACE IPersistFolder3
  551. #define CSIDL_FLAG_PFTI_TRACKTARGET CSIDL_FLAG_DONT_VERIFY
  552. // DESCRIPTION: PERSIST_FOLDER_TARGET_INFO
  553. // This stucture is used for Folder Shortcuts which allow the shell to
  554. // have a file system folder act like another area in the name space.
  555. // One of pidlTargetFolder, szTargetParsingName, or csidl needs to
  556. // specify the destination name space.
  557. //
  558. // pidlTargetFolder: This is a full pidl to the target folder. Can be NULL in the IPersistFolder3::InitializeEx()
  559. // call but not in the GetFolderTargetInfo() return structure.
  560. // szTargetParsingName: Empty string if not specified. Ortherwise, it is the parsible name
  561. // to the target. This name can be parsed by IShellFolder::
  562. // ParsedName() from the desktop.
  563. // szNetworkProvider: Can be an empty string. If not empty, it specifies the type of network
  564. // provider that will be used when binding to the target. This is used
  565. // for performance optimizations for the WNet APIs.
  566. // dwAttributes: -1 if not known. These are the SFGAO_ flags for IShellFolder::GetAttributesOf()
  567. // csidl: This is -1 if it's not used. This can be used instead of pidlTargetFolder or
  568. // szTargetParsingName to indicate the TargetFolder. See the list of CSIDL_ folders
  569. // below. CSIDL_FLAG_PFTI_TRACKTARGET means that the IShellFolder's target folder
  570. // should change if the user changes the target of the underlying CSIDL value.
  571. // You can also pass CSIDL_FLAG_CREATE to indicate that the target folder
  572. // should be created if it does not exist. No other CSIDL_FLAG_* values are supported.
  573. #include <pshpack8.h>
  574. typedef struct
  575. {
  576. LPITEMIDLIST pidlTargetFolder; // pidl for the folder we want to intiailize
  577. WCHAR szTargetParsingName[MAX_PATH]; // optional parsing name for the target
  578. WCHAR szNetworkProvider[MAX_PATH]; // optional network provider
  579. DWORD dwAttributes; // optional FILE_ATTRIBUTES_ flags (-1 if not used)
  580. int csidl; // optional folder index (SHGetFolderPath()) -1 if not used
  581. } PERSIST_FOLDER_TARGET_INFO;
  582. #include <poppack.h> /* Return to byte packing */
  583. // DESCRIPTION: IPersistFolder3
  584. // This interface is implemented by an IShellFolder object that wants non-default
  585. // handling of Folder Shortcuts. In general, shell name space extensions should use
  586. // pidlRoot (the alias pidl) as their location in the name space and pass it to public
  587. // APIs, such as ShellExecute(). The one exception is that pidlTarget should be used
  588. // when sending ChangeNotifies or registering to listen for change notifies
  589. // (see SFVM_GETNOTIFY).
  590. //
  591. // InitializeEx: This method initializes an IShellFolder and specifies where
  592. // it is rooted in the name space.
  593. // pbc: May be NULL.
  594. // pidlRoot: This is the same parameter as IPersistFolder::Initialize(). Caller allocates
  595. // and frees this parameter.
  596. // ppfti: May be NULL, in which case this is the same as a call to IPersistFolder::Initialize().
  597. // Otherwise this is a Folder Shortcut and this structure specifies the target
  598. // folder and it's attributes.
  599. // GetFolderTargetInfo: This is used by the caller to find information about
  600. // the folder shortcut. This structure may not be initialized by the caller,
  601. // so the callee needs to initialize every member. The callee allocates
  602. // pidlTargetFolder and the caller will free it. Filling in pidlTargetFolder is
  603. // ALWAYS required.
  604. DECLARE_INTERFACE_(IPersistFolder3, IPersistFolder2)
  605. {
  606. // *** IUnknown methods ***
  607. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  608. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  609. STDMETHOD_(ULONG,Release)(THIS) PURE;
  610. // *** IPersist methods ***
  611. STDMETHOD(GetClassID)(THIS_ LPCLSID lpClassID) PURE;
  612. // *** IPersistFolder methods ***
  613. STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidl) PURE;
  614. // *** IPersistFolder2 methods ***
  615. STDMETHOD(GetCurFolder)(THIS_ LPITEMIDLIST *ppidl) PURE;
  616. // *** IPersistFolder3 methods ***
  617. STDMETHOD(InitializeEx)(THIS_ IBindCtx *pbc, LPCITEMIDLIST pidlRoot, const PERSIST_FOLDER_TARGET_INFO *ppfti) PURE;
  618. STDMETHOD(GetFolderTargetInfo)(THIS_ PERSIST_FOLDER_TARGET_INFO *ppfti) PURE;
  619. };
  620. ;begin_internal
  621. //
  622. // this interface is just the IID. return back
  623. // a pointer to the IPersist interface if the object
  624. // implementation is free threaded. this is used
  625. // for performance on free threaded objects.
  626. //
  627. #define IPersistFreeThreadedObject IPersist
  628. ;end_internal
  629. #endif
  630. //
  631. // this interface is just the IID. return back ;Internal
  632. // a pointer to the IDropTarget interface if the ;Internal
  633. // object calls DAD_DragLeave/DAD_SetDragImage ;Internal
  634. // in its IDropTarget::Drop(). ;Internal
  635. // ;Internal
  636. #define IDropTargetWithDADSupport IDropTarget ;Internal
  637. //===========================================================================
  638. //
  639. // IExtractIcon interface
  640. //
  641. // This interface is used in two different places in the shell.
  642. //
  643. // Case-1: Icons of sub-folders for the scope-pane of the explorer.
  644. //
  645. // It is used by the explorer to get the "icon location" of
  646. // sub-folders from each shell folders. When the user expands a folder
  647. // in the scope pane of the explorer, the explorer does following:
  648. // (1) binds to the folder (gets IShellFolder),
  649. // (2) enumerates its sub-folders by calling its EnumObjects member,
  650. // (3) calls its GetUIObjectOf member to get IExtractIcon interface
  651. // for each sub-folders.
  652. // In this case, the explorer uses only IExtractIcon::GetIconLocation
  653. // member to get the location of the appropriate icon. An icon location
  654. // always consists of a file name (typically DLL or EXE) and either an icon
  655. // resource or an icon index.
  656. //
  657. //
  658. // Case-2: Extracting an icon image from a file
  659. //
  660. // It is used by the shell when it extracts an icon image
  661. // from a file. When the shell is extracting an icon from a file,
  662. // it does following:
  663. // (1) creates the icon extraction handler object (by getting its CLSID
  664. // under the {ProgID}\shell\ExtractIconHanler key and calling
  665. // CoCreateInstance requesting for IExtractIcon interface).
  666. // (2) Calls IExtractIcon::GetIconLocation.
  667. // (3) Then, calls IExtractIcon::ExtractIcon with the location/index pair.
  668. // (4) If (3) returns NOERROR, it uses the returned icon.
  669. // (5) Otherwise, it recursively calls this logic with new location
  670. // assuming that the location string contains a fully qualified path name.
  671. //
  672. // From extension programmer's point of view, there are only two cases
  673. // where they provide implementations of IExtractIcon:
  674. // Case-1) providing explorer extensions (i.e., IShellFolder).
  675. // Case-2) providing per-instance icons for some types of files.
  676. //
  677. // Because Case-1 is described above, we'll explain only Case-2 here.
  678. //
  679. // When the shell is about display an icon for a file, it does following:
  680. // (1) Finds its ProgID and ClassID.
  681. // (2) If the file has a ClassID, it gets the icon location string from the
  682. // "DefaultIcon" key under it. The string indicates either per-class
  683. // icon (e.g., "FOOBAR.DLL,2") or per-instance icon (e.g., "%1,1").
  684. // (3) If a per-instance icon is specified, the shell creates an icon
  685. // extraction handler object for it, and extracts the icon from it
  686. // (which is described above).
  687. //
  688. // It is important to note that the shell calls IExtractIcon::GetIconLocation
  689. // first, then calls IExtractIcon::Extract. Most application programs
  690. // that support per-instance icons will probably store an icon location
  691. // (DLL/EXE name and index/id) rather than an icon image in each file.
  692. // In those cases, a programmer needs to implement only the GetIconLocation
  693. // member and it Extract member simply returns S_FALSE. They need to
  694. // implement Extract member only if they decided to store the icon images
  695. // within files themselved or some other database (which is very rare).
  696. //
  697. //
  698. //
  699. // [Member functions]
  700. //
  701. //
  702. // IExtractIcon::GetIconLocation
  703. //
  704. // This function returns an icon location.
  705. //
  706. // Parameters:
  707. // uFlags [in] -- Specifies if it is opened or not (GIL_OPENICON or 0)
  708. // szIconFile [out] -- Specifies the string buffer buffer for a location name.
  709. // cchMax [in] -- Specifies the size of szIconFile (almost always MAX_PATH)
  710. // piIndex [out] -- Sepcifies the address of UINT for the index.
  711. // pwFlags [out] -- Returns GIL_* flags
  712. // Returns:
  713. // NOERROR, if it returns a valid location; S_FALSE, if the shell use a
  714. // default icon.
  715. //
  716. // Notes: The location may or may not be a path to a file. The caller can
  717. // not assume anything unless the subsequent Extract member call returns
  718. // S_FALSE.
  719. //
  720. // if the returned location is not a path to a file, GIL_NOTFILENAME should
  721. // be set in the returned flags.
  722. //
  723. // IExtractIcon::Extract
  724. //
  725. // This function extracts an icon image from a specified file.
  726. //
  727. // Parameters:
  728. // pszFile [in] -- Specifies the icon location (typically a path to a file).
  729. // nIconIndex [in] -- Specifies the icon index.
  730. // phiconLarge [out] -- Specifies the HICON variable for large icon.
  731. // phiconSmall [out] -- Specifies the HICON variable for small icon.
  732. // nIconSize [in] -- Specifies the size icon required (size of large icon)
  733. // LOWORD is the requested large icon size
  734. // HIWORD is the requested small icon size
  735. // Returns:
  736. // NOERROR, if it extracted the from the file.
  737. // S_FALSE, if the caller should extract from the file specified in the
  738. // location.
  739. //
  740. //===========================================================================
  741. // GetIconLocation() input flags
  742. #define GIL_OPENICON 0x0001 // allows containers to specify an "open" look
  743. #define GIL_FORSHELL 0x0002 // icon is to be displayed in a ShellFolder
  744. #define GIL_ASYNC 0x0020 // this is an async extract, return E_PENDING
  745. #define GIL_DEFAULTICON 0x0040 // get the default icon location if the final one takes too long to get
  746. #define GIL_FORSHORTCUT 0x0080 // the icon is for a shortcut to the object
  747. // GetIconLocation() return flags
  748. #define GIL_SIMULATEDOC 0x0001 // simulate this document icon for this
  749. #define GIL_PERINSTANCE 0x0002 // icons from this class are per instance (each file has its own)
  750. #define GIL_PERCLASS 0x0004 // icons from this class per class (shared for all files of this type)
  751. #define GIL_NOTFILENAME 0x0008 // location is not a filename, must call ::ExtractIcon
  752. #define GIL_DONTCACHE 0x0010 // this icon should not be cached
  753. #undef INTERFACE
  754. #define INTERFACE IExtractIconA
  755. DECLARE_INTERFACE_(IExtractIconA, IUnknown) // exic
  756. {
  757. // *** IUnknown methods ***
  758. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  759. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  760. STDMETHOD_(ULONG,Release) (THIS) PURE;
  761. // *** IExtractIcon methods ***
  762. STDMETHOD(GetIconLocation)(THIS_
  763. UINT uFlags,
  764. LPSTR szIconFile,
  765. UINT cchMax,
  766. int * piIndex,
  767. UINT * pwFlags) PURE;
  768. STDMETHOD(Extract)(THIS_
  769. LPCSTR pszFile,
  770. UINT nIconIndex,
  771. HICON *phiconLarge,
  772. HICON *phiconSmall,
  773. UINT nIconSize) PURE;
  774. };
  775. typedef IExtractIconA * LPEXTRACTICONA;
  776. #undef INTERFACE
  777. #define INTERFACE IExtractIconW
  778. DECLARE_INTERFACE_(IExtractIconW, IUnknown) // exic
  779. {
  780. // *** IUnknown methods ***
  781. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  782. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  783. STDMETHOD_(ULONG,Release) (THIS) PURE;
  784. // *** IExtractIcon methods ***
  785. STDMETHOD(GetIconLocation)(THIS_
  786. UINT uFlags,
  787. LPWSTR szIconFile,
  788. UINT cchMax,
  789. int * piIndex,
  790. UINT * pwFlags) PURE;
  791. STDMETHOD(Extract)(THIS_
  792. LPCWSTR pszFile,
  793. UINT nIconIndex,
  794. HICON *phiconLarge,
  795. HICON *phiconSmall,
  796. UINT nIconSize) PURE;
  797. };
  798. typedef IExtractIconW * LPEXTRACTICONW;
  799. #ifdef UNICODE
  800. #define IExtractIcon IExtractIconW
  801. #define IExtractIconVtbl IExtractIconWVtbl
  802. #define LPEXTRACTICON LPEXTRACTICONW
  803. #else
  804. #define IExtractIcon IExtractIconA
  805. #define IExtractIconVtbl IExtractIconAVtbl
  806. #define LPEXTRACTICON LPEXTRACTICONA
  807. #endif
  808. //===========================================================================
  809. //
  810. // IShellIcon Interface
  811. //
  812. // used to get a icon index for a IShellFolder object.
  813. //
  814. // this interface can be implemented by a IShellFolder, as a quick way to
  815. // return the icon for a object in the folder.
  816. //
  817. // a instance of this interface is only created once for the folder, unlike
  818. // IExtractIcon witch is created once for each object.
  819. //
  820. // if a ShellFolder does not implement this interface, the standard
  821. // GetUIObject(....IExtractIcon) method will be used to get a icon
  822. // for all objects.
  823. //
  824. // the following standard imagelist indexs can be returned:
  825. //
  826. // 0 document (blank page) (not associated)
  827. // 1 document (with stuff on the page)
  828. // 2 application (exe, com, bat)
  829. // 3 folder (plain)
  830. // 4 folder (open)
  831. //
  832. // IShellIcon:GetIconOf(pidl, flags, lpIconIndex)
  833. //
  834. // pidl object to get icon for.
  835. // flags GIL_* input flags (GIL_OPEN, ...)
  836. // lpIconIndex place to return icon index.
  837. //
  838. // returns:
  839. // NOERROR, if lpIconIndex contains the correct system imagelist index.
  840. // S_FALSE, if unable to get icon for this object, go through
  841. // GetUIObject, IExtractIcon, methods.
  842. //
  843. //===========================================================================
  844. #undef INTERFACE
  845. #define INTERFACE IShellIcon
  846. DECLARE_INTERFACE_(IShellIcon, IUnknown) // shi
  847. {
  848. // *** IUnknown methods ***
  849. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  850. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  851. STDMETHOD_(ULONG,Release) (THIS) PURE;
  852. // *** IShellIcon methods ***
  853. STDMETHOD(GetIconOf)(THIS_ LPCITEMIDLIST pidl, UINT flags,
  854. LPINT lpIconIndex) PURE;
  855. };
  856. typedef IShellIcon *LPSHELLICON;
  857. //===========================================================================
  858. //
  859. // IShellIconOverlayIdentifier
  860. //
  861. // Used to identify a file as a member of the group of files that have this specific
  862. // icon overlay
  863. //
  864. // Users can create new IconOverlayIdentifiers and place them in the following registry
  865. // location together with the Icon overlay image and their priority.
  866. // HKEY_LOCAL_MACHINE "Software\\Microsoft\\Windows\\CurrentVersion\\ShellIconOverlayIdentifiers"
  867. //
  868. // The shell will enumerate through all IconOverlayIdentifiers at start, and prioritize
  869. // them according to internal rules, in case the internal rules don't apply, we use their
  870. // input priority
  871. //
  872. // IShellIconOverlayIdentifier:IsMemberOf(LPCWSTR pwszPath, DWORD dwAttrib)
  873. // pwszPath full path of the file
  874. // dwAttrib attribute of this file
  875. //
  876. // returns:
  877. // S_OK, if the file is a member
  878. // S_FALSE, if the file is not a member
  879. // E_FAIL, if the operation failed due to bad WIN32_FIND_DATA
  880. //
  881. // IShellIconOverlayIdentifier::GetOverlayInfo(LPWSTR pwszIconFile, int * pIndex, DWORD * dwFlags) PURE;
  882. // pszIconFile the path of the icon file
  883. // pIndex Depend on the flags, this could contain the IconIndex
  884. // dwFlags defined below
  885. //
  886. // IShellIconOverlayIdentifier::GetPriority(int * pIPriority) PURE;
  887. // pIPriority the priority of this Overlay Identifier
  888. //
  889. //===========================================================================
  890. #undef INTERFACE
  891. #define INTERFACE IShellIconOverlayIdentifier
  892. DECLARE_INTERFACE_(IShellIconOverlayIdentifier, IUnknown)
  893. {
  894. // *** IUnknown methods ***
  895. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  896. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  897. STDMETHOD_(ULONG,Release) (THIS) PURE;
  898. // *** IShellIconOverlayIdentifier methods ***
  899. STDMETHOD (IsMemberOf)(THIS_ LPCWSTR pwszPath, DWORD dwAttrib) PURE;
  900. STDMETHOD (GetOverlayInfo)(THIS_ LPWSTR pwszIconFile, int cchMax, int * pIndex, DWORD * pdwFlags) PURE;
  901. STDMETHOD (GetPriority)(THIS_ int * pIPriority) PURE;
  902. };
  903. #define ISIOI_ICONFILE 0x00000001 // path is returned through pwszIconFile
  904. #define ISIOI_ICONINDEX 0x00000002 // icon index in pwszIconFile is returned through pIndex
  905. //===========================================================================
  906. //
  907. // IShellIconOverlayManager
  908. //
  909. // Used to return the icon overlay information including OverlayIndex, Image Index or Priority for an IShellFolder object.
  910. ;begin_internal
  911. // this is only inherited by CFSFolder_IconOverlayManager, it enumerates through all IconOverlayID's and
  912. // keep their information in an array.
  913. ;end_internal
  914. //
  915. // IShellIconOverlayManager:GetFileOverlayInfo(LPCWSTR pwszPath, DWORD dwAttrib, int * pIndex, DWORD dwflags)
  916. // pwszPath full path of the file
  917. // dwAttrib attribute of this file
  918. // pIndex pointer to the Icon Index in the system image list
  919. // pOverlayIndex pointer to the OverlayIndex in the system image list
  920. // pPriority pointer to the Priority of this overlay
  921. // IShellIconOverlayManager:GetReservedOverlayInfo(LPCWSTR pwszPath, DWORD dwAttrib, int * pIndex, DWORD dwflags, int iReservedID)
  922. // iReservedID reserved icon overlay id
  923. // returns:
  924. // S_OK, if the index of an Overlay is found
  925. // S_FALSE, if no Overlay exists for this file
  926. // E_FAIL, if lpfd is bad
  927. // IShellIconOverlayManager:RefreshOverlayImages(DWORD dwFlags)
  928. // This will refresh the overlay cache, depends on the dwFlags passed in
  929. // It will reload the icons into the imagelist, when passed SIOM_ICONINDEX
  930. // IShellIconOverlayManager::LoadNonloadedOverlayIdentifiers()
  931. // This method loads any registered overlay identifiers (handlers) that
  932. // are not currently loaded.
  933. // IShellIconOverlayManager::OverlayIndexFromImageIndex(int iImage, int *piIndex, BOOL fAdd)
  934. // iImage existing shell image list index to look for
  935. // piIndex returned overlay index
  936. // fAdd Add image if not already present?
  937. //===========================================================================
  938. #undef INTERFACE
  939. #define INTERFACE IShellIconOverlayManager
  940. DECLARE_INTERFACE_(IShellIconOverlayManager, IUnknown)
  941. {
  942. // *** IUnknown methods ***
  943. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  944. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  945. STDMETHOD_(ULONG,Release) (THIS) PURE;
  946. // *** IShellIconOverlayManager methods ***
  947. STDMETHOD(GetFileOverlayInfo)(THIS_ LPCWSTR pwszPath, DWORD dwAttrib, int * pIndex, DWORD dwflags) PURE;
  948. STDMETHOD(GetReservedOverlayInfo)(THIS_ LPCWSTR pwszPath, DWORD dwAttrib, int * pIndex, DWORD dwflags, int iReservedID) PURE;
  949. STDMETHOD(RefreshOverlayImages)(THIS_ DWORD dwFlags) PURE;
  950. STDMETHOD(LoadNonloadedOverlayIdentifiers)(THIS) PURE;
  951. STDMETHOD(OverlayIndexFromImageIndex)(THIS_ int iImage, int * piIndex, BOOL fAdd) PURE;
  952. };
  953. #define SIOM_OVERLAYINDEX 1
  954. #define SIOM_ICONINDEX 2
  955. // #define SIOM_PRIORITY 3
  956. #define SIOM_RESERVED_SHARED 0
  957. #define SIOM_RESERVED_LINK 1
  958. #define SIOM_RESERVED_SLOWFILE 2
  959. //===========================================================================
  960. //
  961. // IShellIconOverlay
  962. //
  963. // Used to return the icon overlay index or its icon index for an IShellFolder object,
  964. // this is always implemented with IShellFolder
  965. //
  966. // IShellIconOverlay:GetOverlayIndex(LPCITEMIDLIST pidl, DWORD * pdwIndex)
  967. // pidl object to identify icon overlay for.
  968. // pdwIndex the Overlay Index in the system image list
  969. //
  970. // IShellIconOverlay:GetOverlayIconIndex(LPCITEMIDLIST pidl, DWORD * pdwIndex)
  971. // pdwIconIndex the Overlay Icon index in the system image list
  972. // This method is only used for those who are interested in seeing the real bits
  973. // of the Overlay Icon
  974. //
  975. // returns:
  976. // S_OK, if the index of an Overlay is found
  977. // S_FALSE, if no Overlay exists for this file
  978. // E_FAIL, if pidl is bad
  979. //
  980. //===========================================================================
  981. #undef INTERFACE
  982. #define INTERFACE IShellIconOverlay
  983. DECLARE_INTERFACE_(IShellIconOverlay, IUnknown)
  984. {
  985. // *** IUnknown methods ***
  986. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  987. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  988. STDMETHOD_(ULONG,Release) (THIS) PURE;
  989. // *** IShellIconOverlay methods ***
  990. STDMETHOD(GetOverlayIndex)(THIS_ LPCITEMIDLIST pidl, int * pIndex) PURE;
  991. STDMETHOD(GetOverlayIconIndex)(THIS_ LPCITEMIDLIST pidl, int * pIconIndex) PURE;
  992. };
  993. #define OI_ASYNC 0xFFFFEEEE
  994. //-------------------------------------------------------------------------
  995. //
  996. // SHGetIconOverlayIndex
  997. //
  998. // This function takes the path and icon/res id to the icon and convert it into
  999. // an overlay index in the system image list.
  1000. // Note: there are totally only 15 slots for system image overlays, some of which
  1001. // was reserved by the system, or taken by the overlayidentifiers, so it's possible
  1002. // that this function would fail and return -1;
  1003. //
  1004. // To get the default overlays in the system, such as the share hand, link shortcut
  1005. // and slow files, pass NULL as the file name, then the IDO_SHGIOI_* flags as the icon index
  1006. //-------------------------------------------------------------------------
  1007. #define IDO_SHGIOI_SHARE 0x0FFFFFFF
  1008. #define IDO_SHGIOI_LINK 0x0FFFFFFE
  1009. #define IDO_SHGIOI_SLOWFILE 0x0FFFFFFFD
  1010. SHSTDAPI_(int) SHGetIconOverlayIndex%(LPCTSTR% pszIconPath, int iIconIndex);
  1011. ;begin_internal
  1012. //===========================================================================
  1013. //
  1014. // IBrowserBand
  1015. //
  1016. // IBrowserBand::GetObjectBB(REFIID riid, void **ppv)
  1017. // Obtain a service from the web browser.
  1018. //
  1019. // IBrowserBand::SetBrowserBandInfo(DWORD dwMask, PBROWSERBANDINFO pbbi)
  1020. // Set browser band properties based on members of browserbandinfo struct
  1021. // specified by dwMask. These properties include title, deskband mode, and
  1022. // current size.
  1023. //
  1024. //===========================================================================
  1025. typedef struct {
  1026. UINT cbSize;
  1027. DWORD dwModeFlags;
  1028. BSTR bstrTitle;
  1029. SIZE sizeMin;
  1030. SIZE sizeMax;
  1031. SIZE sizeCur;
  1032. } BROWSERBANDINFO, *PBROWSERBANDINFO;
  1033. #define BBIM_MODEFLAGS 0x00000001
  1034. #define BBIM_TITLE 0x00000002
  1035. #define BBIM_SIZEMIN 0x00000004
  1036. #define BBIM_SIZEMAX 0x00000008
  1037. #define BBIM_SIZECUR 0x00000010
  1038. #undef INTERFACE
  1039. #define INTERFACE IBrowserBand
  1040. DECLARE_INTERFACE_(IBrowserBand, IUnknown)
  1041. {
  1042. // *** IUnknown methods ***
  1043. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  1044. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  1045. STDMETHOD_(ULONG,Release)(THIS) PURE;
  1046. // *** IBrowserBand methods ***
  1047. STDMETHOD(GetObjectBB)(THIS_ REFIID riid, void **ppv) PURE;
  1048. STDMETHOD(SetBrowserBandInfo)(THIS_ DWORD dwMask, PBROWSERBANDINFO pbbi) PURE;
  1049. STDMETHOD(GetBrowserBandInfo)(THIS_ DWORD dwMask, PBROWSERBANDINFO pbbi) PURE;
  1050. };
  1051. ;end_internal
  1052. #if (_WIN32_IE >= 0x0400)
  1053. ;begin_internal
  1054. // NT4 Console Server included shell32\shlink.h to get structure
  1055. // definitions and mimicked shell32\shlink.c to understand the
  1056. // stream format so our stream format is fixed forever. This is
  1057. // not bad since it was designed with extension in mind. We need
  1058. // to publish (as privately as possible) the file format and
  1059. // structures needed to read the file format.
  1060. //
  1061. // The stream format is a SHELL_LINK_DATA followed by
  1062. // if SLDF_HAS_ID_LIST an ILSaveToStream followed by
  1063. // if SLDF_HAS_LINK_INFO a LINKINFO followed by
  1064. // if SLDF_HAS_NAME a STREAMSTRING followed by
  1065. // if SLDF_RELPATH a STREAMSTRING followed by
  1066. // if SLDF_WORKINGDIR a STREAMSTRING followed by
  1067. // if SLDF_HAS_ARGS a STREAMSTRING followed by
  1068. // if SLDF_HAS_ICON_LOCATION a STREAMSTRING followed by
  1069. // SHWriteDataBlockList list of signature blocks
  1070. //
  1071. // Where a STREAMSTRING is a USHORT count of characters
  1072. // followed by that many (SLDF_UNICODE ? WIDE : ANSI) characters.
  1073. //
  1074. typedef struct { // sld
  1075. DWORD cbSize; // signature for this data structure
  1076. CLSID clsid; // our GUID
  1077. DWORD dwFlags; // SHELL_LINK_DATA_FLAGS enumeration
  1078. DWORD dwFileAttributes;
  1079. FILETIME ftCreationTime;
  1080. FILETIME ftLastAccessTime;
  1081. FILETIME ftLastWriteTime;
  1082. DWORD nFileSizeLow;
  1083. int iIcon;
  1084. int iShowCmd;
  1085. WORD wHotkey;
  1086. WORD wUnused;
  1087. DWORD dwRes1;
  1088. DWORD dwRes2;
  1089. } SHELL_LINK_DATA, *LPSHELL_LINK_DATA;
  1090. ;end_internal
  1091. // IShellLinkDataList::GetFlags()/SetFlags()
  1092. typedef enum {
  1093. SLDF_HAS_ID_LIST = 0x00000001, // Shell link saved with ID list
  1094. SLDF_HAS_LINK_INFO = 0x00000002, // Shell link saved with LinkInfo
  1095. SLDF_HAS_NAME = 0x00000004,
  1096. SLDF_HAS_RELPATH = 0x00000008,
  1097. SLDF_HAS_WORKINGDIR = 0x00000010,
  1098. SLDF_HAS_ARGS = 0x00000020,
  1099. SLDF_HAS_ICONLOCATION = 0x00000040,
  1100. SLDF_UNICODE = 0x00000080, // the strings are unicode
  1101. SLDF_FORCE_NO_LINKINFO = 0x00000100, // don't create a LINKINFO (make a dumb link)
  1102. SLDF_HAS_EXP_SZ = 0x00000200, // the link contains expandable env strings
  1103. SLDF_RUN_IN_SEPARATE = 0x00000400, // Run the 16-bit target exe in a separate VDM/WOW
  1104. SLDF_HAS_LOGO3ID = 0x00000800, // this link is a special Logo3/MSICD link
  1105. SLDF_HAS_DARWINID = 0x00001000, // this link is a special Darwin link
  1106. SLDF_RUNAS_USER = 0x00002000, // Run this link as a different user
  1107. SLDF_HAS_EXP_ICON_SZ = 0x00004000, // contains expandable env string for icon path
  1108. SLDF_NO_PIDL_ALIAS = 0x00008000, // don't ever resolve to a logical location
  1109. SLDF_FORCE_UNCNAME = 0x00010000, // make GetPath() prefer the UNC name to the local name
  1110. SLDF_RUN_WITH_SHIMLAYER = 0x00020000, // Launch the target of this link w/ shim layer active
  1111. SLDF_RESERVED = 0x80000000, // Reserved-- so we can use the low word as an index value in the future
  1112. } SHELL_LINK_DATA_FLAGS;
  1113. typedef struct tagDATABLOCKHEADER
  1114. {
  1115. DWORD cbSize; // Size of this extra data block
  1116. DWORD dwSignature; // signature of this extra data block
  1117. } DATABLOCK_HEADER, *LPDATABLOCK_HEADER, *LPDBLIST;
  1118. typedef struct {
  1119. #ifdef __cplusplus
  1120. DATABLOCK_HEADER dbh;
  1121. #else
  1122. DATABLOCK_HEADER;
  1123. #endif
  1124. WORD wFillAttribute; // fill attribute for console
  1125. WORD wPopupFillAttribute; // fill attribute for console popups
  1126. COORD dwScreenBufferSize; // screen buffer size for console
  1127. COORD dwWindowSize; // window size for console
  1128. COORD dwWindowOrigin; // window origin for console
  1129. DWORD nFont;
  1130. DWORD nInputBufferSize;
  1131. COORD dwFontSize;
  1132. UINT uFontFamily;
  1133. UINT uFontWeight;
  1134. WCHAR FaceName[LF_FACESIZE];
  1135. UINT uCursorSize;
  1136. BOOL bFullScreen;
  1137. BOOL bQuickEdit;
  1138. BOOL bInsertMode;
  1139. BOOL bAutoPosition;
  1140. UINT uHistoryBufferSize;
  1141. UINT uNumberOfHistoryBuffers;
  1142. BOOL bHistoryNoDup;
  1143. COLORREF ColorTable[ 16 ];
  1144. } NT_CONSOLE_PROPS, *LPNT_CONSOLE_PROPS;
  1145. #define NT_CONSOLE_PROPS_SIG 0xA0000002
  1146. // This is a FE Console property
  1147. typedef struct {
  1148. #ifdef __cplusplus
  1149. DATABLOCK_HEADER dbh;
  1150. #else
  1151. DATABLOCK_HEADER;
  1152. #endif
  1153. UINT uCodePage;
  1154. } NT_FE_CONSOLE_PROPS, *LPNT_FE_CONSOLE_PROPS;
  1155. #define NT_FE_CONSOLE_PROPS_SIG 0xA0000004
  1156. #if (_WIN32_IE >= 0x0500)
  1157. typedef struct {
  1158. #ifdef __cplusplus
  1159. DATABLOCK_HEADER dbh;
  1160. #else
  1161. DATABLOCK_HEADER;
  1162. #endif
  1163. CHAR szDarwinID[MAX_PATH]; // ANSI darwin ID associated with link
  1164. WCHAR szwDarwinID[MAX_PATH]; // UNICODE darwin ID associated with link
  1165. } EXP_DARWIN_LINK, *LPEXP_DARWIN_LINK;
  1166. #define EXP_DARWIN_ID_SIG 0xA0000006
  1167. // WARNING: (reinerf) - this has the same value as EXP_SZ_ICON_SIG?!?!?!
  1168. #define EXP_LOGO3_ID_SIG 0xA0000007
  1169. #endif
  1170. #define EXP_SPECIAL_FOLDER_SIG 0xA0000005 // LPEXP_SPECIAL_FOLDER
  1171. ;begin_internal
  1172. typedef struct
  1173. {
  1174. DWORD cbSize; // Size of this extra data block
  1175. DWORD dwSignature; // signature of this extra data block
  1176. } EXP_HEADER, *LPEXP_HEADER;
  1177. ;end _internal
  1178. typedef struct
  1179. {
  1180. DWORD cbSize; // Size of this extra data block
  1181. DWORD dwSignature; // signature of this extra data block
  1182. DWORD idSpecialFolder; // special folder id this link points into
  1183. DWORD cbOffset; // ofset into pidl from SLDF_HAS_ID_LIST for child
  1184. } EXP_SPECIAL_FOLDER, *LPEXP_SPECIAL_FOLDER;
  1185. ;begin_internal
  1186. typedef struct
  1187. {
  1188. DWORD cbSize; // Size of this extra data block
  1189. DWORD dwSignature; // signature of this extra data block
  1190. BYTE abTracker[ 1 ]; //
  1191. } EXP_TRACKER, *LPEXP_TRACKER;
  1192. #define EXP_TRACKER_SIG 0xA0000003 // LPEXP_TRACKER
  1193. typedef struct
  1194. {
  1195. DWORD cbSize; // Size of this extra data block
  1196. DWORD dwSignature; // signature of this extra data block
  1197. WCHAR wszLayerEnvName[64]; // name of shim layer to run with this link (eg "NT4SP5")
  1198. } EXP_SHIMLAYER;
  1199. #define EXP_SHIMLAYER_SIG 0xA0000008
  1200. ;end_internal
  1201. typedef struct
  1202. {
  1203. DWORD cbSize; // Size of this extra data block
  1204. DWORD dwSignature; // signature of this extra data block
  1205. CHAR szTarget[ MAX_PATH ]; // ANSI target name w/EXP_SZ in it
  1206. WCHAR swzTarget[ MAX_PATH ]; // UNICODE target name w/EXP_SZ in it
  1207. } EXP_SZ_LINK, *LPEXP_SZ_LINK;
  1208. #define EXP_SZ_LINK_SIG 0xA0000001 // LPEXP_SZ_LINK (target)
  1209. #define EXP_SZ_ICON_SIG 0xA0000007 // LPEXP_SZ_LINK (icon)
  1210. ;begin_internal
  1211. // NT40 Console Control Panel Applet does a CoCreateInstance(CLSID_CShellLink),
  1212. // used the CShellLink definition to get the 'this' pointer, and passed that
  1213. // along to some private exports in shell32. This completely prevents us
  1214. // from moving the CShellLink implementation to another DLL. (If we do, or an
  1215. // ISV takes our stream format and implements a better link by pointing the
  1216. // classid to their implementation, the NT40 Console CPA will fault.)
  1217. //
  1218. // To fix this problem in future revs, CShellLink will support IShellLinkDataList
  1219. // AddDataBlock adds the data block
  1220. // FindDataBloc returns a LocalAlloc()d COPY of a data block with the
  1221. // signature dwSig (NOTE: this is different than SHFindDataBlock)
  1222. // RemoveDataBlock removes a data block with signature dwSig
  1223. // Plan is for NT50's Console CPA to use this interface instead.
  1224. //
  1225. ;end_internal
  1226. #undef INTERFACE
  1227. #define INTERFACE IShellLinkDataList
  1228. DECLARE_INTERFACE_(IShellLinkDataList, IUnknown)
  1229. {
  1230. // *** IUnknown methods ***
  1231. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1232. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1233. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1234. // *** IShellLinkDataList methods ***
  1235. STDMETHOD(AddDataBlock)(THIS_ void * pDataBlock) PURE;
  1236. STDMETHOD(CopyDataBlock)(THIS_ DWORD dwSig, void **ppDataBlock) PURE;
  1237. STDMETHOD(RemoveDataBlock)(THIS_ DWORD dwSig) PURE;
  1238. STDMETHOD(GetFlags)(THIS_ DWORD *pdwFlags) PURE;
  1239. STDMETHOD(SetFlags)(THIS_ DWORD dwFlags) PURE;
  1240. };
  1241. #endif // (_WIN32_IE >= 0x0400)
  1242. #if (_WIN32_IE >= 0x0500)
  1243. #undef INTERFACE
  1244. #define INTERFACE IResolveShellLink
  1245. DECLARE_INTERFACE_(IResolveShellLink, IUnknown)
  1246. {
  1247. // *** IUnknown methods ***
  1248. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1249. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1250. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1251. // *** IResolveShellLink methods ***
  1252. STDMETHOD(ResolveShellLink)(THIS_ IUnknown* punk, HWND hwnd, DWORD fFlags) PURE;
  1253. };
  1254. #endif // (_WIN32_IE >= 0x0500)
  1255. #ifdef _INC_SHELLAPI /* for LPSHELLEXECUTEINFO */
  1256. //===========================================================================
  1257. //
  1258. // IShellExecuteHook Interface
  1259. //
  1260. //===========================================================================
  1261. #undef INTERFACE
  1262. #define INTERFACE IShellExecuteHookA
  1263. DECLARE_INTERFACE_(IShellExecuteHookA, IUnknown) // shexhk
  1264. {
  1265. // *** IUnknown methods ***
  1266. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1267. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1268. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1269. // *** IShellExecuteHookA methods ***
  1270. STDMETHOD(Execute)(THIS_ LPSHELLEXECUTEINFOA pei) PURE;
  1271. };
  1272. #undef INTERFACE
  1273. #define INTERFACE IShellExecuteHookW
  1274. DECLARE_INTERFACE_(IShellExecuteHookW, IUnknown) // shexhk
  1275. {
  1276. // *** IUnknown methods ***
  1277. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1278. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1279. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1280. // *** IShellExecuteHookW methods ***
  1281. STDMETHOD(Execute)(THIS_ LPSHELLEXECUTEINFOW pei) PURE;
  1282. };
  1283. #ifdef UNICODE
  1284. #define IShellExecuteHook IShellExecuteHookW
  1285. #define IShellExecuteHookVtbl IShellExecuteHookWVtbl
  1286. #else
  1287. #define IShellExecuteHook IShellExecuteHookA
  1288. #define IShellExecuteHookVtbl IShellExecuteHookAVtbl
  1289. #endif
  1290. #endif
  1291. //===========================================================================
  1292. //
  1293. // IURLSearchHook Interface
  1294. ;begin_internal
  1295. //
  1296. // IURLSearchHook Interface is called whenever the browser navigates to a
  1297. // non-standard URL. It can be used to redirect the user's request to a
  1298. // search engine or a specific web site.
  1299. //
  1300. // A non-standard URL does not have a protocol prefix (e.g.,
  1301. // "www.microsoft.com") and the protocol cannot be easily guessed by
  1302. // the browser (e.g., "home.microsoft.com").
  1303. //
  1304. // The parameters of Translate(..)
  1305. // lpwszSearchURL -- (IN/OUT) Wide char buffer that contains the request
  1306. // "URL" user typed in as input and the tranlated URL
  1307. // as output.
  1308. // cchBufferSize -- (IN) size of lpwszSearchURL
  1309. //
  1310. // Return Values:
  1311. // S_OK Search handled completely, pszResult has the full URL to
  1312. // browse to. Stop running any further IURLSearchHooks and
  1313. // pass this URL back to the browser for browsing.
  1314. //
  1315. // S_FALSE Query has been preprocessed, pszResult has the result of
  1316. // the preprocess, further search still needed. Go on
  1317. // executing the rest of the IURLSearchHooks. The
  1318. // preprocessing steps can be:
  1319. //
  1320. // 1. replaced certain characters
  1321. // 2. added more hints
  1322. //
  1323. // E_ABORT Search handled completely, stop running any further
  1324. // IURLSearchHooks, but NO BROWSING NEEDED as a result,
  1325. // pszResult is a copy of pcszQuery.
  1326. //
  1327. // ; NOTE: This is not fully implemented, yet, making IURLQualify return this ;Internal
  1328. // involves too much change. ;Internal
  1329. // ;Internal
  1330. // NOTE:: E_ABORT is currently treated as E_FAIL. It requires too much change. ;Internal
  1331. //
  1332. // E_FAIL This Hook was unsuccessful. Search not handled at all,
  1333. // pcszQueryURL has the query string. Please go on running
  1334. // other IURLSearchHooks.
  1335. //
  1336. ;end_internal
  1337. //
  1338. //===========================================================================
  1339. #undef INTERFACE
  1340. #define INTERFACE IURLSearchHook
  1341. DECLARE_INTERFACE_(IURLSearchHook, IUnknown)
  1342. {
  1343. // *** IUnknown methods ***
  1344. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1345. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1346. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1347. // *** IURLSearchHook methods ***
  1348. STDMETHOD(Translate)(THIS_ LPWSTR lpwszSearchURL, DWORD cchBufferSize) PURE;
  1349. };
  1350. #undef INTERFACE
  1351. #define INTERFACE ISearchContext
  1352. DECLARE_INTERFACE_(ISearchContext, IUnknown)
  1353. {
  1354. // *** IUnknown methods ***
  1355. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1356. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1357. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1358. // *** ISearchContext methods ***
  1359. STDMETHOD(GetSearchUrl)(THIS_ BSTR * pbstrSearchUrl) PURE;
  1360. STDMETHOD(GetSearchText)(THIS_ BSTR * pbstrSearchText) PURE;
  1361. STDMETHOD(GetSearchStyle)(THIS_ DWORD * pdwSearchStyle) PURE;
  1362. };
  1363. #undef INTERFACE
  1364. #define INTERFACE IURLSearchHook2
  1365. DECLARE_INTERFACE_(IURLSearchHook2, IURLSearchHook)
  1366. {
  1367. // *** IURLSearchHook2 methods ***
  1368. STDMETHOD(TranslateWithSearchContext)(THIS_ LPWSTR lpwszSearchURL, DWORD cchBufferSize, ISearchContext * pSearchContext) PURE;
  1369. };
  1370. //===========================================================================
  1371. //
  1372. // INewShortcutHook Interface
  1373. //
  1374. //===========================================================================
  1375. #undef INTERFACE
  1376. #define INTERFACE INewShortcutHookA
  1377. DECLARE_INTERFACE_(INewShortcutHookA, IUnknown) // nshhk
  1378. {
  1379. // *** IUnknown methods ***
  1380. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1381. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1382. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1383. // *** INewShortcutHook methods ***
  1384. STDMETHOD(SetReferent)(THIS_ LPCSTR pcszReferent, HWND hwnd) PURE;
  1385. STDMETHOD(GetReferent)(THIS_ LPSTR pszReferent, int cchReferent) PURE;
  1386. STDMETHOD(SetFolder)(THIS_ LPCSTR pcszFolder) PURE;
  1387. STDMETHOD(GetFolder)(THIS_ LPSTR pszFolder, int cchFolder) PURE;
  1388. STDMETHOD(GetName)(THIS_ LPSTR pszName, int cchName) PURE;
  1389. STDMETHOD(GetExtension)(THIS_ LPSTR pszExtension, int cchExtension) PURE;
  1390. };
  1391. #undef INTERFACE
  1392. #define INTERFACE INewShortcutHookW
  1393. DECLARE_INTERFACE_(INewShortcutHookW, IUnknown) // nshhk
  1394. {
  1395. // *** IUnknown methods ***
  1396. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1397. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1398. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1399. // *** INewShortcutHook methods ***
  1400. STDMETHOD(SetReferent)(THIS_ LPCWSTR pcszReferent, HWND hwnd) PURE;
  1401. STDMETHOD(GetReferent)(THIS_ LPWSTR pszReferent, int cchReferent) PURE;
  1402. STDMETHOD(SetFolder)(THIS_ LPCWSTR pcszFolder) PURE;
  1403. STDMETHOD(GetFolder)(THIS_ LPWSTR pszFolder, int cchFolder) PURE;
  1404. STDMETHOD(GetName)(THIS_ LPWSTR pszName, int cchName) PURE;
  1405. STDMETHOD(GetExtension)(THIS_ LPWSTR pszExtension, int cchExtension) PURE;
  1406. };
  1407. #ifdef UNICODE
  1408. #define INewShortcutHook INewShortcutHookW
  1409. #define INewShortcutHookVtbl INewShortcutHookWVtbl
  1410. #else
  1411. #define INewShortcutHook INewShortcutHookA
  1412. #define INewShortcutHookVtbl INewShortcutHookAVtbl
  1413. #endif
  1414. //===========================================================================
  1415. //
  1416. // ICopyHook Interface
  1417. //
  1418. // The copy hook is called whenever file system directories are
  1419. // copy/moved/deleted/renamed via the shell. It is also called by the shell
  1420. // on changes of status of printers.
  1421. //
  1422. // Clients register their id under STRREG_SHEX_COPYHOOK for file system hooks
  1423. // and STRREG_SHEx_PRNCOPYHOOK for printer hooks.
  1424. // the CopyCallback is called prior to the action, so the hook has the chance
  1425. // to allow, deny or cancel the operation by returning the falues:
  1426. // IDYES - means allow the operation
  1427. // IDNO - means disallow the operation on this file, but continue with
  1428. // any other operations (eg. batch copy)
  1429. // IDCANCEL - means disallow the current operation and cancel any pending
  1430. // operations
  1431. //
  1432. // arguments to the CopyCallback
  1433. // hwnd - window to use for any UI
  1434. // wFunc - what operation is being done
  1435. // wFlags - and flags (FOF_*) set in the initial call to the file operation
  1436. // pszSrcFile - name of the source file
  1437. // dwSrcAttribs - file attributes of the source file
  1438. // pszDestFile - name of the destiation file (for move and renames)
  1439. // dwDestAttribs - file attributes of the destination file
  1440. //
  1441. //
  1442. //===========================================================================
  1443. #ifndef FO_MOVE //these need to be kept in sync with the ones in shellapi.h
  1444. // file operations
  1445. #define FO_MOVE 0x0001
  1446. #define FO_COPY 0x0002
  1447. #define FO_DELETE 0x0003
  1448. #define FO_RENAME 0x0004
  1449. #define FOF_MULTIDESTFILES 0x0001
  1450. #define FOF_CONFIRMMOUSE 0x0002
  1451. #define FOF_SILENT 0x0004 // don't create progress/report
  1452. #define FOF_RENAMEONCOLLISION 0x0008
  1453. #define FOF_NOCONFIRMATION 0x0010 // Don't prompt the user.
  1454. #define FOF_WANTMAPPINGHANDLE 0x0020 // Fill in SHFILEOPSTRUCT.hNameMappings
  1455. // Must be freed using SHFreeNameMappings
  1456. #define FOF_ALLOWUNDO 0x0040
  1457. #define FOF_FILESONLY 0x0080 // on *.*, do only files
  1458. #define FOF_SIMPLEPROGRESS 0x0100 // means don't show names of files
  1459. #define FOF_NOCONFIRMMKDIR 0x0200 // don't confirm making any needed dirs
  1460. #define FOF_NOERRORUI 0x0400 // don't put up error UI
  1461. #define FOF_NOCOPYSECURITYATTRIBS 0x0800 // dont copy NT file Security Attributes
  1462. #define FOF_NORECURSION 0x1000 // don't recurse into directories.
  1463. #if (_WIN32_IE >= 0x500)
  1464. #define FOF_NO_CONNECTED_ELEMENTS 0x2000 // don't operate on connected file elements.
  1465. #define FOF_WANTNUKEWARNING 0x4000 // during delete operation, warn if nuking instead of recycling (partially overrides FOF_NOCONFIRMATION)
  1466. #endif // _WIN32_IE >= 0x500
  1467. #if (_WIN32_WINNT >= 0x0501)
  1468. #define FOF_NORECURSEREPARSE 0x8000 // treat reparse points as objects, not containers
  1469. #endif // (_WIN32_WINNT >= 0x501)
  1470. typedef WORD FILEOP_FLAGS;
  1471. // printer operations
  1472. #define PO_DELETE 0x0013 // printer is being deleted
  1473. #define PO_RENAME 0x0014 // printer is being renamed
  1474. #define PO_PORTCHANGE 0x0020 // port this printer connected to is being changed
  1475. // if this id is set, the strings received by
  1476. // the copyhook are a doubly-null terminated
  1477. // list of strings. The first is the printer
  1478. // name and the second is the printer port.
  1479. #define PO_REN_PORT 0x0034 // PO_RENAME and PO_PORTCHANGE at same time.
  1480. // no POF_ flags currently defined
  1481. typedef UINT PRINTEROP_FLAGS;
  1482. #endif // FO_MOVE
  1483. #undef INTERFACE
  1484. #define INTERFACE ICopyHookA
  1485. DECLARE_INTERFACE_(ICopyHookA, IUnknown) // sl
  1486. {
  1487. // *** IUnknown methods ***
  1488. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1489. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1490. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1491. // *** ICopyHook methods ***
  1492. STDMETHOD_(UINT,CopyCallback) (THIS_ HWND hwnd, UINT wFunc, UINT wFlags, LPCSTR pszSrcFile, DWORD dwSrcAttribs,
  1493. LPCSTR pszDestFile, DWORD dwDestAttribs) PURE;
  1494. };
  1495. typedef ICopyHookA * LPCOPYHOOKA;
  1496. #undef INTERFACE
  1497. #define INTERFACE ICopyHookW
  1498. DECLARE_INTERFACE_(ICopyHookW, IUnknown) // sl
  1499. {
  1500. // *** IUnknown methods ***
  1501. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1502. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1503. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1504. // *** ICopyHook methods ***
  1505. STDMETHOD_(UINT,CopyCallback) (THIS_ HWND hwnd, UINT wFunc, UINT wFlags, LPCWSTR pszSrcFile, DWORD dwSrcAttribs,
  1506. LPCWSTR pszDestFile, DWORD dwDestAttribs) PURE;
  1507. };
  1508. typedef ICopyHookW * LPCOPYHOOKW;
  1509. #ifdef UNICODE
  1510. #define ICopyHook ICopyHookW
  1511. #define ICopyHookVtbl ICopyHookWVtbl
  1512. #define LPCOPYHOOK LPCOPYHOOKW
  1513. #else
  1514. #define ICopyHook ICopyHookA
  1515. #define ICopyHookVtbl ICopyHookAVtbl
  1516. #define LPCOPYHOOK LPCOPYHOOKA
  1517. #endif
  1518. //===========================================================================
  1519. //
  1520. // IFileViewerSite Interface
  1521. //
  1522. // History: ;Internal
  1523. // --/--/94 KurtE Created ;Internal
  1524. // ;Internal
  1525. //===========================================================================
  1526. #undef INTERFACE
  1527. #define INTERFACE IFileViewerSite
  1528. DECLARE_INTERFACE_(IFileViewerSite, IUnknown)
  1529. {
  1530. // *** IUnknown methods ***
  1531. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1532. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1533. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1534. // *** IFileViewerSite methods ***
  1535. STDMETHOD(SetPinnedWindow) (THIS_ HWND hwnd) PURE;
  1536. STDMETHOD(GetPinnedWindow) (THIS_ HWND *phwnd) PURE;
  1537. };
  1538. typedef IFileViewerSite * LPFILEVIEWERSITE;
  1539. //===========================================================================
  1540. //
  1541. // IFileViewer Interface
  1542. //
  1543. // Implemented in a FileViewer component object. Used to tell a
  1544. // FileViewer to PrintTo or to view, the latter happening though
  1545. // ShowInitialize and Show. The filename is always given to the
  1546. // viewer through IPersistFile.
  1547. //
  1548. // History: ;Internal
  1549. // 3/4/94 kraigb Created ;Internal
  1550. // ;Internal
  1551. //===========================================================================
  1552. #include <pshpack8.h>
  1553. typedef struct
  1554. {
  1555. // Stuff passed into viewer (in)
  1556. DWORD cbSize; // Size of structure for future expansion...
  1557. HWND hwndOwner; // who is the owner window.
  1558. int iShow; // The show command
  1559. // Passed in and updated (in/Out)
  1560. DWORD dwFlags; // flags
  1561. RECT rect; // Where to create the window may have defaults
  1562. IUnknown *punkRel; // Relese this interface when window is visible
  1563. // Stuff that might be returned from viewer (out)
  1564. OLECHAR strNewFile[MAX_PATH]; // New File to view.
  1565. } FVSHOWINFO, *LPFVSHOWINFO;
  1566. #include <poppack.h> /* Return to byte packing */
  1567. // Define File View Show Info Flags.
  1568. #define FVSIF_RECT 0x00000001 // The rect variable has valid data.
  1569. #define FVSIF_PINNED 0x00000002 // We should Initialize pinned
  1570. #define FVSIF_NEWFAILED 0x08000000 // The new file passed back failed
  1571. // to be viewed.
  1572. #define FVSIF_NEWFILE 0x80000000 // A new file to view has been returned
  1573. #define FVSIF_CANVIEWIT 0x40000000 // The viewer can view it.
  1574. #undef INTERFACE
  1575. #define INTERFACE IFileViewerA
  1576. DECLARE_INTERFACE(IFileViewerA)
  1577. {
  1578. // *** IUnknown methods ***
  1579. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1580. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1581. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1582. // *** IFileViewer methods ***
  1583. STDMETHOD(ShowInitialize) (THIS_ LPFILEVIEWERSITE lpfsi) PURE;
  1584. STDMETHOD(Show) (THIS_ LPFVSHOWINFO pvsi) PURE;
  1585. STDMETHOD(PrintTo) (THIS_ LPSTR pszDriver, BOOL fSuppressUI) PURE;
  1586. };
  1587. typedef IFileViewerA * LPFILEVIEWERA;
  1588. #undef INTERFACE
  1589. #define INTERFACE IFileViewerW
  1590. DECLARE_INTERFACE(IFileViewerW)
  1591. {
  1592. // *** IUnknown methods ***
  1593. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1594. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1595. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1596. // *** IFileViewer methods ***
  1597. STDMETHOD(ShowInitialize) (THIS_ LPFILEVIEWERSITE lpfsi) PURE;
  1598. STDMETHOD(Show) (THIS_ LPFVSHOWINFO pvsi) PURE;
  1599. STDMETHOD(PrintTo) (THIS_ LPWSTR pszDriver, BOOL fSuppressUI) PURE;
  1600. };
  1601. typedef IFileViewerW * LPFILEVIEWERW;
  1602. #ifdef UNICODE
  1603. #define IFileViewer IFileViewerW
  1604. #define LPFILEVIEWER LPFILEVIEWERW
  1605. #else
  1606. #define IFileViewer IFileViewerA
  1607. #define LPFILEVIEWER LPFILEVIEWERA
  1608. #endif
  1609. ;begin_internal
  1610. // CGID_DefView Command Target IDs. used to persist global DefView state
  1611. enum
  1612. {
  1613. DVID_SETASDEFAULT, // Set the DefView state of this folder as default for all of the same class
  1614. DVID_RESETDEFAULT // Reset the DefView state to the default (delete subkeys)
  1615. };
  1616. // CGID_ShellDocView Command Target IDs. for shell doc view wedge
  1617. enum {
  1618. SHDVID_FINALTITLEAVAIL, // DEAD: variantIn bstr - sent after final OLECMDID_SETTITLE is sent
  1619. SHDVID_MIMECSETMENUOPEN, // mimecharset menu open commands
  1620. SHDVID_PRINTFRAME, // print HTML frame
  1621. SHDVID_PUTOFFLINE, // DEAD: The Offline property has been changed
  1622. SHDVID_PUTSILENT, // DEAD: The frame's Silent property has been changed
  1623. SHDVID_GOBACK, // Navigate Back
  1624. SHDVID_GOFORWARD, // Navigate Forward
  1625. SHDVID_CANGOBACK, // Is Back Navigation Possible?
  1626. SHDVID_CANGOFORWARD, // Is Forward Navigation Possible?
  1627. SHDVID_CANACTIVATENOW, // (down) (PICS) OK to navigate to this view now?
  1628. SHDVID_ACTIVATEMENOW, // (up) (PICS) Rating checks out, navigate now
  1629. SHDVID_CANSUPPORTPICS, // (down) variantIn I4: IOleCommandTarget to reply to
  1630. SHDVID_PICSLABELFOUND, // (up) variantIn bstr: PICS label
  1631. SHDVID_NOMOREPICSLABELS, // (up) End of document, no more PICS labels coming
  1632. SHDVID_CANDEACTIVATENOW, // (QS down) (in script/etc) OK to deactivate view now?
  1633. SHDVID_DEACTIVATEMENOW, // (EXEC up) (in script/etc) out of script, deactivate view now
  1634. SHDVID_NODEACTIVATENOW, // (EXEC up) (in script/etc) entering script, disable deactivate
  1635. SHDVID_AMBIENTPROPCHANGE, // variantIn I4: dispid of ambient property that changed
  1636. SHDVID_GETSYSIMAGEINDEX, // variantOut: image index for current page
  1637. SHDVID_GETPENDINGOBJECT, // variantOut: IUnknown of pending shellview/docobject
  1638. SHDVID_GETPENDINGURL, // variantOut: BSTR of URL for pending docobject
  1639. SHDVID_SETPENDINGURL, // variantIn: BSTR of URL passed to pending docobject
  1640. SHDVID_ISDRAGSOURCE, // (down) varioutOut I4: non-zero if it's initiated drag&drop
  1641. SHDVID_DOCFAMILYCHARSET, // variantOut: I4: windows (family) codepage
  1642. SHDVID_DOCCHARSET, // variantOut: I4: actual (mlang) codepage
  1643. SHDVID_RAISE, // vaIn:I4:DTRF_*, vaOut:NULL unless DTRF_QUERY
  1644. SHDVID_GETTRANSITION, // (down) vaIn: I4: TransitionEvent; vaOut BSTR (CLSID), I4 (dwSpeed)
  1645. SHDVID_GETMIMECSETMENU, // get menu handle for mimecharset
  1646. SHDVID_DOCWRITEABORT, // Abort binding but activate pending docobject
  1647. SHDVID_SETPRINTSTATUS, // VariantIn: BOOL, TRUE - Started printing, FALSE - Finished printing
  1648. SHDVID_NAVIGATIONSTATUS, // QS for tooltip text and Exec when user clicks
  1649. SHDVID_PROGRESSSTATUS, // QS for tooltip text and Exec when user clicks
  1650. SHDVID_ONLINESTATUS, // QS for tooltip text and Exec when user clicks
  1651. SHDVID_SSLSTATUS, // QS for tooltip text and Exec when user clicks
  1652. SHDVID_PRINTSTATUS, // QS for tooltip text and Exec when user clicks
  1653. SHDVID_ZONESTATUS, // QS for tooltip text and Exec when user clicks
  1654. SHDVID_ONCODEPAGECHANGE, // variantIn I4: new specified codepage
  1655. SHDVID_SETSECURELOCK, // set the secure icon
  1656. SHDVID_SHOWBROWSERBAR, // show browser bar of clsid guid
  1657. SHDVID_NAVIGATEBB, // navigate to pidl in browserbar.
  1658. SHDVID_UPDATEOFFLINEDESKTOP,// put the desktop in ON-LINE mode, update and put it back in Offline mode
  1659. SHDVID_PICSBLOCKINGUI, // (up) In I4: pointer to "ratings nugget" for block API
  1660. SHDVID_ONCOLORSCHANGE, // (up) sent by mshtml to indicate color set change
  1661. SHDVID_CANDOCOLORSCHANGE, // (down) used to query if document supports the above
  1662. SHDVID_QUERYMERGEDHELPMENU, // was the help menu micro-merged?
  1663. SHDVID_QUERYOBJECTSHELPMENU,// return the object's help menu
  1664. SHDVID_HELP, // do help
  1665. SHDVID_UEMLOG, // set UEM logging vaIn:I4:UEMIND_*, vaOut:NULL
  1666. SHDVID_GETBROWSERBAR, // get IDeskBand for browser bar of clsid guid
  1667. SHDVID_GETFONTMENU,
  1668. SHDVID_FONTMENUOPEN,
  1669. SHDVID_CLSIDTOIDM, // get the idm for the given clsid
  1670. SHDVID_GETDOCDIRMENU, // get menu handle for document direction
  1671. SHDVID_ADDMENUEXTENSIONS, // Context Menu Extensions
  1672. SHDVID_CLSIDTOMONIKER, // CLSID to property page resource mapping
  1673. SHDVID_RESETSTATUSBAR, // set the status bar back to "normal" icon w/out text
  1674. SHDVID_ISBROWSERBARVISIBLE, // is browser bar of clsid guid visible?
  1675. SHDVID_GETOPTIONSHWND, // gets hwnd for internet options prop sheet (NULL if not open)
  1676. SHDVID_DELEGATEWINDOWOM, // set policy for whether window OM methods should be delegated.
  1677. SHDVID_PAGEFROMPOSTDATA, // determines if page was generated by post data
  1678. SHDVID_DISPLAYSCRIPTERRORS, // tells the top docobject host to display his script err dialog
  1679. SHDVID_NAVIGATEBBTOURL, // Navigate to an URL in browserbar (used in Trident).
  1680. SHDVID_NAVIGATEFROMDOC, // The document delegated the navigation for a non-html mime-type.
  1681. SHDVID_STARTPICSFORWINDOW, // (up) variantIn: IUnknown of window that is navigating
  1682. // variantOut: bool if pics process started
  1683. SHDVID_CANCELPICSFORWINDOW, // (up) variantIn: IUnknown of window that is no longer navigating
  1684. SHDVID_ISPICSENABLED, // (up) variantOut: bool
  1685. SHDVID_PICSLABELFOUNDINHTTPHEADER,// (up) variantIn bstr: PICS label
  1686. SHDVID_CHECKINCACHEIFOFFLINE, // Check in cache if offline
  1687. SHDVID_CHECKDONTUPDATETLOG, // check if the current navigate is already dealing with the travellog correctly
  1688. SHDVID_UPDATEDOCHOSTSTATE, // Sent from CBaseBrowser2::_UpdateBrowserState to tell the dochost to update its state.
  1689. SHDVID_FIREFILEDOWNLOAD,
  1690. SHDVID_COMPLETEDOCHOSTPASSING,
  1691. SHDVID_NAVSTART,
  1692. SHDVID_SETNAVIGATABLECODEPAGE,
  1693. SHDVID_WINDOWOPEN,
  1694. SHDVID_PRIVACYSTATUS, // QS for tooltip text and exec when user clicks
  1695. SHDVID_FORWARDSECURELOCK, // asks CDocObjectHost to forward its security status up to the shell browser
  1696. SHDVID_ISEXPLORERBARVISIBLE, // is any explorer bar visible?
  1697. };
  1698. // CGID_DocHostCmdPriv Command Target IDs
  1699. //
  1700. enum
  1701. {
  1702. DOCHOST_DOCCANNAVIGATE, // The document knows how to navigate.
  1703. DOCHOST_NAVIGATION_ERROR, // Navigation Error
  1704. DOCHOST_DOCHYPERLINK, // The document is navigating.
  1705. DOCHOST_SENDINGREQUEST, // The document is sending a request for download. Update the progress bar.
  1706. DOCHOST_FINDINGRESOURCE, // The document is finding a resource. Update the progress bar.
  1707. DOCHOST_RESETSEARCHINFO, // Reset search information (after a successful navigation)
  1708. DOCHOST_SETBROWSERINDEX, // Sets the browser ID to use for TravelLog and frame targeting
  1709. DOCHOST_NOTE_ERROR_PAGE, // Need to know when we're navigating to an error web page.
  1710. DOCHOST_READYSTATE_INTERACTIVE, // a document on a page is readystate interactive
  1711. DOCHOST_CONTENTDISPOSITIONATTACH // The document needs to be saved.
  1712. };
  1713. // CGID_SearchBand Command Target IDs.
  1714. enum {
  1715. SBID_SEARCH_NEW, // (re)load the context-appropriate url
  1716. SBID_SEARCH_NEXT, // cycle between multiple providers
  1717. SBID_SEARCH_CUSTOMIZE, // navigate to customization url
  1718. SBID_SEARCH_HELP, // what it says
  1719. SBID_GETPIDL, // get the search pane's pidl
  1720. SBID_HASPIDL, // does the search pane have a pidl (i.e, has it navigated)
  1721. };
  1722. // CGID_MediaBar target ids
  1723. enum {
  1724. MBID_PLAY, // Play an url
  1725. MBID_POPOUT // Detect state of player
  1726. };
  1727. enum {
  1728. MB_DOCKED,
  1729. MB_POPOUT
  1730. };
  1731. //
  1732. // Private struct passed as argument to SHDVID_UPDATEDOCHOSTSTATE
  1733. //
  1734. struct DOCHOSTUPDATEDATA
  1735. {
  1736. LPITEMIDLIST _pidl;
  1737. BOOL _fIsErrorUrl;
  1738. };
  1739. //
  1740. // this enum is used by SHDVID_SETSECURELOCK and SBCMDID_SETSECURELOCKICON
  1741. // when adding new values, make sure to add to both SET and SUGGEST, and
  1742. // the code depends on a direct correlation between the level of security
  1743. // and the value of the enum. so keep new values in the correct order
  1744. //
  1745. enum {
  1746. SECURELOCK_NOCHANGE = -1,
  1747. SECURELOCK_SET_UNSECURE = 0,
  1748. SECURELOCK_SET_MIXED,
  1749. SECURELOCK_SET_SECUREUNKNOWNBIT,
  1750. SECURELOCK_SET_SECURE40BIT,
  1751. SECURELOCK_SET_SECURE56BIT,
  1752. SECURELOCK_SET_FORTEZZA,
  1753. SECURELOCK_SET_SECURE128BIT,
  1754. SECURELOCK_FIRSTSUGGEST,
  1755. SECURELOCK_SUGGEST_UNSECURE = SECURELOCK_FIRSTSUGGEST,
  1756. SECURELOCK_SUGGEST_MIXED,
  1757. SECURELOCK_SUGGEST_SECUREUNKNOWNBIT,
  1758. SECURELOCK_SUGGEST_SECURE40BIT,
  1759. SECURELOCK_SUGGEST_SECURE56BIT,
  1760. SECURELOCK_SUGGEST_FORTEZZA,
  1761. SECURELOCK_SUGGEST_SECURE128BIT,
  1762. };
  1763. ;end_internal
  1764. //==========================================================================
  1765. //
  1766. // IShellBrowser/IShellView/IShellFolder interface
  1767. //
  1768. // These three interfaces are used when the shell communicates with
  1769. // name space extensions. The shell (explorer) provides IShellBrowser
  1770. // interface, and extensions implements IShellFolder and IShellView
  1771. // interfaces.
  1772. //
  1773. //==========================================================================
  1774. //--------------------------------------------------------------------------
  1775. //
  1776. // Command/menuitem IDs
  1777. //
  1778. // The explorer dispatches WM_COMMAND messages based on the range of
  1779. // command/menuitem IDs. All the IDs of menuitems that the view (right
  1780. // pane) inserts must be in FCIDM_SHVIEWFIRST/LAST (otherwise, the explorer
  1781. // won't dispatch them). The view should not deal with any menuitems
  1782. // in FCIDM_BROWSERFIRST/LAST (otherwise, it won't work with the future
  1783. // version of the shell).
  1784. //
  1785. // FCIDM_SHVIEWFIRST/LAST for the right pane (IShellView)
  1786. // FCIDM_BROWSERFIRST/LAST for the explorer frame (IShellBrowser)
  1787. // FCIDM_GLOBAL/LAST for the explorer's submenu IDs
  1788. //
  1789. //--------------------------------------------------------------------------
  1790. #define FCIDM_SHVIEWFIRST 0x0000
  1791. #define FCIDM_SHVIEWLAST 0x7fff
  1792. #define FCIDM_BROWSERFIRST 0xa000
  1793. #define FCIDM_BROWSERLAST 0xbf00
  1794. #define FCIDM_GLOBALFIRST 0x8000
  1795. #define FCIDM_GLOBALLAST 0x9fff
  1796. //
  1797. // Global submenu IDs and separator IDs
  1798. //
  1799. #define FCIDM_MENU_FILE (FCIDM_GLOBALFIRST+0x0000)
  1800. #define FCIDM_MENU_EDIT (FCIDM_GLOBALFIRST+0x0040)
  1801. #define FCIDM_MENU_VIEW (FCIDM_GLOBALFIRST+0x0080)
  1802. #define FCIDM_MENU_VIEW_SEP_OPTIONS (FCIDM_GLOBALFIRST+0x0081)
  1803. #define FCIDM_MENU_TOOLS (FCIDM_GLOBALFIRST+0x00c0) // for Win9x compat
  1804. #define FCIDM_MENU_TOOLS_SEP_GOTO (FCIDM_GLOBALFIRST+0x00c1) // for Win9x compat
  1805. #define FCIDM_MENU_HELP (FCIDM_GLOBALFIRST+0x0100)
  1806. #define FCIDM_MENU_FIND (FCIDM_GLOBALFIRST+0x0140)
  1807. #define FCIDM_MENU_EXPLORE (FCIDM_GLOBALFIRST+0x0150)
  1808. #define FCIDM_MENU_FAVORITES (FCIDM_GLOBALFIRST+0x0170)
  1809. //--------------------------------------------------------------------------
  1810. // control IDs known to the view
  1811. //--------------------------------------------------------------------------
  1812. #define FCIDM_TOOLBAR (FCIDM_BROWSERFIRST + 0)
  1813. #define FCIDM_STATUS (FCIDM_BROWSERFIRST + 1)
  1814. #define FCIDM_DRIVELIST (FCIDM_BROWSERFIRST + 2) // ;Internal
  1815. #define FCIDM_TREE (FCIDM_BROWSERFIRST + 3) // ;Internal
  1816. #define FCIDM_TABS (FCIDM_BROWSERFIRST + 4) // ;Internal
  1817. #define FCIDM_REBAR (FCIDM_BROWSERFIRST + 5) // ;Internal
  1818. #if (_WIN32_IE >= 0x0400)
  1819. //--------------------------------------------------------------------------
  1820. //
  1821. // The resource id of the offline cursor
  1822. // This cursor is avaialble in shdocvw.dll
  1823. #define IDC_OFFLINE_HAND 103
  1824. //
  1825. //--------------------------------------------------------------------------
  1826. #endif
  1827. ;begin_internal
  1828. // SBCMDID_SHOWCONTROL
  1829. enum {
  1830. SBSC_HIDE = 0,
  1831. SBSC_SHOW = 1,
  1832. SBSC_TOGGLE = 2,
  1833. SBSC_QUERY = 3
  1834. };
  1835. // SBCMDID_OPTIONS
  1836. enum {
  1837. SBO_DEFAULT = 0 ,
  1838. SBO_NOBROWSERPAGES = 1
  1839. };
  1840. // CGID_Explorer Command Target IDs
  1841. enum {
  1842. SBCMDID_ENABLESHOWTREE = 0,
  1843. SBCMDID_SHOWCONTROL = 1, // variant vt_i4 = loword = FCW_* hiword = SBSC_*
  1844. SBCMDID_CANCELNAVIGATION = 2, // cancel last navigation
  1845. SBCMDID_MAYSAVECHANGES = 3, // about to close and may save changes
  1846. SBCMDID_SETHLINKFRAME = 4, // variant vt_i4 = phlinkframe
  1847. SBCMDID_ENABLESTOP = 5, // variant vt_bool = fEnable
  1848. SBCMDID_OPTIONS = 6, // the view.options page
  1849. SBCMDID_EXPLORER = 7, // are you explorer.exe?
  1850. SBCMDID_ADDTOFAVORITES = 8,
  1851. SBCMDID_ACTIVEOBJECTMENUS = 9,
  1852. SBCMDID_MAYSAVEVIEWSTATE = 10, // Should we save view stream
  1853. SBCMDID_DOFAVORITESMENU = 11, // popup the favorites menu
  1854. SBCMDID_DOMAILMENU = 12, // popup the mail menu
  1855. SBCMDID_GETADDRESSBARTEXT = 13, // get user-typed text
  1856. SBCMDID_ASYNCNAVIGATION = 14, // do an async navigation
  1857. SBCMDID_SEARCHBAROBSOLETE = 15, // OBSOLETE beta-1 SEARCHBAR
  1858. SBCMDID_FLUSHOBJECTCACHE = 16, // flush object cache
  1859. SBCMDID_CREATESHORTCUT = 17, // create a shortcut
  1860. SBCMDID_SETMERGEDWEBMENU = 18, // set pre-merged menu for HTML
  1861. SBCMDID_REMOVELOCKICON = 19, // Remove lock icon
  1862. SBCMDID_SELECTHISTPIDL = 20, // QS:EXEC select history pidl on navigate
  1863. SBCMDID_WRITEHIST = 21, // QS only:write history sf on navigate
  1864. SBCMDID_GETHISTPIDL = 22, // EXEC gets most recent history pidl
  1865. SBCMDID_REGISTERNSCBAND = 23, // EXEC registers NscBand when visible
  1866. SBCMDID_COCREATEDOCUMENT = 24, // Create an instance of MSHTML
  1867. SBCMDID_SETSECURELOCKICON = 25, // sets the SSL lock icon for the current page
  1868. SBCMDID_INITFILECTXMENU = 26, // EXEC,QS: file context menu for band item
  1869. SBCMDID_UNREGISTERNSCBAND = 27, // EXEC unregisters NscBand when invisible
  1870. SBCMDID_SEARCHBAR = 28, // show/hide/toggle BrowserBar search
  1871. SBCMDID_HISTORYBAR = 29, // show/hide/toggle BrowserBar history
  1872. SBCMDID_FAVORITESBAR = 30, // show/hide/toggle BrowserBar favorites
  1873. #ifdef ENABLE_CHANNELS
  1874. SBCMDID_CHANNELSBAR = 31, // show/hide/toggle BrowserBar channels
  1875. #endif
  1876. SBCMDID_SENDPAGE = 32, // sends the current page via email
  1877. SBCMDID_SENDSHORTCUT = 33, // sends a shortcut to current page via email
  1878. SBCMDID_TOOLBAREMPTY = 34, // toolbar has nothing visible
  1879. SBCMDID_EXPLORERBAR = 35, // show/hide/toggle BrowserBar all folders
  1880. SBCMDID_GETUSERADDRESSBARTEXT = 36, // get the exact text the user-entered
  1881. SBCMDID_HISTSFOLDER = 37, // EXEC varOut returns cached history IShellFolder
  1882. SBCMDID_UPDATETRAVELLOG = 38, // updates the travellog with the current info
  1883. SBCMDID_MIXEDZONE = 39, // The current view has mixed zones
  1884. SBCMDID_REPLACELOCATION = 40, // replace the current URL with this one.
  1885. SBCMDID_GETPANE = 41, // Browser asks the view for pane ordinal
  1886. SBCMDID_FILERENAME = 42, // Browser forwards file->rename to explorer bar
  1887. SBCMDID_FILEDELETE = 43, // Browser forwards file->delete to explorer bar
  1888. SBCMDID_FILEPROPERTIES = 44, // Browser forwards file->properties to explorer bar
  1889. SBCMDID_IESHORTCUT = 45, // Navigates the browser to an .url file
  1890. SBCMDID_GETSHORTCUTPATH = 46, // Asks for the path to the shortcut - if it exists
  1891. SBCMDID_DISCUSSIONBAND = 47, // show/hide/toggle the Office discussion band
  1892. SBCMDID_SETADDRESSBARFOCUS = 48, // Set focus on address bar on WM_ACTIVATE (UNIX)
  1893. SBCMDID_HASADDRESSBARFOCUS = 49, // Checks whether address bar has focus (UNIX)
  1894. SBCMDID_MSGBAND = 50, // MsgBand Message (UNIX)
  1895. SBCMDID_ISIEMODEBROWSER = 51, // returns S_OK if browser is in IE mode
  1896. SBCMDID_GETTEMPLATEMENU = 52, // get handle to template menu
  1897. SBCMDID_GETCURRENTMENU = 53, // get handle to current menu
  1898. SBCMDID_ERRORPAGE = 54, // informs addressbar mru that this is an error page
  1899. SBCMDID_AUTOSEARCHING = 55, // informs addressbar mru that we are trying a new url
  1900. SBCMDID_STARTEDFORINTERNET = 56, // return S_OK if window started as IE window, S_FALSE otherwise
  1901. SBCMDID_ISBROWSERACTIVE = 57, // return S_OK if the browser is active, S_FALSE otherwise
  1902. SBCMDID_SUGGESTSAVEWINPOS = 58, // return S_OK if browser decides to save window position, S_FALSE otherwise
  1903. SBCMDID_CACHEINETZONEICON = 59, // Cache/refresh internet zone icons painted by status bar
  1904. SBCMDID_ONVIEWMOVETOTOP = 60, // Notification that the view window has moved to HWND_TOP
  1905. SBCMDID_ONCLOSE = 61, // Close notification destined for the dochost.
  1906. SBCMDID_CANCELANDCLOSE = 62, // Cancel the async download and close the browser.
  1907. SBCMDID_MEDIABAR = 63, // show/hide/toggle MediaBar
  1908. };
  1909. #define ZONE_UNKNOWN -1
  1910. #define ZONE_MIXED -2
  1911. #define IS_SPECIAL_ZONE(a) (((a) == ZONE_UNKNOWN) || ((a) == ZONE_MIXED))
  1912. ;end_internal
  1913. // SBCMDID_GETPANE - not necessarily in order
  1914. #define PANE_NONE -1
  1915. #define PANE_ZONE 1
  1916. #define PANE_OFFLINE 2
  1917. #define PANE_PRINTER 3
  1918. #define PANE_SSL 4
  1919. #define PANE_NAVIGATION 5
  1920. #define PANE_PROGRESS 6
  1921. #define PANE_PRIVACY 7
  1922. ;begin_internal
  1923. #if (_WIN32_IE >= 0x0400)
  1924. // CGID_AddresseditBox Command Target IDs
  1925. enum {
  1926. AECMDID_SAVE = 0, // Ask AddressEditBox to save
  1927. };
  1928. #endif
  1929. ;end_internal
  1930. //-------------------------------------------------------------------------
  1931. // ICommDlgBrowser interface
  1932. //
  1933. // ICommDlgBrowser interface is the interface that is provided by the new
  1934. // common dialog window to hook and modify the behavior of IShellView. When
  1935. // a default view is created, it queries its parent IShellBrowser for the
  1936. // ICommDlgBrowser interface. If supported, it calls out to that interface
  1937. // in several cases that need to behave differently in a dialog.
  1938. //
  1939. // Member functions:
  1940. //
  1941. // ICommDlgBrowser::OnDefaultCommand()
  1942. // Called when the user double-clicks in the view or presses Enter. The
  1943. // browser should return S_OK if it processed the action itself, S_FALSE
  1944. // to let the view perform the default action.
  1945. //
  1946. // ICommDlgBrowser::OnStateChange(ULONG uChange)
  1947. // Called when some states in the view change. 'uChange' is one of the
  1948. // CDBOSC_* values. This call is made after the state (selection, focus,
  1949. // etc) has changed. There is no return value.
  1950. //
  1951. // ICommDlgBrowser::IncludeObject(LPCITEMIDLIST pidl)
  1952. // Called when the view is enumerating objects. 'pidl' is a relative
  1953. // IDLIST. The browser should return S_OK to include the object in the
  1954. // view, S_FALSE to hide it
  1955. //
  1956. //-------------------------------------------------------------------------
  1957. #define CDBOSC_SETFOCUS 0x00000000
  1958. #define CDBOSC_KILLFOCUS 0x00000001
  1959. #define CDBOSC_SELCHANGE 0x00000002
  1960. #define CDBOSC_RENAME 0x00000003
  1961. #define CDBOSC_STATECHANGE 0x00000004
  1962. #undef INTERFACE
  1963. #define INTERFACE ICommDlgBrowser
  1964. DECLARE_INTERFACE_(ICommDlgBrowser, IUnknown)
  1965. {
  1966. // *** IUnknown methods ***
  1967. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1968. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1969. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1970. // *** ICommDlgBrowser methods ***
  1971. STDMETHOD(OnDefaultCommand) (THIS_ struct IShellView * ppshv) PURE;
  1972. STDMETHOD(OnStateChange) (THIS_ struct IShellView * ppshv,
  1973. ULONG uChange) PURE;
  1974. STDMETHOD(IncludeObject) (THIS_ struct IShellView * ppshv,
  1975. LPCITEMIDLIST pidl) PURE;
  1976. };
  1977. typedef ICommDlgBrowser * LPCOMMDLGBROWSER;
  1978. //-------------------------------------------------------------------------
  1979. // ICommDlgBrowser2 interface
  1980. //
  1981. // Member functions:
  1982. //
  1983. // ICommDlgBrowser2::Notify(IShellView *pshv, DWORD dwNotfyType)
  1984. // Called when the view is wants to notify common dialog when an event
  1985. // occurrs.
  1986. //
  1987. // CDB2N_CONTEXTMENU_START indicates the context menu has started.
  1988. // CDB2N_CONTEXTMENU_DONE indicates the context menu has completed.
  1989. //
  1990. // ICommDlgBrowser2::GetDefaultMenuText(IShellView *pshv,
  1991. // WCHAR *pszText, INT cchMax)
  1992. // Called when the view wants to get the default context menu text.
  1993. // pszText points to buffer and cchMax specifies the size of the
  1994. // buffer in characters. The browser on return has filled the buffer
  1995. // with the default context menu text. The Shell will call this method
  1996. // with at least a buffer size of MAX_PATH. The browser should return
  1997. // S_OK if it returned a new default menu text, S_FALSE to let the view
  1998. // to use the normal default menu text.
  1999. //
  2000. // ICommDlgBrowser2::GetViewFlags(DWORD *pdwFlags)
  2001. // Called when the view wants to determine if special customization needs to
  2002. // be done for the common dialog browser. For example View calls this function to
  2003. // determin if all files(hidden and system)needs to be shown. If the GetViewFlags returns a DWORD with
  2004. // CDB2GVF_SHOWALLFILES flag set then it will show all the files.
  2005. //-------------------------------------------------------------------------
  2006. #define CDB2N_CONTEXTMENU_DONE 0x00000001
  2007. #define CDB2N_CONTEXTMENU_START 0x00000002
  2008. //GetViewFlags
  2009. #define CDB2GVF_SHOWALLFILES 0x00000001
  2010. #undef INTERFACE
  2011. #define INTERFACE ICommDlgBrowser2
  2012. DECLARE_INTERFACE_(ICommDlgBrowser2, IUnknown)
  2013. {
  2014. // *** IUnknown methods ***
  2015. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2016. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2017. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2018. // *** ICommDlgBrowser methods ***
  2019. STDMETHOD(OnDefaultCommand) (THIS_ struct IShellView * ppshv) PURE;
  2020. STDMETHOD(OnStateChange) (THIS_ struct IShellView * ppshv,
  2021. ULONG uChange) PURE;
  2022. STDMETHOD(IncludeObject) (THIS_ struct IShellView * ppshv,
  2023. LPCITEMIDLIST pidl) PURE;
  2024. // *** ICommDlgBrowser2 methods ***
  2025. STDMETHOD(Notify) (THIS_ struct IShellView * ppshv,
  2026. DWORD dwNotifyType) PURE;
  2027. STDMETHOD(GetDefaultMenuText) (THIS_ struct IShellView * ppshv,
  2028. WCHAR *pszText, INT cchMax) PURE;
  2029. STDMETHOD(GetViewFlags)(THIS_ DWORD *pdwFlags) PURE;
  2030. };
  2031. typedef ICommDlgBrowser2 * LPCOMMDLGBROWSER2;
  2032. ;begin_internal
  2033. #ifdef NONAMELESSUNION
  2034. #define NAMELESS_MEMBER(member) DUMMYUNIONNAME.##member
  2035. #else
  2036. #define NAMELESS_MEMBER(member) member
  2037. #endif
  2038. #define STRRET_OLESTR STRRET_WSTR // same as STRRET_WSTR
  2039. #define STRRET_OFFPTR(pidl,lpstrret) ((LPSTR)((LPBYTE)(pidl)+(lpstrret)->NAMELESS_MEMBER(uOffset)))
  2040. ;end_internal
  2041. //
  2042. // function assumes the size of the buffer (MAX_PATH). The pidl
  2043. // should point to a file system object.
  2044. SHSTDAPI_(BOOL) SHGetPathFromIDList%(LPCITEMIDLIST pidl, LPTSTR% pszPath);
  2045. ;begin_internal
  2046. // DOC'ed for DOJ compliance
  2047. ;end_internal
  2048. SHSTDAPI_(int) SHCreateDirectory(HWND hwnd, LPCWSTR pszPath);
  2049. SHSTDAPI_(int) SHCreateDirectoryEx%(HWND hwnd, LPCTSTR% pszPath, SECURITY_ATTRIBUTES *psa);
  2050. SHSTDAPI SHOpenFolderAndSelectItems(LPCITEMIDLIST pidlFolder, UINT cidl, LPCITEMIDLIST *apidl, DWORD dwFlags);
  2051. SHSTDAPI SHCreateShellItem(LPCITEMIDLIST pidlParent, IShellFolder *psfParent, LPCITEMIDLIST pidl, IShellItem **ppsi);
  2052. ;begin_internal
  2053. SHSTDAPI SHParseShellItem(LPCWSTR psz, IShellItem **ppsi);
  2054. SHSTDAPI SIEnumObjects(IShellItem *psi, HWND hwnd, SHCONTF flags, IEnumShellItems **ppenum);
  2055. SHSTDAPI SHCreateShellItemArray(LPCITEMIDLIST pidlParent,IShellFolder *psfParent,UINT cidl,
  2056. LPCITEMIDLIST *ppidl,IShellItemArray **ppsiItemArray);
  2057. ;end_internal
  2058. //-------------------------------------------------------------------------
  2059. //
  2060. // SHGetSpecialFolderLocation
  2061. //
  2062. // Caller should use SHGetMalloc to obtain an allocator that can free the pidl
  2063. //
  2064. //
  2065. //-------------------------------------------------------------------------
  2066. //
  2067. // registry entries for special paths are kept in :
  2068. #define REGSTR_PATH_SPECIAL_FOLDERS REGSTR_PATH_EXPLORER TEXT("\\Shell Folders")
  2069. #define REGSTR_PATH_INTERNET_EXPLORER TEXT("\\SOFTWARE\\Microsoft\\Internet Explorer") ; Internal
  2070. #define REGSTR_PATH_IE_MAIN REGSTR_PATH_INTERNET_EXPLORER TEXT("\\Main") ; Internal
  2071. #define REGSTR_VALUE_USER_AGENT TEXT("UserAgent") ; Internal
  2072. #define REGSTR_DEFAULT_USER_AGENT TEXT("Mozilla/2.0 (compatible; MSIE 3.0A; Windows 95)") ; Internal
  2073. #define CSIDL_DESKTOP 0x0000 // <desktop>
  2074. #define CSIDL_INTERNET 0x0001 // Internet Explorer (icon on desktop)
  2075. #define CSIDL_PROGRAMS 0x0002 // Start Menu\Programs
  2076. #define CSIDL_CONTROLS 0x0003 // My Computer\Control Panel
  2077. #define CSIDL_PRINTERS 0x0004 // My Computer\Printers
  2078. #define CSIDL_PERSONAL 0x0005 // My Documents
  2079. #define CSIDL_FAVORITES 0x0006 // <user name>\Favorites
  2080. #define CSIDL_STARTUP 0x0007 // Start Menu\Programs\Startup
  2081. #define CSIDL_RECENT 0x0008 // <user name>\Recent
  2082. #define CSIDL_SENDTO 0x0009 // <user name>\SendTo
  2083. #define CSIDL_BITBUCKET 0x000a // <desktop>\Recycle Bin
  2084. #define CSIDL_STARTMENU 0x000b // <user name>\Start Menu
  2085. #define CSIDL_MYDOCUMENTS 0x000c // logical "My Documents" desktop icon
  2086. #define CSIDL_MYMUSIC 0x000d // "My Music" folder
  2087. #define CSIDL_MYVIDEO 0x000e // "My Videos" folder
  2088. // 0x000f ;Internal
  2089. #define CSIDL_DESKTOPDIRECTORY 0x0010 // <user name>\Desktop
  2090. #define CSIDL_DRIVES 0x0011 // My Computer
  2091. #define CSIDL_NETWORK 0x0012 // Network Neighborhood (My Network Places)
  2092. #define CSIDL_NETHOOD 0x0013 // <user name>\nethood
  2093. #define CSIDL_FONTS 0x0014 // windows\fonts
  2094. #define CSIDL_TEMPLATES 0x0015
  2095. #define CSIDL_COMMON_STARTMENU 0x0016 // All Users\Start Menu
  2096. #define CSIDL_COMMON_PROGRAMS 0X0017 // All Users\Start Menu\Programs
  2097. #define CSIDL_COMMON_STARTUP 0x0018 // All Users\Startup
  2098. #define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019 // All Users\Desktop
  2099. #define CSIDL_APPDATA 0x001a // <user name>\Application Data
  2100. #define CSIDL_PRINTHOOD 0x001b // <user name>\PrintHood
  2101. #ifndef CSIDL_LOCAL_APPDATA
  2102. #define CSIDL_LOCAL_APPDATA 0x001c // <user name>\Local Settings\Applicaiton Data (non roaming)
  2103. #endif // CSIDL_LOCAL_APPDATA
  2104. #define CSIDL_ALTSTARTUP 0x001d // non localized startup
  2105. #define CSIDL_COMMON_ALTSTARTUP 0x001e // non localized common startup
  2106. #define CSIDL_COMMON_FAVORITES 0x001f
  2107. #ifndef _SHFOLDER_H_
  2108. #define CSIDL_INTERNET_CACHE 0x0020
  2109. #define CSIDL_COOKIES 0x0021
  2110. #define CSIDL_HISTORY 0x0022
  2111. #define CSIDL_COMMON_APPDATA 0x0023 // All Users\Application Data
  2112. #define CSIDL_WINDOWS 0x0024 // GetWindowsDirectory()
  2113. #define CSIDL_SYSTEM 0x0025 // GetSystemDirectory()
  2114. #define CSIDL_PROGRAM_FILES 0x0026 // C:\Program Files
  2115. #define CSIDL_MYPICTURES 0x0027 // C:\Program Files\My Pictures
  2116. #endif // _SHFOLDER_H_
  2117. #define CSIDL_PROFILE 0x0028 // USERPROFILE
  2118. #define CSIDL_SYSTEMX86 0x0029 // x86 system directory on RISC
  2119. #define CSIDL_PROGRAM_FILESX86 0x002a // x86 C:\Program Files on RISC
  2120. #ifndef _SHFOLDER_H_
  2121. #define CSIDL_PROGRAM_FILES_COMMON 0x002b // C:\Program Files\Common
  2122. #endif // _SHFOLDER_H_
  2123. #define CSIDL_PROGRAM_FILES_COMMONX86 0x002c // x86 Program Files\Common on RISC
  2124. #define CSIDL_COMMON_TEMPLATES 0x002d // All Users\Templates
  2125. #ifndef _SHFOLDER_H_
  2126. #define CSIDL_COMMON_DOCUMENTS 0x002e // All Users\Documents
  2127. #define CSIDL_COMMON_ADMINTOOLS 0x002f // All Users\Start Menu\Programs\Administrative Tools
  2128. #define CSIDL_ADMINTOOLS 0x0030 // <user name>\Start Menu\Programs\Administrative Tools
  2129. #endif // _SHFOLDER_H_
  2130. #define CSIDL_CONNECTIONS 0x0031 // Network and Dial-up Connections
  2131. #define CSIDL_PERUSER_TEMP 0x0032 // per user TEMP (reserved, not impelemented);Internal
  2132. #define CSIDL_9XCOMMAND 0x0033 // Win9x COMMANDN (dos programs) (reserved, not impelemented);Internal
  2133. #define CSIDL_9XSYSTEM 0x0034 // Win9x/NT system (not system32) (reserved, not impelemented);Internal
  2134. #define CSIDL_COMMON_MUSIC 0x0035 // All Users\My Music
  2135. #define CSIDL_COMMON_PICTURES 0x0036 // All Users\My Pictures
  2136. #define CSIDL_COMMON_VIDEO 0x0037 // All Users\My Video
  2137. #define CSIDL_RESOURCES 0x0038 // Resource Direcotry
  2138. #ifndef _SHFOLDER_H_
  2139. #define CSIDL_RESOURCES_LOCALIZED 0x0039 // Localized Resource Direcotry
  2140. #endif // _SHFOLDER_H_
  2141. #define CSIDL_COMMON_OEM_LINKS 0x003a // Links to All Users OEM specific apps
  2142. #define CSIDL_CDBURN_AREA 0x003b // USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning
  2143. // unused 0x003c
  2144. #define CSIDL_COMPUTERSNEARME 0x003d // Computers Near Me (computered from Workgroup membership)
  2145. #ifndef _SHFOLDER_H_
  2146. #define CSIDL_FLAG_CREATE 0x8000 // combine with CSIDL_ value to force folder creation in SHGetFolderPath()
  2147. #endif // _SHFOLDER_H_
  2148. #define CSIDL_FLAG_DONT_VERIFY 0x4000 // combine with CSIDL_ value to return an unverified folder path
  2149. ;begin_internal
  2150. #define CSIDL_FLAG_DONT_UNEXPAND 0x2000 // combine with CSIDL_ value to avoid unexpanding environment variables
  2151. ;end_internal
  2152. #define CSIDL_FLAG_NO_ALIAS 0x1000 // combine with CSIDL_ value to insure non-alias versions of the pidl
  2153. #define CSIDL_FLAG_PER_USER_INIT 0x0800 // combine with CSIDL_ value to indicate per-user init (eg. upgrade)
  2154. #define CSIDL_FLAG_MASK 0xFF00 // mask for all possible flag values
  2155. SHSTDAPI SHGetSpecialFolderLocation(HWND hwnd, int csidl, LPITEMIDLIST *ppidl);
  2156. #if (_WIN32_IE >= 0x0400)
  2157. ;begin_internal
  2158. // DOC'ed for DOJ compliance
  2159. ;end_internal
  2160. SHSTDAPI_(void) SHFlushSFCache(void);
  2161. SHSTDAPI_(LPITEMIDLIST) SHCloneSpecialIDList(HWND hwnd, int csidl, BOOL fCreate);
  2162. SHSTDAPI_(BOOL) SHGetSpecialFolderPath%(HWND hwnd, LPTSTR% pszPath, int csidl, BOOL fCreate);
  2163. #if (_WIN32_IE >= 0x0500)
  2164. typedef enum {
  2165. SHGFP_TYPE_CURRENT = 0, // current value for user, verify it exists
  2166. SHGFP_TYPE_DEFAULT = 1, // default value, may not exist
  2167. } SHGFP_TYPE;
  2168. SHFOLDERAPI SHGetFolderPath%(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPTSTR% pszPath);
  2169. SHSTDAPI SHGetFolderLocation(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPITEMIDLIST *ppidl);
  2170. SHFOLDERAPI SHGetFolderPathAndSubDir%(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPCTSTR% pszSubDir, LPTSTR% pszPath);
  2171. ;begin_internal
  2172. SHFOLDERAPI SHSetFolderPath%(int csidl, HANDLE hToken, DWORD dwFlags, LPCTSTR% pszPath);
  2173. SHSTDAPI_(BOOL) MakeShellURLFromPath%(LPCTSTR% pszPathIn, LPTSTR% pszUrl, DWORD dwCch);
  2174. SHSTDAPI_(BOOL) SHIsTempDisplayMode();
  2175. SHSTDAPI_(FILEDESCRIPTOR *) GetFileDescriptor(FILEGROUPDESCRIPTOR *pfgd, BOOL fUnicode, int nIndex, LPTSTR pszName);
  2176. SHSTDAPI CopyStreamUI(IStream *pstmSrc, IStream *pstmDest, IProgressDialog *pdlg, ULONGLONG ullMaxBytes);
  2177. ;end_internal
  2178. #endif // _WIN32_IE >= 0x0500
  2179. #endif // _WIN32_IE >= 0x0400
  2180. ;begin_internal
  2181. // DOC'ed for DOJ compliance
  2182. ;end_internal
  2183. #if (_WIN32_IE >= 0x0500)
  2184. #define FCS_READ 0x00000001
  2185. #define FCS_FORCEWRITE 0x00000002
  2186. #define FCS_WRITE (FCS_READ | FCS_FORCEWRITE)
  2187. #define FCS_FLAG_DRAGDROP 2
  2188. // Mask which values have been retreived or being set.
  2189. #define FCSM_VIEWID 0x00000001
  2190. #define FCSM_WEBVIEWTEMPLATE 0x00000002
  2191. #define FCSM_INFOTIP 0x00000004
  2192. #define FCSM_CLSID 0x00000008
  2193. #define FCSM_ICONFILE 0x00000010
  2194. #define FCSM_LOGO 0x00000020
  2195. #define FCSM_FLAGS 0x00000040
  2196. #include <pshpack8.h>
  2197. // Used by SHGetSetFolderCustomSettingsA
  2198. typedef struct
  2199. {
  2200. DWORD dwSize;
  2201. DWORD dwMask; // IN/OUT Which Attributes to Get/Set
  2202. SHELLVIEWID* pvid; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2203. // The folder's WebView template path
  2204. LPSTR pszWebViewTemplate; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2205. DWORD cchWebViewTemplate; // IN - Specifies the size of the buffer pointed to by pszWebViewTemplate
  2206. // Ignored if dwReadWrite is FCS_READ
  2207. LPSTR pszWebViewTemplateVersion; // currently IN only
  2208. // Infotip for the folder
  2209. LPSTR pszInfoTip; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2210. DWORD cchInfoTip; // IN - Specifies the size of the buffer pointed to by pszInfoTip
  2211. // Ignored if dwReadWrite is FCS_READ
  2212. // CLSID that points to more info in the registry
  2213. CLSID* pclsid; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2214. // Other flags for the folder. Takes FCS_FLAG_* values
  2215. DWORD dwFlags; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2216. LPSTR pszIconFile; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2217. DWORD cchIconFile; // IN - Specifies the size of the buffer pointed to by pszIconFile
  2218. // Ignored if dwReadWrite is FCS_READ
  2219. int iIconIndex; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2220. LPSTR pszLogo; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2221. DWORD cchLogo; // IN - Specifies the size of the buffer pointed to by pszIconFile
  2222. // Ignored if dwReadWrite is FCS_READ
  2223. } SHFOLDERCUSTOMSETTINGSA, *LPSHFOLDERCUSTOMSETTINGSA;
  2224. // Used by SHGetSetFolderCustomSettingsW
  2225. typedef struct
  2226. {
  2227. DWORD dwSize;
  2228. DWORD dwMask; // IN/OUT Which Attributes to Get/Set
  2229. SHELLVIEWID* pvid; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2230. // The folder's WebView template path
  2231. LPWSTR pszWebViewTemplate; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2232. DWORD cchWebViewTemplate; // IN - Specifies the size of the buffer pointed to by pszWebViewTemplate
  2233. // Ignored if dwReadWrite is FCS_READ
  2234. LPWSTR pszWebViewTemplateVersion; // currently IN only
  2235. // Infotip for the folder
  2236. LPWSTR pszInfoTip; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2237. DWORD cchInfoTip; // IN - Specifies the size of the buffer pointed to by pszInfoTip
  2238. // Ignored if dwReadWrite is FCS_READ
  2239. // CLSID that points to more info in the registry
  2240. CLSID* pclsid; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2241. // Other flags for the folder. Takes FCS_FLAG_* values
  2242. DWORD dwFlags; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2243. LPWSTR pszIconFile; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2244. DWORD cchIconFile; // IN - Specifies the size of the buffer pointed to by pszIconFile
  2245. // Ignored if dwReadWrite is FCS_READ
  2246. int iIconIndex; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2247. LPWSTR pszLogo; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  2248. DWORD cchLogo; // IN - Specifies the size of the buffer pointed to by pszIconFile
  2249. // Ignored if dwReadWrite is FCS_READ
  2250. } SHFOLDERCUSTOMSETTINGSW, *LPSHFOLDERCUSTOMSETTINGSW;
  2251. #include <poppack.h> /* Return to byte packing */
  2252. // Gets/Sets the Folder Custom Settings for pszPath based on dwReadWrite. dwReadWrite can be FCS_READ/FCS_WRITE/FCS_FORCEWRITE
  2253. SHSTDAPI SHGetSetFolderCustomSettingsA(LPSHFOLDERCUSTOMSETTINGSA pfcs, LPCSTR pszPath, DWORD dwReadWrite);
  2254. SHSTDAPI SHGetSetFolderCustomSettingsW(LPSHFOLDERCUSTOMSETTINGSW pfcs, LPCWSTR pszPath, DWORD dwReadWrite);
  2255. #ifdef UNICODE
  2256. #define SHFOLDERCUSTOMSETTINGS SHFOLDERCUSTOMSETTINGSW
  2257. #define SHGetSetFolderCustomSettings SHGetSetFolderCustomSettingsW
  2258. #define LPSHFOLDERCUSTOMSETTINGS LPSHFOLDERCUSTOMSETTINGSW
  2259. #else
  2260. #define SHFOLDERCUSTOMSETTINGS SHFOLDERCUSTOMSETTINGSA
  2261. #define SHGetSetFolderCustomSettings SHGetSetFolderCustomSettingsA
  2262. #define LPSHFOLDERCUSTOMSETTINGS LPSHFOLDERCUSTOMSETTINGSA
  2263. #endif
  2264. #endif // _WIN32_IE >= 0x0500
  2265. ;begin_internal
  2266. // above was doc'ed for DOJ compliance
  2267. ;end_internal
  2268. //-------------------------------------------------------------------------
  2269. //
  2270. // SHBrowseForFolder API
  2271. //
  2272. //
  2273. //-------------------------------------------------------------------------
  2274. typedef int (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
  2275. #include <pshpack8.h>
  2276. typedef struct _browseinfoA {
  2277. HWND hwndOwner;
  2278. LPCITEMIDLIST pidlRoot;
  2279. LPSTR pszDisplayName; // Return display name of item selected.
  2280. // pszTitle can be a resource, but the hinst is assumed to be shell32.dll ;Internal
  2281. LPCSTR lpszTitle; // text to go in the banner over the tree.
  2282. UINT ulFlags; // Flags that control the return stuff
  2283. BFFCALLBACK lpfn;
  2284. LPARAM lParam; // extra info that's passed back in callbacks
  2285. int iImage; // output var: where to return the Image index.
  2286. } BROWSEINFOA, *PBROWSEINFOA, *LPBROWSEINFOA;
  2287. typedef struct _browseinfoW {
  2288. HWND hwndOwner;
  2289. LPCITEMIDLIST pidlRoot;
  2290. LPWSTR pszDisplayName; // Return display name of item selected.
  2291. // lpszTitle can be a resource, but the hinst is assumed to be shell32.dll ;Internal
  2292. LPCWSTR lpszTitle; // text to go in the banner over the tree.
  2293. UINT ulFlags; // Flags that control the return stuff
  2294. BFFCALLBACK lpfn;
  2295. LPARAM lParam; // extra info that's passed back in callbacks
  2296. int iImage; // output var: where to return the Image index.
  2297. } BROWSEINFOW, *PBROWSEINFOW, *LPBROWSEINFOW;
  2298. #include <poppack.h> /* Return to byte packing */
  2299. #ifdef UNICODE
  2300. #define BROWSEINFO BROWSEINFOW
  2301. #define PBROWSEINFO PBROWSEINFOW
  2302. #define LPBROWSEINFO LPBROWSEINFOW
  2303. #else
  2304. #define BROWSEINFO BROWSEINFOA
  2305. #define PBROWSEINFO PBROWSEINFOA
  2306. #define LPBROWSEINFO LPBROWSEINFOA
  2307. #endif
  2308. // Browsing for directory.
  2309. #define BIF_RETURNONLYFSDIRS 0x0001 // For finding a folder to start document searching
  2310. #define BIF_DONTGOBELOWDOMAIN 0x0002 // For starting the Find Computer
  2311. #define BIF_STATUSTEXT 0x0004 // Top of the dialog has 2 lines of text for BROWSEINFO.lpszTitle and one line if
  2312. // this flag is set. Passing the message BFFM_SETSTATUSTEXTA to the hwnd can set the
  2313. // rest of the text. This is not used with BIF_USENEWUI and BROWSEINFO.lpszTitle gets
  2314. // all three lines of text.
  2315. #define BIF_RETURNFSANCESTORS 0x0008
  2316. #define BIF_EDITBOX 0x0010 // Add an editbox to the dialog
  2317. #define BIF_VALIDATE 0x0020 // insist on valid result (or CANCEL)
  2318. #define BIF_NEWDIALOGSTYLE 0x0040 // Use the new dialog layout with the ability to resize
  2319. // Caller needs to call OleInitialize() before using this API
  2320. #define BIF_USENEWUI (BIF_NEWDIALOGSTYLE | BIF_EDITBOX)
  2321. #define BIF_BROWSEINCLUDEURLS 0x0080 // Allow URLs to be displayed or entered. (Requires BIF_USENEWUI)
  2322. #define BIF_UAHINT 0x0100 // Add a UA hint to the dialog, in place of the edit box. May not be combined with BIF_EDITBOX
  2323. #define BIF_NONEWFOLDERBUTTON 0x0200 // Do not add the "New Folder" button to the dialog. Only applicable with BIF_NEWDIALOGSTYLE.
  2324. #define BIF_NOTRANSLATETARGETS 0x0400 // don't traverse target as shortcut
  2325. #define BIF_BROWSEFORCOMPUTER 0x1000 // Browsing for Computers.
  2326. #define BIF_BROWSEFORPRINTER 0x2000 // Browsing for Printers
  2327. #define BIF_BROWSEINCLUDEFILES 0x4000 // Browsing for Everything
  2328. #define BIF_SHAREABLE 0x8000 // sharable resources displayed (remote shares, requires BIF_USENEWUI)
  2329. // message from browser
  2330. #define BFFM_INITIALIZED 1
  2331. #define BFFM_SELCHANGED 2
  2332. #define BFFM_VALIDATEFAILEDA 3 // lParam:szPath ret:1(cont),0(EndDialog)
  2333. #define BFFM_VALIDATEFAILEDW 4 // lParam:wzPath ret:1(cont),0(EndDialog)
  2334. #define BFFM_IUNKNOWN 5 // provides IUnknown to client. lParam: IUnknown*
  2335. // messages to browser
  2336. #define BFFM_SETSTATUSTEXTA (WM_USER + 100)
  2337. #define BFFM_ENABLEOK (WM_USER + 101)
  2338. #define BFFM_SETSELECTIONA (WM_USER + 102)
  2339. #define BFFM_SETSELECTIONW (WM_USER + 103)
  2340. #define BFFM_SETSTATUSTEXTW (WM_USER + 104)
  2341. #define BFFM_SETOKTEXT (WM_USER + 105) // Unicode only
  2342. #define BFFM_SETEXPANDED (WM_USER + 106) // Unicode only
  2343. SHSTDAPI_(LPITEMIDLIST) SHBrowseForFolderA(LPBROWSEINFOA lpbi);
  2344. SHSTDAPI_(LPITEMIDLIST) SHBrowseForFolderW(LPBROWSEINFOW lpbi);
  2345. #ifdef UNICODE
  2346. #define SHBrowseForFolder SHBrowseForFolderW
  2347. #define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTW
  2348. #define BFFM_SETSELECTION BFFM_SETSELECTIONW
  2349. #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
  2350. #else
  2351. #define SHBrowseForFolder SHBrowseForFolderA
  2352. #define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTA
  2353. #define BFFM_SETSELECTION BFFM_SETSELECTIONA
  2354. #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA
  2355. #endif
  2356. //-------------------------------------------------------------------------
  2357. //
  2358. // SHLoadInProc
  2359. //
  2360. // When this function is called, the shell calls CoCreateInstance
  2361. // (or equivalent) with CLSCTX_INPROC_SERVER and the specified CLSID
  2362. // from within the shell's process and release it immediately.
  2363. //
  2364. //-------------------------------------------------------------------------
  2365. SHSTDAPI SHLoadInProc(REFCLSID rclsid);
  2366. #if _WIN32_IE >= 0x0600
  2367. //-------------------------------------------------------------------------
  2368. //
  2369. // SHEnableServiceObject
  2370. //
  2371. // Like SHLoadInProc, but gives control over the object's lifetime
  2372. // via fEnable parameter. TRUE tells the shell to create the object
  2373. // and hold onto it, FALSE tells the shell to look for the previously
  2374. // created instance of the object and release it.
  2375. //
  2376. //-------------------------------------------------------------------------
  2377. SHSTDAPI SHEnableServiceObject(REFCLSID rclsid, BOOL fEnable);
  2378. #endif
  2379. ;begin_internal
  2380. //-------------------------------------------------------------------------
  2381. //
  2382. // Shell Service Object
  2383. //
  2384. //-------------------------------------------------------------------------
  2385. // Cmds for CGID_ShellServiceObject
  2386. enum {
  2387. SSOCMDID_OPEN = 2,
  2388. SSOCMDID_CLOSE = 3,
  2389. };
  2390. ;end_internal
  2391. //-------------------------------------------------------------------------
  2392. //
  2393. // Internet Shortcut Object
  2394. //
  2395. //-------------------------------------------------------------------------
  2396. // Cmds for CGID_ShortCut
  2397. enum {
  2398. ISHCUTCMDID_DOWNLOADICON = 0,
  2399. ISHCUTCMDID_INTSHORTCUTCREATE = 1,
  2400. };
  2401. #define CMDID_INTSHORTCUTCREATE ISHCUTCMDID_INTSHORTCUTCREATE
  2402. ;begin_internal
  2403. #define CMDID_SAVEASTHICKET 5
  2404. //-------------------------------------------------------------------------
  2405. // STR_DISPLAY_UI_DURING_BINDING - IBindCtx Key
  2406. //-------------------------------------------------------------------------
  2407. // If displaying UI during binding is allowed, this parameter
  2408. // will be in the IBindCtx so the object binding can get the
  2409. // IUnknown* of the site in order to:
  2410. // 1. Use the site's hwnd as the parent hwnd of any UI dialogs.
  2411. // This is done via. IOleWindow::GetWindow() or IInternetSecurityMgrSite::GetWindow()
  2412. // 2. While the dialog is being displayed, make the site modal
  2413. // This is done via:
  2414. // IOleInPlaceActiveObject::EnableModeless()
  2415. // IOleInPlaceUIWindow::EnableModelessSB()
  2416. // IInternetSecurityMgrSite::EnableModeless()
  2417. #define STR_DISPLAY_UI_DURING_BINDING L"UI During Binding"
  2418. // bindctx key, tells an FS folder to ignore the STGM_CREATE flag in ParseDisplayName.
  2419. // otherwise it will always succeed, but we need to be able to force it to fail for
  2420. // the cd-r drive.
  2421. #define STR_DONT_FORCE_CREATE L"Don't Force Create"
  2422. // bindctx key, passed to IShellFolder::ParseDisplayName(). gives netfldr extra
  2423. // information it can use to route the parsing of the name we are giving it.
  2424. #define STR_PARSE_NETFOLDER_INFO L"Net Parse Data"
  2425. // in the property bag associated with STR_PARSE_NETFOLDER_INFO this string property
  2426. // defines the WNetProvider to be used when calling WNetGetResourceInformation.
  2427. #define STR_PARSE_NETFOLDER_PROVIDERNAME L"WNetProvider"
  2428. ;end_internal
  2429. //
  2430. // Helper function which returns a IShellFolder interface to the desktop
  2431. // folder. This is equivalent to call CoCreateInstance with CLSID_ShellDesktop.
  2432. //
  2433. // CoCreateInstance(CLSID_Desktop, NULL,
  2434. // CLSCTX_INPROC, IID_IShellFolder, &pshf);
  2435. //
  2436. SHSTDAPI SHGetDesktopFolder(IShellFolder **ppshf);
  2437. // IShellFolder IBindCtx* parameters. the IUnknown for these are
  2438. // accessed through IBindCtx::RegisterObjectParam/GetObjectParam
  2439. // use this to provide the data needed create IDLists through
  2440. // IShellFolder::ParseDisplayName(). this data applies to the last element
  2441. // of the name that is parsed (c:\foo\bar.txt, data applies to bar.txt)
  2442. // this makes creating these IDLists much faster that suppling the name only
  2443. #define STR_FILE_SYS_BIND_DATA L"File System Bind Data"
  2444. #undef INTERFACE
  2445. #define INTERFACE IFileSystemBindData
  2446. DECLARE_INTERFACE_(IFileSystemBindData, IUnknown)
  2447. {
  2448. // *** IUnknown methods ***
  2449. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2450. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2451. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2452. // *** IFileSystemBindData methods ***
  2453. STDMETHOD(SetFindData)(THIS_ const WIN32_FIND_DATAW *pfd) PURE;
  2454. STDMETHOD(GetFindData)(THIS_ WIN32_FIND_DATAW *pfd) PURE;
  2455. };
  2456. ;begin_internal
  2457. //
  2458. // The IShellDetails interface was private in win95 and didnt have a _WIN32_IE guard,
  2459. // so it is now in shlobj.h, along with the definition of SHELLDETAILS
  2460. //
  2461. ;end_internal
  2462. #undef INTERFACE
  2463. #define INTERFACE IShellDetails
  2464. DECLARE_INTERFACE_(IShellDetails, IUnknown)
  2465. {
  2466. // *** IUnknown methods ***
  2467. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2468. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2469. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2470. // *** IShellDetails methods ***
  2471. STDMETHOD(GetDetailsOf)(THIS_ LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS *pDetails) PURE;
  2472. STDMETHOD(ColumnClick)(THIS_ UINT iColumn) PURE;
  2473. };
  2474. ;begin_internal
  2475. #undef INTERFACE
  2476. #define INTERFACE IMountedVolume
  2477. DECLARE_INTERFACE_(IMountedVolume, IUnknown)
  2478. {
  2479. // *** IUnknown methods ***
  2480. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2481. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2482. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2483. // *** IMountedVolume methods ***
  2484. STDMETHOD(Initialize)(THIS_ LPCWSTR pcszHostFolderPath) PURE;
  2485. };
  2486. ;end_internal
  2487. //-------------------------------------------------------------------------
  2488. //
  2489. // IObjMgr interface
  2490. //
  2491. //
  2492. // [Member functions]
  2493. //
  2494. // IObjMgr::Append(punk)
  2495. // This function adds an object to the end of a list of objects.
  2496. //
  2497. // IObjMgr::Remove(punk)
  2498. // This function removes an object from a list of objects.
  2499. //
  2500. // This is implemented by CLSID_ACLMulti so each AutoComplete List
  2501. // (CLSID_ACLHistory, CLSID_ACListISF, CLSID_ACLMRU) can be added.
  2502. // CLSID_ACLMulti's IEnumString will then be the union of the results
  2503. // from the COM Objects added.
  2504. //-------------------------------------------------------------------------
  2505. #undef INTERFACE
  2506. #define INTERFACE IObjMgr
  2507. DECLARE_INTERFACE_(IObjMgr, IUnknown)
  2508. {
  2509. // *** IUnknown methods ***
  2510. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2511. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  2512. STDMETHOD_(ULONG, Release) (THIS) PURE;
  2513. // *** IObjMgr specific methods ***
  2514. STDMETHOD(Append) (THIS_ IUnknown *punk) PURE;
  2515. STDMETHOD(Remove) (THIS_ IUnknown *punk) PURE;
  2516. };
  2517. //-------------------------------------------------------------------------
  2518. //
  2519. // ICurrentWorkingDirectory interface
  2520. //
  2521. //
  2522. // [Member functions]
  2523. //
  2524. // ICurrentWorkingDirectory::GetDirectory(LPWSTR pwzPath, DWORD cchSize)
  2525. // This function gets the Current Working Directory from a COM object that
  2526. // stores such state.
  2527. //
  2528. // ICurrentWorkingDirectory::SetDirectory(LPCWSTR pwzPath)
  2529. // This function sets the Current Working Directory of a COM object that
  2530. // stores such state.
  2531. //
  2532. // This function can be used generically. One COM object that implements it
  2533. // is CLSID_ACListISF so that the AutoComplete engine can complete relative
  2534. // paths. SetDirectory() will set the "Current Working Directory" and
  2535. // AutoComplete with then complete both absolute and relative paths.
  2536. // For Example, if ::SetDirectory(L"C:\Program Files") is called, then
  2537. // the user can AutoComplete "..\winnt". In order to set the current
  2538. // working directory for non-file system paths, "ftp://ftp.microsoft.com/" or
  2539. // "Control Panel" for example, use IPersistFolder.
  2540. //-------------------------------------------------------------------------
  2541. #undef INTERFACE
  2542. #define INTERFACE ICurrentWorkingDirectory
  2543. DECLARE_INTERFACE_(ICurrentWorkingDirectory, IUnknown)
  2544. {
  2545. // *** IUnknown methods ***
  2546. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2547. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  2548. STDMETHOD_(ULONG, Release) (THIS) PURE;
  2549. // *** ICurrentWorkingDirectory specific methods ***
  2550. STDMETHOD(GetDirectory) (THIS_ LPWSTR pwzPath, DWORD cchSize) PURE;
  2551. STDMETHOD(SetDirectory) (THIS_ LPCWSTR pwzPath) PURE;
  2552. };
  2553. //-------------------------------------------------------------------------
  2554. //
  2555. // IACList interface
  2556. //
  2557. //
  2558. // [Member functions]
  2559. //
  2560. // IObjMgr::Expand(LPCOLESTR)
  2561. // This function tells an autocomplete list to expand a specific string.
  2562. //
  2563. // If the user enters a multi-level path, AutoComplete (CLSID_AutoComplete)
  2564. // will use this interface to tell the "AutoComplete Lists" where to expand
  2565. // the results.
  2566. //
  2567. // For Example, if the user enters "C:\Program Files\Micros", AutoComplete
  2568. // first completely enumerate the "AutoComplete Lists" via IEnumString. Then it
  2569. // will call the "AutoComplete Lists" with IACList::Expand(L"C:\Program Files").
  2570. // It will then enumerate the IEnumString interface again to get results in
  2571. // that directory.
  2572. //-------------------------------------------------------------------------
  2573. #undef INTERFACE
  2574. #define INTERFACE IACList
  2575. DECLARE_INTERFACE_(IACList, IUnknown)
  2576. {
  2577. // *** IUnknown methods ***
  2578. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2579. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  2580. STDMETHOD_(ULONG, Release) (THIS) PURE;
  2581. // *** IACList specific methods ***
  2582. STDMETHOD(Expand) (THIS_ LPCOLESTR pszExpand) PURE;
  2583. };
  2584. //-------------------------------------------------------------------------
  2585. //
  2586. // IACList2 interface
  2587. //
  2588. // [Description]
  2589. // This interface exists to allow the caller to set filter criteria
  2590. // for an AutoComplete List. AutoComplete Lists generates the list of
  2591. // possible AutoComplete completions. CLSID_ACListISF is one AutoComplete
  2592. // List COM object that implements this interface.
  2593. //-------------------------------------------------------------------------
  2594. #undef INTERFACE
  2595. #define INTERFACE IACList2
  2596. typedef enum _tagAUTOCOMPLETELISTOPTIONS
  2597. {
  2598. ACLO_NONE = 0, // don't enumerate anything
  2599. ACLO_CURRENTDIR = 1, // enumerate current directory
  2600. ACLO_MYCOMPUTER = 2, // enumerate MyComputer
  2601. ACLO_DESKTOP = 4, // enumerate Desktop Folder
  2602. ACLO_FAVORITES = 8, // enumerate Favorites Folder
  2603. ACLO_FILESYSONLY = 16, // enumerate only the file system
  2604. ACLO_FILESYSDIRS = 32, // enumerate only the file system dirs, UNC shares, and UNC servers.
  2605. } AUTOCOMPLETELISTOPTIONS;
  2606. DECLARE_INTERFACE_(IACList2, IACList)
  2607. {
  2608. // *** IACList2 specific methods ***
  2609. STDMETHOD(SetOptions)(THIS_ DWORD dwFlag) PURE;
  2610. STDMETHOD(GetOptions)(THIS_ DWORD* pdwFlag) PURE;
  2611. };
  2612. /*-------------------------------------------------------------------------*\
  2613. INTERFACE: IProgressDialog
  2614. DESCRIPTION:
  2615. CLSID_ProgressDialog/IProgressDialog exist to allow a caller to create
  2616. a progress dialog, set it's title, animation, text lines, progress, and
  2617. it will do all the work of updating on a background thread, being modless,
  2618. handling the user cancelling the operation, and estimating the time remaining
  2619. until the operation completes.
  2620. USAGE:
  2621. This is how the dialog is used during operations that require progress
  2622. and the ability to cancel:
  2623. {
  2624. DWORD dwComplete, dwTotal;
  2625. IProgressDialog * ppd;
  2626. CoCreateInstance(CLSID_ProgressDialog, NULL, CLSCTX_INPROC_SERVER, IID_IProgressDialog, (void **)&ppd);
  2627. ppd->SetTitle(L"My Slow Operation"); // Set the title of the dialog.
  2628. ppd->SetAnimation(hInstApp, IDA_OPERATION_ANIMATION); // Set the animation to play.
  2629. ppd->StartProgressDialog(hwndParent, punk, PROGDLG_AUTOTIME, NULL); // Display and enable automatic estimated time remaining.
  2630. ppd->SetCancelMsg(L"Please wait while the current operation is cleaned up", NULL); // Will only be displayed if Cancel button is pressed.
  2631. dwComplete = 0;
  2632. dwTotal = CalcTotalUnitsToDo();
  2633. // Reset because CalcTotalUnitsToDo() took a long time and the estimated time
  2634. // is based on the time between ::StartProgressDialog() and the first
  2635. // ::SetProgress() call.
  2636. ppd->Timer(PDTIMER_RESET, NULL);
  2637. for (nIndex = 0; nIndex < nTotal; nIndex++)
  2638. {
  2639. if (TRUE == ppd->HasUserCancelled())
  2640. break;
  2641. ppd->SetLine(2, L"I'm processing item n", FALSE, NULL);
  2642. dwComplete += DoSlowOperation();
  2643. ppd->SetProgress(dwCompleted, dwTotal);
  2644. }
  2645. ppd->StopProgressDialog();
  2646. ppd->Release();
  2647. }
  2648. \*-------------------------------------------------------------------------*/
  2649. // Flags for IProgressDialog::StartProgressDialog() (dwFlags)
  2650. #define PROGDLG_NORMAL 0x00000000 // default normal progress dlg behavior
  2651. #define PROGDLG_MODAL 0x00000001 // the dialog is modal to its hwndParent (default is modeless)
  2652. #define PROGDLG_AUTOTIME 0x00000002 // automatically updates the "Line3" text with the "time remaining" (you cant call SetLine3 if you passs this!)
  2653. #define PROGDLG_NOTIME 0x00000004 // we dont show the "time remaining" if this is set. We need this if dwTotal < dwCompleted for sparse files
  2654. #define PROGDLG_NOMINIMIZE 0x00000008 // Do not have a minimize button in the caption bar.
  2655. #define PROGDLG_NOPROGRESSBAR 0x00000010 // Don't display the progress bar
  2656. // Time Actions (dwTimerAction)
  2657. #define PDTIMER_RESET 0x00000001 // Reset the timer so the progress will be calculated from now until the first ::SetProgress() is called so
  2658. // those this time will correspond to the values passed to ::SetProgress(). Only do this before ::SetProgress() is called.
  2659. #undef INTERFACE
  2660. #define INTERFACE IProgressDialog
  2661. DECLARE_INTERFACE_(IProgressDialog, IUnknown)
  2662. {
  2663. // *** IUnknown methods ***
  2664. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2665. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2666. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2667. // *** IProgressDialog specific methods
  2668. STDMETHOD(StartProgressDialog)(THIS_ HWND hwndParent, IUnknown * punkEnableModless, DWORD dwFlags, LPCVOID pvResevered) PURE;
  2669. STDMETHOD(StopProgressDialog)(THIS) PURE;
  2670. STDMETHOD(SetTitle)(THIS_ LPCWSTR pwzTitle) PURE;
  2671. STDMETHOD(SetAnimation)(THIS_ HINSTANCE hInstAnimation, UINT idAnimation) PURE;
  2672. STDMETHOD_(BOOL,HasUserCancelled) (THIS) PURE;
  2673. STDMETHOD(SetProgress)(THIS_ DWORD dwCompleted, DWORD dwTotal) PURE;
  2674. STDMETHOD(SetProgress64)(THIS_ ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE;
  2675. STDMETHOD(SetLine)(THIS_ DWORD dwLineNum, LPCWSTR pwzString, BOOL fCompactPath, LPCVOID pvResevered) PURE;
  2676. STDMETHOD(SetCancelMsg)(THIS_ LPCWSTR pwzCancelMsg, LPCVOID pvResevered) PURE;
  2677. STDMETHOD(Timer)(THIS_ DWORD dwTimerAction, LPCVOID pvResevered) PURE;
  2678. };
  2679. ;begin_internal
  2680. //-------------------------------------------------------------------------
  2681. // This is the interface for a browser to "subclass" the main File Cabinet
  2682. // window. Note that only the hwnd, message, wParam, and lParam fields of
  2683. // the msg structure are used. The browser window will get a WM_NOTIFY
  2684. // message with NULL ID, FCN_MESSAGE as the code, and a pointer to
  2685. // FCMSG_NOTIFY as the lParam.
  2686. //
  2687. //-------------------------------------------------------------------------
  2688. #include <pshpack8.h>
  2689. typedef struct tagFCMSG_NOTIFY
  2690. {
  2691. NMHDR hdr;
  2692. MSG msg;
  2693. LRESULT lResult;
  2694. } FCMSG_NOTIFY;
  2695. #include <poppack.h> /* Return to byte packing */
  2696. #define FCN_MESSAGE (100)
  2697. //---------------------------------------------------------------------------
  2698. // messages that can be send to the cabinet by other apps
  2699. //
  2700. // REVIEW: Do we really need to publish any of those?
  2701. //---------------------------------------------------------------------------
  2702. #define NF_INHERITVIEW 0x0000
  2703. #define NF_LOCALVIEW 0x0001
  2704. // Change the path of an existing folder.
  2705. // wParam:
  2706. // 0: LPARAM is a pidl, handle the message immediately.
  2707. // CSP_REPOST: LPARAM is a pidl, copy the pidl and handle the
  2708. // message later.
  2709. // CSP_NOEXECUTE: if this path is not a folder, fail, don't shell exec
  2710. //
  2711. //
  2712. // lParam: LPITEMIDLIST of path.
  2713. //
  2714. //
  2715. #define CSP_REPOST 0x0001
  2716. #define CSP_INITIATEDBYHLINKFRAME 0x0002
  2717. #define CSP_NOEXECUTE 0x0004
  2718. #define CSP_NONAVIGATE 0x0008
  2719. #define CWM_SETPATH (WM_USER + 2)
  2720. // lpsv points to the Shell View extension that requested idle processing
  2721. // uID is an app define identifier for the processor
  2722. // returns: TRUE if there is more idle processing necessary, FALSE if all done
  2723. // Note that the idle processor should do one "atomic" operation and return
  2724. // as soon as possible.
  2725. typedef BOOL (CALLBACK *FCIDLEPROC)(void *lpsv, UINT uID);
  2726. // Inform the File Cabinet that you want idle messages.
  2727. // This should ONLY be used by File Cabinet extensions.
  2728. // wParam: app define UINT (passed to FCIDLEPROC).
  2729. // lParam: pointer to an FCIDLEPROC.
  2730. // return: TRUE if successful; FALSE otherwise
  2731. //
  2732. #define CWM_WANTIDLE (WM_USER + 3)
  2733. // get or set the FOLDERSETTINGS for a view
  2734. // wParam: BOOL TRUE -> set to view info buffer, FALSE -> get view info buffer
  2735. // lParam: LPFOLDERSETTINGS buffer to get or set view info
  2736. //
  2737. #define CWM_GETSETCURRENTINFO (WM_USER + 4)
  2738. #define FileCabinet_GetSetCurrentInfo(_hwnd, _bSet, _lpfs) \
  2739. SendMessage(_hwnd, CWM_GETSETCURRENTINFO, (WPARAM)(_bSet), (LPARAM)(LPFOLDERSETTINGS)_lpfs)
  2740. // selects the specified item in the current view
  2741. // wParam: SVSI_* flags
  2742. // lParam: LPCITEMIDLIST of the item ID, NULL -> all items
  2743. //
  2744. #define CWM_SELECTITEM (WM_USER + 5)
  2745. #define FileCabinet_SelectItem(_hwnd, _sel, _item) \
  2746. SendMessage(_hwnd, CWM_SELECTITEM, _sel, (LPARAM)(LPCITEMIDLIST)(_item))
  2747. // selects the specified path in the current view
  2748. // wParam: SVSI_* flags
  2749. // lParam: LPCSTR of the display name
  2750. //
  2751. #define CWM_SELECTPATH (WM_USER + 6)
  2752. #define FileCabinet_SelectPath(_hwnd, _sel, _path) \
  2753. SendMessage(_hwnd, CWM_SELECTPATH, _sel, (LPARAM)(LPCSTR)(_path))
  2754. // Get the IShellBrowser object associated with an hwndMain
  2755. #define CWM_GETISHELLBROWSER (WM_USER + 7)
  2756. #define FileCabinet_GetIShellBrowser(_hwnd) \
  2757. (IShellBrowser*)SendMessage(_hwnd, CWM_GETISHELLBROWSER, 0, 0L)
  2758. //
  2759. // two pidls can have the same path, so we need a compare pidl message
  2760. #define CWM_COMPAREPIDL (WM_USER + 9)
  2761. //
  2762. // sent when the global state changes
  2763. #define CWM_GLOBALSTATECHANGE (WM_USER + 10)
  2764. #define CWMF_GLOBALSTATE 0x0000
  2765. #define CWMF_SECURITY 0x0001
  2766. // sent to the desktop from a second instance
  2767. #define CWM_COMMANDLINE (WM_USER + 11)
  2768. // global clone your current pidl
  2769. #define CWM_CLONEPIDL (WM_USER + 12)
  2770. // See if the root of the instance is as specified
  2771. #define CWM_COMPAREROOT (WM_USER + 13)
  2772. // Tell desktop our root
  2773. #define CWM_SPECIFYCOMPARE (WM_USER + 14)
  2774. // See if the root of the instance matches a hwnd
  2775. #define CWM_PERFORMCOMPARE (WM_USER + 15)
  2776. // Forward SHChangeNotify events
  2777. #define CWM_FSNOTIFY (WM_USER + 16)
  2778. // Forward SHChangeRegistration events
  2779. #define CWM_CHANGEREGISTRATION (WM_USER + 17)
  2780. // For AddToRecentDocs processing by desktop
  2781. #define CWM_ADDTORECENT (WM_USER + 18)
  2782. // For SHWaitForFile processing by desktopop
  2783. #define CWM_WAITOP (WM_USER + 19)
  2784. // Notify for changes to the fav's folder.
  2785. #define CWM_FAV_CHANGE (WM_USER + 20)
  2786. #define CWM_SHOWDRAGIMAGE (WM_USER + 21)
  2787. #define CWM_SHOWFOLDEROPT (WM_USER + 22)
  2788. #define CWMW_FOLDEROPTIONS 0 // wParam for CWM_SHOWFOLDEROPT
  2789. #define CWMW_TASKBAROPTIONS 1 // wParam for CWM_SHOWFOLDEROPT
  2790. #define CWM_FSNOTIFYSUSPENDRESUME (WM_USER + 23)
  2791. #define CWM_CREATELOCALSERVER (WM_USER + 24)
  2792. #define CWM_GETSCNWINDOW (WM_USER + 25)
  2793. #define CWM_TASKBARWAKEUP (WM_USER + 26) // Used to restore tray thread to normal priority in extremely stressed machines
  2794. #define CWM_STARTNETCRAWLER (WM_USER + 27)
  2795. #define CWM_RESERVEDFORCOMDLG_FIRST (WM_USER + 100)
  2796. #define CWM_RESERVEDFORCOMDLG_LAST (WM_USER + 199)
  2797. #define CWM_RESERVEDFORWEBBROWSER_FIRST (WM_USER + 200)
  2798. #define CWM_RESERVEDFORWEBBROWSER_LAST (WM_USER + 299)
  2799. ;end_internal
  2800. //==========================================================================
  2801. // IInputObjectSite/IInputObject interfaces
  2802. //
  2803. // These interfaces allow us (or ISVs) to install/update external Internet
  2804. // Toolbar for IE and the shell. The frame will simply get the CLSID from
  2805. // registry (to be defined) and CoCreateInstance it.
  2806. //
  2807. //==========================================================================
  2808. //-------------------------------------------------------------------------
  2809. //
  2810. // IInputObjectSite interface
  2811. //
  2812. // A site implements this interface so the object can communicate
  2813. // focus change to it.
  2814. //
  2815. // [Member functions]
  2816. //
  2817. // IInputObjectSite::OnFocusChangeIS(punkObj, fSetFocus)
  2818. // Object (punkObj) is getting or losing the focus.
  2819. //
  2820. //-------------------------------------------------------------------------
  2821. #undef INTERFACE
  2822. #define INTERFACE IInputObjectSite
  2823. DECLARE_INTERFACE_(IInputObjectSite, IUnknown)
  2824. {
  2825. // *** IUnknown methods ***
  2826. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2827. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2828. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2829. // *** IInputObjectSite specific methods ***
  2830. STDMETHOD(OnFocusChangeIS)(THIS_ IUnknown* punkObj, BOOL fSetFocus) PURE;
  2831. };
  2832. //-------------------------------------------------------------------------
  2833. //
  2834. // IInputObject interface
  2835. //
  2836. // An object implements this interface so the site can communicate
  2837. // activation and accelerator events to it.
  2838. //
  2839. // [Member functions]
  2840. //
  2841. // IInputObject::UIActivateIO(fActivate, lpMsg)
  2842. // Activates or deactivates the object. lpMsg may be NULL. Returns
  2843. // S_OK if the activation succeeded.
  2844. //
  2845. // IInputObject::HasFocusIO()
  2846. // Returns S_OK if the object has the focus, S_FALSE if not.
  2847. //
  2848. // IInputObject::TranslateAcceleratorIO(lpMsg)
  2849. // Allow the object to process the message. Returns S_OK if the
  2850. // message was processed (eaten).
  2851. //
  2852. //-------------------------------------------------------------------------
  2853. #undef INTERFACE
  2854. #define INTERFACE IInputObject
  2855. DECLARE_INTERFACE_(IInputObject, IUnknown)
  2856. {
  2857. // *** IUnknown methods ***
  2858. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2859. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2860. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2861. // *** IInputObject specific methods ***
  2862. STDMETHOD(UIActivateIO)(THIS_ BOOL fActivate, LPMSG lpMsg) PURE;
  2863. STDMETHOD(HasFocusIO)(THIS) PURE;
  2864. STDMETHOD(TranslateAcceleratorIO)(THIS_ LPMSG lpMsg) PURE;
  2865. };
  2866. //==========================================================================
  2867. // IDockingWindowSite/IDockingWindow/IDockingWindowFrame interfaces
  2868. // IInputObjectSite/IInputObject interfaces
  2869. //
  2870. // These interfaces allow us (or ISVs) to install/update external Internet
  2871. // Toolbar for IE and the shell. The frame will simply get the CLSID from
  2872. // registry (to be defined) and CoCreateInstance it.
  2873. //
  2874. //==========================================================================
  2875. //-------------------------------------------------------------------------
  2876. //
  2877. // IDockingWindowSite interface
  2878. //
  2879. // A site implements this interface so the object can negotiate for
  2880. // and inquire about real estate on the site.
  2881. //
  2882. // [Member functions]
  2883. //
  2884. // IDockingWindowSite::GetBorderDW(punkObj, prcBorder)
  2885. // Site returns the bounding rectangle of the given source object
  2886. // (punkObj).
  2887. //
  2888. // IDockingWindowSite::RequestBorderSpaceDW(punkObj, pbw)
  2889. // Object requests that the site makes room for it, as specified in
  2890. // *pbw.
  2891. //
  2892. // IDockingWindowSite::SetBorderSpaceDW(punkObj, pbw)
  2893. // Object requests that the site set the border spacing to the size
  2894. // specified in *pbw.
  2895. //
  2896. //-------------------------------------------------------------------------
  2897. #undef INTERFACE
  2898. #define INTERFACE IDockingWindowSite
  2899. DECLARE_INTERFACE_(IDockingWindowSite, IOleWindow)
  2900. {
  2901. // *** IUnknown methods ***
  2902. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2903. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2904. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2905. // *** IOleWindow methods ***
  2906. STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2907. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2908. // *** IDockingWindowSite methods ***
  2909. STDMETHOD(GetBorderDW) (THIS_ IUnknown* punkObj, LPRECT prcBorder) PURE;
  2910. STDMETHOD(RequestBorderSpaceDW) (THIS_ IUnknown* punkObj, LPCBORDERWIDTHS pbw) PURE;
  2911. STDMETHOD(SetBorderSpaceDW) (THIS_ IUnknown* punkObj, LPCBORDERWIDTHS pbw) PURE;
  2912. };
  2913. //-------------------------------------------------------------------------
  2914. //
  2915. // IDockingWindowFrame interface
  2916. //
  2917. // [Member functions]
  2918. //
  2919. // IDockingWindowFrame::AddToolbar(punkSrc, pwszItem, dwReserved)
  2920. //
  2921. // IDockingWindowFrame::RemoveToolbar(punkSrc, dwRemoveFlags)
  2922. //
  2923. // IDockingWindowFrame::FindToolbar(pwszItem, riid, ppv)
  2924. //
  2925. //-------------------------------------------------------------------------
  2926. // flags for RemoveToolbar
  2927. #define DWFRF_NORMAL 0x0000
  2928. #define DWFRF_DELETECONFIGDATA 0x0001
  2929. ;begin_internal
  2930. #define STFRF_NORMAL DWFRF_NORMAL
  2931. #define STFRF_DELETECONFIGDATA DWFRF_DELETECONFIGDATA
  2932. ;end_internal
  2933. // flags for AddToolbar
  2934. #define DWFAF_HIDDEN 0x0001 // add hidden
  2935. #undef INTERFACE
  2936. #define INTERFACE IDockingWindowFrame
  2937. DECLARE_INTERFACE_(IDockingWindowFrame, IOleWindow)
  2938. {
  2939. // *** IUnknown methods ***
  2940. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2941. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2942. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2943. // *** IOleWindow methods ***
  2944. STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2945. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2946. // *** IDockingWindowFrame methods ***
  2947. STDMETHOD(AddToolbar) (THIS_ IUnknown* punkSrc, LPCWSTR pwszItem, DWORD dwAddFlags) PURE;
  2948. STDMETHOD(RemoveToolbar) (THIS_ IUnknown* punkSrc, DWORD dwRemoveFlags) PURE;
  2949. STDMETHOD(FindToolbar) (THIS_ LPCWSTR pwszItem, REFIID riid, void **ppv) PURE;
  2950. };
  2951. ;begin_internal
  2952. #undef INTERFACE
  2953. #define INTERFACE IMultiMonitorDockingSite
  2954. DECLARE_INTERFACE_(IMultiMonitorDockingSite, IUnknown)
  2955. {
  2956. // *** IUnknown methods ***
  2957. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2958. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2959. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2960. // *** IMultiMonitorDockingSite methods ***
  2961. STDMETHOD(GetMonitor) (THIS_ IUnknown* punkSrc, HMONITOR * phMon) PURE;
  2962. STDMETHOD(RequestMonitor) (THIS_ IUnknown* punkSrc, HMONITOR * phMon) PURE;
  2963. STDMETHOD(SetMonitor) (THIS_ IUnknown* punkSrc, HMONITOR hMonNew, HMONITOR *phMonOld) PURE;
  2964. };
  2965. ;end_internal
  2966. #if (_WIN32_IE >= 0x0400)
  2967. //-------------------------------------------------------------------------
  2968. //
  2969. // IRunnableTask interface
  2970. //
  2971. // This is a free threaded interface used for putting items on a background
  2972. // scheduler for execution within the view. It allows a scheduler to start and
  2973. // stop tasks on as many worker threads as it deems necessary.
  2974. //
  2975. // Run(), Kill() and Suspend() may be called from different threads.
  2976. //
  2977. // [Member functions]
  2978. //
  2979. // IRunnableTask::Run(void)
  2980. // Initiate the task to run. This should return E_PENDING if the task
  2981. // has been suspended.
  2982. //
  2983. // IRunnableTask::Kill(void)
  2984. //
  2985. // IRunnableTask::Suspend(void)
  2986. //
  2987. // IRunnableTask::Resume(void)
  2988. //
  2989. // IRunnableTask::IsRunning(void)
  2990. //
  2991. //-------------------------------------------------------------------------
  2992. // Convenient state values
  2993. #define IRTIR_TASK_NOT_RUNNING 0
  2994. #define IRTIR_TASK_RUNNING 1
  2995. #define IRTIR_TASK_SUSPENDED 2
  2996. #define IRTIR_TASK_PENDING 3
  2997. #define IRTIR_TASK_FINISHED 4
  2998. #undef INTERFACE
  2999. #define INTERFACE IRunnableTask
  3000. DECLARE_INTERFACE_( IRunnableTask, IUnknown )
  3001. {
  3002. // *** IUnknown methods ***
  3003. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3004. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  3005. STDMETHOD_(ULONG, Release)(THIS) PURE;
  3006. // *** IRunnableTask methods ***
  3007. STDMETHOD (Run)(THIS) PURE;
  3008. STDMETHOD (Kill)(THIS_ BOOL fWait ) PURE;
  3009. STDMETHOD (Suspend)(THIS) PURE;
  3010. STDMETHOD (Resume)(THIS) PURE;
  3011. STDMETHOD_(ULONG, IsRunning)(THIS) PURE;
  3012. };
  3013. typedef IRunnableTask * LPRUNNABLETASK;
  3014. #endif
  3015. #if (_WIN32_IE >= 0x0400)
  3016. #define TASKOWNERID GUID
  3017. #define REFTASKOWNERID REFGUID
  3018. // ---IShellTaskScheduler
  3019. // An interface for interacting with and controlling a task scheduler. This
  3020. // interface does not need to be free-threaded unless the items in the queue
  3021. // interact with the scheduler as well as the main execution thread on which the
  3022. // task scheduler was created.
  3023. // IShellTaskScheduler::AddTask()
  3024. // Adds Tasks to the scheduler's background queue. The TASKOWNERID allow particular types
  3025. // of tasks to be grouped so that they can be counted or removed. The lParam allows the task
  3026. // to be associated with a particular item (for example an item in a listview).
  3027. // IShellTaskScheduler::RemoveTasks()
  3028. // Removes tasks from the scheduler's queue. These can be sepcified in terms of their TASKOWNERID
  3029. // or their LPARAM, or both, or neither (TOID_NULL && ITSAT_DEFAULT_LPARAM results in all tasks being
  3030. // removed). If a task that matches is currently running and ITaskScheduler::Status() has been
  3031. // passeed ITSSFLAG_KILL_ON_DESTROY then the scheduler will attempt to kill the current task. The
  3032. // fWaitIfRunning parameter is then passed to IRunnableTask::Kill().
  3033. // IShellTaskScheduler::CountTasks()
  3034. // Counts the tasks in the queue depending upon the TASKOWNERID and the LPARAM passed. (TOID_NULL and
  3035. // ITSAT_DEFAULT_LPARAM will count all tasks in the queue)
  3036. // IShellTaskScheduler::Status()
  3037. // This sets the ReleaseStatus for the current task and the background thread timeout. When
  3038. // ITaskScheduler::RemoveTasks() is called and there is a task currently running that matches
  3039. // ITSSFLAG_COMPLETE_ON_DESTROY will cause TRUE to be passed to the task's IRunnableTask::Kill().
  3040. // The dwThreadTimeout parameter if not set to the default will cause the background thread to
  3041. // die if no new tasks have been added to the queue in the timeout period. The Thread will be
  3042. // recreated when the next new task is added.
  3043. ////////////////////////
  3044. // Status() flags,
  3045. // wait for the current task to complete before deleting the scheduler
  3046. #define ITSSFLAG_COMPLETE_ON_DESTROY 0x0000
  3047. // kill the current task (if there is one) when the task scheduler is deleted
  3048. #define ITSSFLAG_KILL_ON_DESTROY 0x0001
  3049. #define ITSSFLAG_SUPPORTS_TERMINATE 0x0002
  3050. #define ITSSFLAG_FLAGS_MASK 0x0003
  3051. // set the timeout for killing the thread when the object is terminated.
  3052. // this timeout can be used to stop the object from blocking the system
  3053. // indefinitely.
  3054. #define ITSSFLAG_THREAD_TERMINATE_TIMEOUT 0x0010
  3055. // set the timeout for threads that are idle in the thread pool
  3056. #define ITSSFLAG_THREAD_POOL_TIMEOUT 0x0020
  3057. // The default timeout passed to release Status to determine how long the thread
  3058. // can be asleep before the thread is expired
  3059. #define ITSS_THREAD_DESTROY_DEFAULT_TIMEOUT (60*1000)
  3060. // default, we won't kill it...
  3061. #define ITSS_THREAD_TERMINATE_TIMEOUT (INFINITE)
  3062. // there is no change to the thread timeout
  3063. #define ITSS_THREAD_TIMEOUT_NO_CHANGE (INFINITE - 1)
  3064. // the LPARAM allows task to be associated with items thus all tasks owned by a
  3065. // particular item can be accessed by passing a non default value for this parameter
  3066. #define ITSAT_DEFAULT_LPARAM 0xffffffff
  3067. // Task priorities
  3068. // ---------------
  3069. // This depends on the cooperation of tasks currently under execution. New tasks will
  3070. // be inserted in the queue in priority order. If a task of a low priority is currently
  3071. // under execution when a higher priority task is added, the scheduler will attempt
  3072. // to suspend the task currently under execution. It will be resumed when the other tasks
  3073. // have been completed.
  3074. #define ITSAT_DEFAULT_PRIORITY 0x10000000
  3075. #define ITSAT_MAX_PRIORITY 0x7fffffff
  3076. #define ITSAT_MIN_PRIORITY 0x00000000
  3077. #define TOID_NULL CLSID_NULL
  3078. #undef INTERFACE
  3079. #define INTERFACE IShellTaskScheduler
  3080. DECLARE_INTERFACE_( IShellTaskScheduler, IUnknown )
  3081. {
  3082. // *** IUnknown methods ***
  3083. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3084. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  3085. STDMETHOD_(ULONG, Release)(THIS) PURE;
  3086. // *** IShellTaskScheduler methods ***
  3087. STDMETHOD (AddTask)(THIS_ IRunnableTask * pTask,
  3088. REFTASKOWNERID rtoid,
  3089. DWORD_PTR lParam,
  3090. DWORD dwPriority ) PURE;
  3091. STDMETHOD (RemoveTasks)(THIS_ REFTASKOWNERID rtoid,
  3092. DWORD_PTR lParam,
  3093. BOOL fWaitIfRunning ) PURE;
  3094. STDMETHOD_(UINT, CountTasks)(THIS_ REFTASKOWNERID rtoid) PURE;
  3095. STDMETHOD (Status)(THIS_ DWORD dwReleaseStatus, DWORD dwThreadTimeout ) PURE;
  3096. };
  3097. typedef IShellTaskScheduler * LPSHELLTASKSCHEDULER;
  3098. #if (_WIN32_IE >= 0x0501)
  3099. #define ITSSFLAG_TASK_PLACEINFRONT 0x00000001
  3100. #define ITSSFLAG_TASK_PLACEINBACK 0x00000002
  3101. #undef INTERFACE
  3102. #define INTERFACE IShellTaskScheduler2
  3103. DECLARE_INTERFACE_( IShellTaskScheduler2, IShellTaskScheduler )
  3104. {
  3105. // *** IUnknown methods ***
  3106. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3107. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  3108. STDMETHOD_(ULONG, Release)(THIS) PURE;
  3109. // *** IShellTaskScheduler methods ***
  3110. STDMETHOD (AddTask)(THIS_ IRunnableTask * pTask,
  3111. REFTASKOWNERID rtoid,
  3112. DWORD_PTR lParam,
  3113. DWORD dwPriority ) PURE;
  3114. STDMETHOD (RemoveTasks)(THIS_ REFTASKOWNERID rtoid,
  3115. DWORD_PTR lParam,
  3116. BOOL fWaitIfRunning ) PURE;
  3117. STDMETHOD_(UINT, CountTasks)(THIS_ REFTASKOWNERID rtoid) PURE;
  3118. STDMETHOD (Status)(THIS_ DWORD dwReleaseStatus, DWORD dwThreadTimeout ) PURE;
  3119. // *** IShellTaskScheduler2 methods ***
  3120. STDMETHOD (AddTask2)(THIS_ IRunnableTask * pTask,
  3121. REFTASKOWNERID rtoid,
  3122. DWORD_PTR lParam,
  3123. DWORD dwPriority,
  3124. DWORD grfFlags ) PURE;
  3125. STDMETHOD (MoveTask)(THIS_ REFTASKOWNERID rtoid,
  3126. DWORD_PTR lParam,
  3127. DWORD dwPriority,
  3128. DWORD grfFlags ) PURE;
  3129. };
  3130. #endif // (_WIN32_IE >= 0x0501)
  3131. #endif // (_WIN32_IE >= 0x0400)
  3132. #if (_WIN32_IE >= 0x0400)
  3133. /* ***************** IThumbnailCapture
  3134. * CaptureThumbnail : takes an IHTMLDocument2 and returns a thumbnail of specified
  3135. * size as an hbitmap
  3136. */
  3137. #undef INTERFACE
  3138. #define INTERFACE IThumbnailCapture
  3139. DECLARE_INTERFACE_ ( IThumbnailCapture, IUnknown )
  3140. {
  3141. // *** IThumbnailCapture methods ***
  3142. STDMETHOD (CaptureThumbnail) ( THIS_ const SIZE * pMaxSize,
  3143. IUnknown * pHTMLDoc2,
  3144. HBITMAP * phbmThumbnail ) PURE;
  3145. };
  3146. typedef IThumbnailCapture * LPTHUMBNAILCAPTURE;
  3147. #endif
  3148. ;begin_internal
  3149. #if (_WIN32_IE >= 0x0400)
  3150. // Interface used to scale and sharpen images...
  3151. // right now, always pass the palette from SHCreateShellPalette on a 256 colour machine...
  3152. #undef INTERFACE
  3153. #define INTERFACE IScaleAndSharpenImage2
  3154. DECLARE_INTERFACE_ (IScaleAndSharpenImage2, IUnknown )
  3155. {
  3156. // *** IUnknown methods ***
  3157. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3158. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  3159. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  3160. // *** IScaleAndSharpenImage methods ***
  3161. STDMETHOD( ScaleSharpen2 ) ( THIS_ BITMAPINFO * pbi,
  3162. void * pBits,
  3163. HBITMAP * phBmpThumbnail,
  3164. const SIZE * prgSize,
  3165. DWORD dwRecClrDepth,
  3166. HPALETTE hpal,
  3167. UINT uiSharpPct,
  3168. BOOL fOrigSize) PURE;
  3169. };
  3170. // IImageCache
  3171. // Interface for controlling and accessing an imagecache of bitmaps for icons..
  3172. // flags for the dwMask member of IMAGECACHEINFO
  3173. #define ICIFLAG_LARGE 0x0001
  3174. #define ICIFLAG_SMALL 0x0002
  3175. #define ICIFLAG_BITMAP 0x0004
  3176. #define ICIFLAG_ICON 0x0008
  3177. #define ICIFLAG_INDEX 0x0010
  3178. #define ICIFLAG_NAME 0x0020
  3179. #define ICIFLAG_FLAGS 0x0040
  3180. #define ICIFLAG_NOUSAGE 0x0080
  3181. #define ICIFLAG_DATESTAMP 0x0100
  3182. #define ICIFLAG_MIRROR 0x2000
  3183. #if (_WIN32_IE >= 0x0501)
  3184. #define ICIFLAG_SYSTEM 0x4000
  3185. #endif
  3186. typedef struct _tagImageCacheInfo
  3187. {
  3188. DWORD cbSize;
  3189. DWORD dwMask;
  3190. union
  3191. {
  3192. HBITMAP hBitmapLarge;
  3193. HICON hIconLarge;
  3194. };
  3195. HBITMAP hMaskLarge;
  3196. union
  3197. {
  3198. HBITMAP hBitmapSmall;
  3199. HICON hIconSmall;
  3200. };
  3201. HBITMAP hMaskSmall;
  3202. LPCWSTR pszName;
  3203. int iIndex;
  3204. DWORD dwFlags;
  3205. #if (_WIN32_IE >= 0x0500)
  3206. FILETIME ftDateStamp;
  3207. #endif
  3208. } IMAGECACHEINFO;
  3209. typedef IMAGECACHEINFO * LPIMAGECACHEINFO;
  3210. typedef const IMAGECACHEINFO * LPCIMAGECACHEINFO;
  3211. #define ICIIFLAG_LARGE 0x0001
  3212. #define ICIIFLAG_SMALL 0x0002
  3213. #if (_WIN32_IE >= 0x0501)
  3214. #define ICIIFLAG_SORTBYUSED 0x0004
  3215. #endif
  3216. typedef struct _tagImageCacheInitInfo
  3217. {
  3218. DWORD cbSize;
  3219. DWORD dwMask;
  3220. HIMAGELIST himlLarge;
  3221. HIMAGELIST himlSmall;
  3222. SIZEL rgSizeLarge;
  3223. SIZEL rgSizeSmall;
  3224. DWORD dwFlags;
  3225. int iStart;
  3226. int iGrow;
  3227. }IMAGECACHEINITINFO;
  3228. typedef IMAGECACHEINITINFO * LPIMAGECACHEINITINFO;
  3229. #undef INTERFACE
  3230. #define INTERFACE IImageCache
  3231. DECLARE_INTERFACE_ ( IImageCache, IUnknown )
  3232. {
  3233. // *** IUnknown methods ***
  3234. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3235. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  3236. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  3237. // *** IImageCache methods ***
  3238. STDMETHOD ( AddImage ) ( THIS_ LPCIMAGECACHEINFO pInfo, UINT * puIndex ) PURE;
  3239. STDMETHOD ( FindImage ) ( THIS_ LPCIMAGECACHEINFO pInfo, UINT * puIndex ) PURE;
  3240. STDMETHOD ( FreeImage ) ( THIS_ UINT iImageIndex ) PURE;
  3241. STDMETHOD ( Flush )( THIS_ BOOL fRelease ) PURE;
  3242. STDMETHOD ( ChangeImageInfo ) ( THIS_ UINT IImageIndex, LPCIMAGECACHEINFO pInfo ) PURE;
  3243. STDMETHOD ( GetCacheSize ) ( THIS_ UINT * puSize ) PURE;
  3244. STDMETHOD ( GetUsage ) ( THIS_ UINT uIndex, UINT * puUsage ) PURE;
  3245. STDMETHOD( GetImageList ) ( THIS_ LPIMAGECACHEINITINFO pInfo ) PURE;
  3246. };
  3247. typedef IImageCache * LPIMAGECACHE;
  3248. #if (_WIN32_IE >= 0x0500)
  3249. // IImageCache 2
  3250. #undef INTERFACE
  3251. #define INTERFACE IImageCache2
  3252. DECLARE_INTERFACE_ ( IImageCache2, IImageCache )
  3253. {
  3254. // *** IUnknown methods ***
  3255. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3256. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  3257. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  3258. // *** IImageCache methods ***
  3259. STDMETHOD ( AddImage ) ( THIS_ LPCIMAGECACHEINFO pInfo, UINT * puIndex ) PURE;
  3260. STDMETHOD ( FindImage ) ( THIS_ LPCIMAGECACHEINFO pInfo, UINT * puIndex ) PURE;
  3261. STDMETHOD ( FreeImage ) ( THIS_ UINT iImageIndex ) PURE;
  3262. STDMETHOD ( Flush )( THIS_ BOOL fRelease ) PURE;
  3263. STDMETHOD ( ChangeImageInfo ) ( THIS_ UINT IImageIndex, LPCIMAGECACHEINFO pInfo ) PURE;
  3264. STDMETHOD ( GetCacheSize ) ( THIS_ UINT * puSize ) PURE;
  3265. STDMETHOD ( GetUsage ) ( THIS_ UINT uIndex, UINT * puUsage ) PURE;
  3266. STDMETHOD( GetImageList ) ( THIS_ LPIMAGECACHEINITINFO pInfo ) PURE;
  3267. // IImageCache2 methods
  3268. STDMETHOD ( DeleteImage ) ( THIS_ UINT iImageIndex ) PURE;
  3269. STDMETHOD ( GetImageInfo ) (THIS_ UINT iImageIndex, LPIMAGECACHEINFO pInfo ) PURE;
  3270. };
  3271. #endif
  3272. #if (_WIN32_IE >= 0x0501)
  3273. // These are values returned from IImageCache::GetUsage which correspond
  3274. // to the state of the cache entry
  3275. #define ICD_USAGE_NOUSAGE (UINT) -1
  3276. #define ICD_USAGE_DELETED (UINT) -2
  3277. #define ICD_USAGE_SYSTEM (UINT) -3
  3278. // IImageCache 3
  3279. #undef INTERFACE
  3280. #define INTERFACE IImageCache3
  3281. DECLARE_INTERFACE_ ( IImageCache3, IImageCache2 )
  3282. {
  3283. // *** IUnknown methods ***
  3284. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3285. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  3286. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  3287. // *** IImageCache methods ***
  3288. STDMETHOD ( AddImage ) ( THIS_ LPCIMAGECACHEINFO pInfo, UINT * puIndex ) PURE;
  3289. STDMETHOD ( FindImage ) ( THIS_ LPCIMAGECACHEINFO pInfo, UINT * puIndex ) PURE;
  3290. STDMETHOD ( FreeImage ) ( THIS_ UINT iImageIndex ) PURE;
  3291. STDMETHOD ( Flush )( THIS_ BOOL fRelease ) PURE;
  3292. STDMETHOD ( ChangeImageInfo ) ( THIS_ UINT IImageIndex, LPCIMAGECACHEINFO pInfo ) PURE;
  3293. STDMETHOD ( GetCacheSize ) ( THIS_ UINT * puSize ) PURE;
  3294. STDMETHOD ( GetUsage ) ( THIS_ UINT uIndex, UINT * puUsage ) PURE;
  3295. STDMETHOD ( GetImageList ) ( THIS_ LPIMAGECACHEINITINFO pInfo ) PURE;
  3296. // *** IImageCache2 methods ***
  3297. STDMETHOD ( DeleteImage ) ( THIS_ UINT iImageIndex ) PURE;
  3298. STDMETHOD ( GetImageInfo ) (THIS_ UINT iImageIndex, LPIMAGECACHEINFO pInfo ) PURE;
  3299. // *** IImageCache3 methods ***
  3300. STDMETHOD ( GetImageIndexFromCacheIndex )( UINT iCacheIndex, UINT * puImageIndex ) PURE;
  3301. };
  3302. #endif
  3303. ;end_internal
  3304. #if ( _WIN32_IE >= 0x0500 )
  3305. ///////////////////////////////////////////////////////////////////////
  3306. // interface for
  3307. #include <pshpack8.h>
  3308. typedef struct _EnumImageStoreDATAtag
  3309. {
  3310. WCHAR szPath[MAX_PATH];
  3311. FILETIME ftTimeStamp;
  3312. } ENUMSHELLIMAGESTOREDATA, * PENUMSHELLIMAGESTOREDATA;
  3313. #include <poppack.h> /* Return to byte packing */
  3314. #undef INTERFACE
  3315. #define INTERFACE IEnumShellImageStore
  3316. DECLARE_INTERFACE_( IEnumShellImageStore, IUnknown )
  3317. {
  3318. STDMETHOD ( QueryInterface ) ( THIS_ REFIID riid, void **ppv ) PURE;
  3319. STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
  3320. STDMETHOD_( ULONG, Release ) ( THIS ) PURE;
  3321. STDMETHOD ( Reset ) ( THIS ) PURE;
  3322. STDMETHOD ( Next ) ( THIS_ ULONG celt, PENUMSHELLIMAGESTOREDATA * prgElt, ULONG * pceltFetched ) PURE;
  3323. STDMETHOD ( Skip ) ( THIS_ ULONG celt ) PURE;
  3324. STDMETHOD ( Clone ) ( THIS_ IEnumShellImageStore ** ppEnum ) PURE;
  3325. };
  3326. typedef IEnumShellImageStore * LPENUMSHELLIMAGESTORE;
  3327. // flags used to determine the capabilities of the storage for the images
  3328. #define SHIMSTCAPFLAG_LOCKABLE 0x0001 // does the store require/support locking
  3329. #define SHIMSTCAPFLAG_PURGEABLE 0x0002 // does the store require dead items purging externally ?
  3330. #undef INTERFACE
  3331. #define INTERFACE IShellImageStore
  3332. // this interface is used to manipulate the Image cache. It can potentially be used
  3333. // in a free threaded manner in conjunction with the Lock parameter to Open and close
  3334. DECLARE_INTERFACE_( IShellImageStore, IUnknown )
  3335. {
  3336. STDMETHOD ( QueryInterface )( THIS_ REFIID riid, void **ppv ) PURE;
  3337. STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
  3338. STDMETHOD_( ULONG, Release ) ( THIS ) PURE;
  3339. // if the lock parameter is used, then all other calls into
  3340. // open and/or create will block until the lock is released.
  3341. STDMETHOD ( Open ) ( THIS_ DWORD dwMode, DWORD * pdwLock ) PURE;
  3342. STDMETHOD ( Create ) ( THIS_ DWORD dwMode, DWORD * pdwLock ) PURE;
  3343. // if the lock is passed to either of these two methods, it releases the lock
  3344. // once the operation is complete.
  3345. STDMETHOD ( ReleaseLock ) ( THIS_ DWORD const * pdwLock ) PURE;
  3346. STDMETHOD ( Close ) ( THIS_ DWORD const * pdwLock ) PURE;
  3347. STDMETHOD ( Commit ) ( THIS_ DWORD const * pdwLock ) PURE;
  3348. STDMETHOD ( IsLocked ) ( THIS ) PURE;
  3349. STDMETHOD ( GetMode ) ( THIS_ DWORD * pdwMode ) PURE;
  3350. STDMETHOD ( GetCapabilities ) ( THIS_ DWORD * pdwCapMask ) PURE;
  3351. STDMETHOD ( AddEntry ) ( THIS_ LPCWSTR pszName, const FILETIME * pftTimeStamp, DWORD dwMode, HBITMAP hImage ) PURE;
  3352. STDMETHOD ( GetEntry ) ( THIS_ LPCWSTR pszName, DWORD dwMode, HBITMAP * phImage ) PURE;
  3353. STDMETHOD ( DeleteEntry ) ( THIS_ LPCWSTR pszName ) PURE;
  3354. STDMETHOD ( IsEntryInStore ) ( THIS_ LPCWSTR pszName, FILETIME * pftTimeStamp ) PURE;
  3355. STDMETHOD ( Enum ) ( THIS_ LPENUMSHELLIMAGESTORE * ppEnum ) PURE;
  3356. };
  3357. typedef IShellImageStore * LPSHELLIMAGESTORE;
  3358. #endif
  3359. ;begin_internal
  3360. //
  3361. // Interface for interacting with the IE splash screen
  3362. //
  3363. #undef INTERFACE
  3364. #define INTERFACE ISplashScreen
  3365. DECLARE_INTERFACE_( ISplashScreen, IUnknown )
  3366. {
  3367. // *** IUnknown methods ***
  3368. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3369. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  3370. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  3371. // *** ISplashScreen methods ***
  3372. STDMETHOD ( Show ) ( THIS_ HINSTANCE hinst, UINT idResHi, UINT idResLow, HWND * phwnd ) PURE;
  3373. STDMETHOD ( Dismiss ) (THIS) PURE;
  3374. };
  3375. typedef ISplashScreen * LPSPLASHSCREEN;
  3376. ;begin_internal
  3377. //
  3378. // Interface for Multiple Monitor Configurations
  3379. //
  3380. #define MD_PRIMARY 0x00000001
  3381. #define MD_ATTACHED 0x00000002
  3382. #include <pshpack8.h>
  3383. typedef struct _MonitorData
  3384. {
  3385. DWORD dwSize;
  3386. DWORD dwFlags;
  3387. DWORD dwStatus;
  3388. RECT rcPos;
  3389. } MonitorData, * LPMONITORDATA;
  3390. #include <poppack.h> /* Return to byte packing */
  3391. #undef INTERFACE
  3392. #define INTERFACE IMultiMonConfig
  3393. DECLARE_INTERFACE_( IMultiMonConfig, IUnknown )
  3394. {
  3395. // *** IUnknown methods ***
  3396. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3397. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  3398. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  3399. // *** IMultiMonConfig methods ***
  3400. STDMETHOD ( Initialize ) ( THIS_ HWND hwndHost, WNDPROC WndProc, DWORD dwReserved) PURE;
  3401. STDMETHOD ( GetNumberOfMonitors ) (THIS_ int * pCMon, DWORD dwReserved) PURE;
  3402. STDMETHOD ( GetMonitorData) (THIS_ int iMonitor, MonitorData * pmd, DWORD dwReserved) PURE;
  3403. STDMETHOD ( Paint) (THIS_ int iMonitor, DWORD dwReserved) PURE;
  3404. };
  3405. typedef IMultiMonConfig * LPMULTIMONCONFIG;
  3406. ;end_internal
  3407. #endif // _WIN32_IE > 0x0400
  3408. //// IRestrict
  3409. // For the pdwRestrictionResult out parameter in IRestrict::IsRestricted() for
  3410. // all pguidIDs.
  3411. typedef enum
  3412. {
  3413. RR_ALLOW = 1,
  3414. RR_DISALLOW,
  3415. RR_NOCHANGE,
  3416. } RESTRICTION_RESULT;
  3417. // IRestrict::IsRestricted() dwRestrictAction parameter values for
  3418. // the RID_RDeskBars pguidID.
  3419. typedef enum
  3420. {
  3421. RA_DRAG = 1,
  3422. RA_DROP,
  3423. RA_ADD,
  3424. RA_CLOSE,
  3425. RA_MOVE,
  3426. } RESTRICT_ACTIONS;
  3427. #undef INTERFACE
  3428. #define INTERFACE IRestrict
  3429. DECLARE_INTERFACE_(IRestrict, IUnknown)
  3430. {
  3431. // *** IUnknown methods ***
  3432. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3433. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3434. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3435. // *** IRestrict Methods ***
  3436. STDMETHOD(IsRestricted) (THIS_ const GUID * pguidID, DWORD dwRestrictAction, VARIANT * pvarArgs, OUT DWORD * pdwRestrictionResult) PURE;
  3437. };
  3438. //// IAddressBand
  3439. #define OLECMD_REFRESH_TOPMOST 0x00000000
  3440. #define OLECMD_REFRESH_ENTIRELIST 0x00000001
  3441. #undef INTERFACE
  3442. #define INTERFACE IAddressBand
  3443. DECLARE_INTERFACE_(IAddressBand, IUnknown)
  3444. {
  3445. // *** IUnknown methods ***
  3446. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3447. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3448. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3449. // *** IAddressBand Methods ***
  3450. STDMETHOD(FileSysChange) (THIS_ DWORD dwEvent, LPCITEMIDLIST * ppidl1) PURE;
  3451. STDMETHOD(Refresh) (THIS_ VARIANT * pvarType) PURE;
  3452. };
  3453. #undef INTERFACE
  3454. #define INTERFACE IAddressEditBox
  3455. // Init Flags
  3456. #define AEB_INIT_DEFAULT 0x00000000
  3457. #define AEB_INIT_NOSHELL 0x00000001
  3458. #define AEB_INIT_NOWEB 0x00000002
  3459. #define AEB_INIT_NOFILE 0x00000004
  3460. #define AEB_INIT_AUTOEXEC 0x00000008 // Set if you want the item Navigated/ShellExeced when ENTER occurs.
  3461. #define AEB_INIT_SUBCLASS 0x00000010 // If set parent needs to pass HWND events thru IWinEventHandler::OnWinEvent()
  3462. #define AEB_INIT_NOASYNC 0x00000020 // Set if you don't want/support async navigation (from a modal dlg for instance)
  3463. // Parse Flags for IAddressEditBox::ParseNow()
  3464. #define SHURL_FLAGS_NONE 0x00000000
  3465. #define SHURL_FLAGS_NOUI 0x00000001 // Don't display any UI.
  3466. #define SHURL_FLAGS_NOSNS 0x00000002 // Ignore SHELL URLs. (FILE and Internet URLs still work)
  3467. #define SHURL_FLAGS_NOWEB 0x00000004 // Ignore WEB URLs. (Don't successfully parse if not found in shell name space)
  3468. #define SHURL_FLAGS_NOPATHSEARCH 0x00000008 // don't search on dos paths or app path
  3469. #define SHURL_FLAGS_AUTOCORRECT 0x00000010 // Try to autocorrect WEB URLs
  3470. // Exec Flags for IAddressEditBox::Execute()
  3471. #define SHURL_EXECFLAGS_NONE 0x00000000
  3472. #define SHURL_EXECFLAGS_SEPVDM 0x00000001 // If ShellExec(), set SEE_MASK_FLAG_SEPVDM fMask.
  3473. #define SHURL_EXECFLAGS_DONTFORCEIE 0x00000002 // If some browser other than IE is associated with HTML files, allow them to launch.
  3474. DECLARE_INTERFACE_(IAddressEditBox, IUnknown)
  3475. {
  3476. // *** IUnknown methods ***
  3477. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3478. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3479. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3480. // *** IAddressEditBox Methods ***
  3481. STDMETHOD(Init) (THIS_ HWND hwnd, HWND hwndEditBox, DWORD dwFlags, IUnknown * punkParent) PURE;
  3482. STDMETHOD(SetCurrentDir) (THIS_ LPCOLESTR pwzDir) PURE;
  3483. STDMETHOD(ParseNow) (THIS_ DWORD dwParseFlags) PURE;
  3484. STDMETHOD(Execute) (THIS_ DWORD dwExecFlags) PURE;
  3485. STDMETHOD(Save) (THIS_ DWORD dwReserved) PURE;
  3486. };
  3487. ;begin_both
  3488. #if (_WIN32_IE >= 0x0400)
  3489. ;end_both
  3490. ;end_internal
  3491. //// IShellFolderBand
  3492. // Field mask
  3493. #define ISFB_MASK_STATE 0x00000001 // TRUE if dwStateMask and dwState is valid
  3494. #define ISFB_MASK_BKCOLOR 0x00000002 // TRUE if crBkgnd field is valid
  3495. #define ISFB_MASK_VIEWMODE 0x00000004 // TRUE if wViewMode field is valid
  3496. #define ISFB_MASK_SHELLFOLDER 0x00000008
  3497. #define ISFB_MASK_IDLIST 0x00000010
  3498. #define ISFB_MASK_COLORS 0x00000020 // TRUE if crXXXX fields are valid (except bkgnd)
  3499. #define ISFB_MASK_ALL 0x0000003F // ;Internal
  3500. #define ISFB_MASK_INVALID (~(ISFB_MASK_ALL)) // ;Internal
  3501. #define ISFB_STATE_DEFAULT 0x00000000
  3502. #define ISFB_STATE_DEBOSSED 0x00000001
  3503. #define ISFB_STATE_ALLOWRENAME 0x00000002
  3504. #define ISFB_STATE_NOSHOWTEXT 0x00000004 // TRUE if _fNoShowText
  3505. //#define ISFB_STATE_NOTITLE 0x00000008 // obsolete! (use cbs::SetBandState) ;Internal
  3506. #define ISFB_STATE_CHANNELBAR 0x00000010 // TRUE if we want NavigateTarget support
  3507. #define ISFB_STATE_QLINKSMODE 0x00000020 // TRUE if we want to turn off drag & drop onto content items
  3508. #define ISFB_STATE_FULLOPEN 0x00000040 // TRUE if band should maximize when opened
  3509. #define ISFB_STATE_NONAMESORT 0x00000080 // TRUE if band should _not_ sort icons by name
  3510. #define ISFB_STATE_BTNMINSIZE 0x00000100 // TRUE if band should report min thickness of button
  3511. #define ISFB_STATE_ALL 0x000001FF // ;Internal
  3512. #define ISFBVIEWMODE_SMALLICONS 0x0001
  3513. #define ISFBVIEWMODE_LARGEICONS 0x0002
  3514. #define ISFBVIEWMODE_LOGOS 0x0003
  3515. #include <pshpack8.h>
  3516. typedef struct {
  3517. DWORD dwMask; // [in] ISFB_MASK mask of valid fields from crBkgnd on
  3518. DWORD dwStateMask; // [in] ISFB_STATE mask of dwState bits being set/queried
  3519. DWORD dwState; // [in/out] ISFB_STATE bits
  3520. COLORREF crBkgnd; // [in/out]
  3521. COLORREF crBtnLt; // [in/out]
  3522. COLORREF crBtnDk; // [in/out]
  3523. WORD wViewMode; // [in/out]
  3524. WORD wAlign; // not used (yet)
  3525. IShellFolder * psf; // [out]
  3526. LPITEMIDLIST pidl; // [out]
  3527. } BANDINFOSFB, *PBANDINFOSFB;
  3528. #include <poppack.h> /* Return to byte packing */
  3529. #undef INTERFACE
  3530. #define INTERFACE IShellFolderBand
  3531. DECLARE_INTERFACE_(IShellFolderBand, IUnknown)
  3532. {
  3533. // *** IUnknown methods ***
  3534. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3535. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3536. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3537. // *** IShellFolderBand Methods ***
  3538. STDMETHOD(InitializeSFB)(THIS_ IShellFolder *psf, LPCITEMIDLIST pidl) PURE;
  3539. STDMETHOD(SetBandInfoSFB)(THIS_ PBANDINFOSFB pbi) PURE;
  3540. STDMETHOD(GetBandInfoSFB)(THIS_ PBANDINFOSFB pbi) PURE;
  3541. };
  3542. // Command Target IDs
  3543. enum {
  3544. SFBID_PIDLCHANGED,
  3545. };
  3546. ;begin_internal
  3547. //-------------------------------------------------------------------------
  3548. //
  3549. // IWinEventHandler interface
  3550. //
  3551. // An object that wants to send messages to another object (typically
  3552. // a sub-object) QI's for the sub-object's IWinEventHandler interface.
  3553. // Once the object determines the hwnd is owned by the sub-object (via
  3554. // IsWindowOwner), the object calls OnWinEvent for send the message.
  3555. //
  3556. //
  3557. // [Member functions]
  3558. //
  3559. // IWinEventHandler::IsWindowOwner(hwnd)
  3560. // Returns S_OK if the hwnd is owned by the object, S_FALSE if not.
  3561. //
  3562. // IWinEventHandler::OnWinEvent(hwnd, dwMsg, wParam, lParam, plRet)
  3563. // Sends a message to the object. The Win32 return value (i.e., the
  3564. // value returned by DefWindowProc) is returned in *plRet. Return
  3565. // S_OK if the message is handled, otherwise S_FALSE.
  3566. //
  3567. //-------------------------------------------------------------------------
  3568. #undef INTERFACE
  3569. #define INTERFACE IWinEventHandler
  3570. DECLARE_INTERFACE_(IWinEventHandler, IUnknown)
  3571. {
  3572. // *** IUnknown methods ***
  3573. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3574. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3575. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3576. // *** IWinEventHandler Methods ***
  3577. STDMETHOD(OnWinEvent) (THIS_ HWND hwnd, UINT dwMsg, WPARAM wParam, LPARAM lParam, LRESULT* plres) PURE;
  3578. STDMETHOD(IsWindowOwner) (THIS_ HWND hwnd) PURE;
  3579. };
  3580. ;end_internal
  3581. //// IDeskBarClient
  3582. #undef INTERFACE
  3583. #define INTERFACE IDeskBarClient
  3584. DECLARE_INTERFACE_(IDeskBarClient, IOleWindow)
  3585. {
  3586. // *** IUnknown methods ***
  3587. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3588. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3589. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3590. // *** IOleWindow methods ***
  3591. STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  3592. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  3593. // *** IDeskBarClient methods ***
  3594. STDMETHOD(SetDeskBarSite) (THIS_ IUnknown* punkSite) PURE;
  3595. STDMETHOD(SetModeDBC) (THIS_ DWORD dwMode) PURE;
  3596. STDMETHOD(UIActivateDBC) (THIS_ DWORD dwState) PURE;
  3597. STDMETHOD(GetSize) (THIS_ DWORD dwWhich, LPRECT prc) PURE;
  3598. };
  3599. #define DBC_GS_IDEAL 0 // get the ideal size
  3600. #define DBC_GS_SIZEDOWN 1 // clip the height of a rect to a multiple of the rebar's integral size
  3601. #define DBC_HIDE 0 // Band is hidden (being destroyed)
  3602. #define DBC_SHOW 1 // Band is visible
  3603. #define DBC_SHOWOBSCURE 2 // Band is completely obscured
  3604. enum {
  3605. DBCID_EMPTY = 0, // bandsite is empty
  3606. DBCID_ONDRAG = 1, // (down)DragMoveEnter/Leave vaIn:I4:eDrag
  3607. DBCID_CLSIDOFBAR = 2, // clsid of bar inside
  3608. DBCID_RESIZE = 3, // resize from keyboard
  3609. DBCID_GETBAR = 4, // returns vaOut:VT_UNKNOWN of hosting dockbar (IDeskBar)
  3610. };
  3611. ;begin_both
  3612. #endif // _WIN32_IE > 0x0400
  3613. ;end_both
  3614. ;begin_internal
  3615. //==========================================================================
  3616. // IExplorerToolbar interfaces
  3617. //
  3618. // This is an interface to the shell toolbar which allows shell views
  3619. // to add buttons and process.
  3620. // See http://ohserv/users/satona/toolbar_extension.htm for spec.
  3621. //
  3622. //==========================================================================
  3623. // Bitmap types
  3624. #define BITMAP_NORMAL 0x1
  3625. #define BITMAP_HOT 0x2
  3626. #define BITMAP_DISABLED 0x3
  3627. // Band Visibility Flags
  3628. #define VBF_TOOLS 0x00000001
  3629. #define VBF_ADDRESS 0x00000002
  3630. #define VBF_LINKS 0x00000004
  3631. #define VBF_BRAND 0x00000008
  3632. #define VBF_MENU 0x00000010
  3633. #define VBF_ONELINETEXT 0x00000020
  3634. #define VBF_TWOLINESTEXT 0x00000040
  3635. #define VBF_NOCUSTOMIZE 0x00000080
  3636. #define VBF_EXTERNALBANDS 0xFFFF0000
  3637. #define VBF_VALID (VBF_TOOLS | VBF_ADDRESS | VBF_LINKS | VBF_BRAND | VBF_MENU | VBF_EXTERNALBANDS)
  3638. #undef INTERFACE
  3639. #define INTERFACE IExplorerToolbar
  3640. typedef enum {
  3641. ETCMDID_GETBUTTONS = 0x0001,
  3642. ETCMDID_NEWCOMMANDTARGET = 0x0002, // sent to the previous command target when a new one is coming in
  3643. #if (_WIN32_IE >= 0x500)
  3644. ETCMDID_RELOADBUTTONS = 0x0003, // command target needs to call AddButtons again
  3645. #endif
  3646. } ENUM_ETCMDID;
  3647. DECLARE_INTERFACE_(IExplorerToolbar, IUnknown)
  3648. {
  3649. // *** IUnknown methods ***
  3650. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3651. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3652. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3653. // *** IExplorerToolbar methods ***
  3654. STDMETHOD(SetCommandTarget) (THIS_ IUnknown* punkCmdTarget, const GUID* pguidCmdGrp, DWORD dwFlags) PURE;
  3655. STDMETHOD(AddStdBrowserButtons) (THIS) PURE;
  3656. // Wrap of the TB_* messages the messages that are implmented
  3657. // are just the ones to add delete and modify the buttons, and not
  3658. // the ones to manipulate the toolbar.
  3659. STDMETHOD(AddButtons) (THIS_ const GUID * pguidButtonGroup, UINT nButtons, const TBBUTTON * lpButtons) PURE;
  3660. STDMETHOD(AddString) (THIS_ const GUID * pguidButtonGroup, HINSTANCE hInst, UINT_PTR uiResID, LRESULT * pOffset) PURE;
  3661. STDMETHOD(GetButton) (THIS_ const GUID * pguidButtonGroup, UINT uiCommand, LPTBBUTTON lpButton) PURE;
  3662. STDMETHOD(GetState) (THIS_ const GUID * pguidButtonGroup, UINT uiCommand, UINT * pfState) PURE;
  3663. STDMETHOD(SetState) (THIS_ const GUID * pguidButtonGroup, UINT uiCommand, UINT fState) PURE;
  3664. STDMETHOD(AddBitmap) (THIS_ const GUID * pguidButtonGroup, UINT uiBMPType, UINT uiCount, TBADDBITMAP * ptb,
  3665. LRESULT * pOffset, COLORREF rgbMask) PURE;
  3666. STDMETHOD(GetBitmapSize) (THIS_ UINT * uiID) PURE;
  3667. STDMETHOD(SendToolbarMsg) (THIS_ const GUID * pguidButtonGroup, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT * plRes) PURE;
  3668. STDMETHOD(SetImageList) (THIS_ const GUID* pguidCmdGroup, HIMAGELIST himlNormal, HIMAGELIST himlHot, HIMAGELIST himlDisabled) PURE;
  3669. STDMETHOD(ModifyButton) (THIS_ const GUID * pguidButtonGroup, UINT uiCommand, LPTBBUTTON lpButton) PURE;
  3670. };
  3671. //==========================================================================
  3672. // DefView supports a private service id for extended views.
  3673. // DefView's IOleCommandTarget supports the below command group and ids too.
  3674. //==========================================================================
  3675. // SID_DefView and CGID_DefView are defined in shlguid.w
  3676. //
  3677. #define DVCMDID_GETTHISDIRPATH 1 // pvaOut = path to this directory (if in filesystem)
  3678. #define DVCMDID_GETTHISDIRNAME 2 // pvaOut = friendly name of this directory
  3679. #define DVCMDID_GETTEMPLATEDIRNAME 3 // pvaOut = webview template (.htt) dir
  3680. ;end_internal
  3681. #if (_WIN32_IE >= 0x400)
  3682. //
  3683. // We need to make sure that WININET.H is included before this interface is
  3684. // used because the COMPONENT structure uses INTERNET_MAX_URL_LENGTH
  3685. //
  3686. #ifdef _WININET_
  3687. //
  3688. // Flags and structures used by IActiveDesktop
  3689. //
  3690. typedef struct _tagWALLPAPEROPT
  3691. {
  3692. DWORD dwSize; // size of this Structure.
  3693. DWORD dwStyle; // WPSTYLE_* mentioned above
  3694. }
  3695. WALLPAPEROPT;
  3696. typedef WALLPAPEROPT *LPWALLPAPEROPT;
  3697. typedef const WALLPAPEROPT *LPCWALLPAPEROPT;
  3698. typedef struct _tagCOMPONENTSOPT
  3699. {
  3700. DWORD dwSize; //Size of this structure
  3701. BOOL fEnableComponents; //Enable components?
  3702. BOOL fActiveDesktop; // Active desktop enabled ?
  3703. }
  3704. COMPONENTSOPT;
  3705. typedef COMPONENTSOPT *LPCOMPONENTSOPT;
  3706. typedef const COMPONENTSOPT *LPCCOMPONENTSOPT;
  3707. typedef struct _tagCOMPPOS
  3708. {
  3709. DWORD dwSize; //Size of this structure
  3710. int iLeft; //Left of top-left corner in screen co-ordinates.
  3711. int iTop; //Top of top-left corner in screen co-ordinates.
  3712. DWORD dwWidth; // Width in pixels.
  3713. DWORD dwHeight; // Height in pixels.
  3714. int izIndex; // Indicates the Z-order of the component.
  3715. BOOL fCanResize; // Is the component resizeable?
  3716. BOOL fCanResizeX; // Resizeable in X-direction?
  3717. BOOL fCanResizeY; // Resizeable in Y-direction?
  3718. int iPreferredLeftPercent; //Left of top-left corner as percent of screen width
  3719. int iPreferredTopPercent; //Top of top-left corner as percent of screen height
  3720. }
  3721. COMPPOS;
  3722. typedef COMPPOS *LPCOMPPOS;
  3723. typedef const COMPPOS *LPCCOMPPOS;
  3724. typedef struct _tagCOMPSTATEINFO
  3725. {
  3726. DWORD dwSize; // Size of this structure.
  3727. int iLeft; // Left of the top-left corner in screen co-ordinates.
  3728. int iTop; // Top of top-left corner in screen co-ordinates.
  3729. DWORD dwWidth; // Width in pixels.
  3730. DWORD dwHeight; // Height in pixels.
  3731. DWORD dwItemState; // State of the component (full-screen mode or split-screen or normal state.
  3732. }
  3733. COMPSTATEINFO;
  3734. typedef COMPSTATEINFO *LPCOMPSTATEINFO;
  3735. typedef const COMPSTATEINFO *LPCCOMPSTATEINFO;
  3736. #define COMPONENT_TOP (0x3fffffff) // izOrder value meaning component is at the top
  3737. // iCompType values
  3738. #define COMP_TYPE_HTMLDOC 0
  3739. #define COMP_TYPE_PICTURE 1
  3740. #define COMP_TYPE_WEBSITE 2
  3741. #define COMP_TYPE_CONTROL 3
  3742. #define COMP_TYPE_CFHTML 4
  3743. #define COMP_TYPE_MAX 4
  3744. // The following is the COMPONENT structure used in IE4.01, IE4.0 and Memphis. It is kept here for compatibility
  3745. // reasons.
  3746. typedef struct _tagIE4COMPONENT
  3747. {
  3748. DWORD dwSize; //Size of this structure
  3749. DWORD dwID; //Reserved: Set it always to zero.
  3750. int iComponentType; //One of COMP_TYPE_*
  3751. BOOL fChecked; // Is this component enabled?
  3752. BOOL fDirty; // Had the component been modified and not yet saved to disk?
  3753. BOOL fNoScroll; // Is the component scrollable?
  3754. COMPPOS cpPos; // Width, height etc.,
  3755. WCHAR wszFriendlyName[MAX_PATH]; // Friendly name of component.
  3756. WCHAR wszSource[INTERNET_MAX_URL_LENGTH]; //URL of the component.
  3757. WCHAR wszSubscribedURL[INTERNET_MAX_URL_LENGTH]; //Subscrined URL
  3758. }
  3759. IE4COMPONENT;
  3760. typedef IE4COMPONENT *LPIE4COMPONENT;
  3761. typedef const IE4COMPONENT *LPCIE4COMPONENT;
  3762. //
  3763. // The following is the new NT5 component structure. Note that the initial portion of this component exactly
  3764. // matches the IE4COMPONENT structure. All new fields are added at the bottom and the dwSize field is used to
  3765. // distinguish between IE4COMPONENT and the new COMPONENT structures.
  3766. //
  3767. typedef struct _tagCOMPONENT
  3768. {
  3769. DWORD dwSize; //Size of this structure
  3770. DWORD dwID; //Reserved: Set it always to zero.
  3771. int iComponentType; //One of COMP_TYPE_*
  3772. BOOL fChecked; // Is this component enabled?
  3773. BOOL fDirty; // Had the component been modified and not yet saved to disk?
  3774. BOOL fNoScroll; // Is the component scrollable?
  3775. COMPPOS cpPos; // Width, height etc.,
  3776. WCHAR wszFriendlyName[MAX_PATH]; // Friendly name of component.
  3777. WCHAR wszSource[INTERNET_MAX_URL_LENGTH]; //URL of the component.
  3778. WCHAR wszSubscribedURL[INTERNET_MAX_URL_LENGTH]; //Subscrined URL
  3779. //New fields are added below. Everything above here must exactly match the IE4COMPONENT Structure.
  3780. DWORD dwCurItemState; // Current state of the Component.
  3781. COMPSTATEINFO csiOriginal; // Original state of the component when it was first added.
  3782. COMPSTATEINFO csiRestored; // Restored state of the component.
  3783. }
  3784. COMPONENT;
  3785. typedef COMPONENT *LPCOMPONENT;
  3786. typedef const COMPONENT *LPCCOMPONENT;
  3787. // Defines for dwCurItemState
  3788. #define IS_NORMAL 0x00000001
  3789. #define IS_FULLSCREEN 0x00000002
  3790. #define IS_SPLIT 0x00000004
  3791. #define IS_VALIDSIZESTATEBITS (IS_NORMAL | IS_SPLIT | IS_FULLSCREEN) // The set of IS_* state bits which define the "size" of the component - these bits are mutually exclusive.
  3792. #define IS_VALIDSTATEBITS (IS_NORMAL | IS_SPLIT | IS_FULLSCREEN | 0x80000000 | 0x40000000) // All of the currently defined IS_* bits.
  3793. ;begin_internal
  3794. #define IS_ADJUSTLISTVIEW 0x80000000
  3795. #define IS_INTERNALDUMMYBIT 0x40000000
  3796. #define IS_VALIDINTERNALBITS (IS_ADJUSTLISTVIEW | IS_INTERNALDUMMYBIT)
  3797. ;end_internal
  3798. ////////////////////////////////////////////
  3799. // Flags for IActiveDesktop::ApplyChanges()
  3800. #define AD_APPLY_SAVE 0x00000001
  3801. #define AD_APPLY_HTMLGEN 0x00000002
  3802. #define AD_APPLY_REFRESH 0x00000004
  3803. #define AD_APPLY_ALL (AD_APPLY_SAVE | AD_APPLY_HTMLGEN | AD_APPLY_REFRESH)
  3804. #define AD_APPLY_FORCE 0x00000008
  3805. #define AD_APPLY_BUFFERED_REFRESH 0x00000010
  3806. #define AD_APPLY_DYNAMICREFRESH 0x00000020
  3807. ////////////////////////////////////////////
  3808. // Flags for IActiveDesktop::GetWallpaperOptions()
  3809. // IActiveDesktop::SetWallpaperOptions()
  3810. #define WPSTYLE_CENTER 0
  3811. #define WPSTYLE_TILE 1
  3812. #define WPSTYLE_STRETCH 2
  3813. #define WPSTYLE_MAX 3
  3814. ////////////////////////////////////////////
  3815. // Flags for IActiveDesktop::ModifyComponent()
  3816. #define COMP_ELEM_TYPE 0x00000001
  3817. #define COMP_ELEM_CHECKED 0x00000002
  3818. #define COMP_ELEM_DIRTY 0x00000004
  3819. #define COMP_ELEM_NOSCROLL 0x00000008
  3820. #define COMP_ELEM_POS_LEFT 0x00000010
  3821. #define COMP_ELEM_POS_TOP 0x00000020
  3822. #define COMP_ELEM_SIZE_WIDTH 0x00000040
  3823. #define COMP_ELEM_SIZE_HEIGHT 0x00000080
  3824. #define COMP_ELEM_POS_ZINDEX 0x00000100
  3825. #define COMP_ELEM_SOURCE 0x00000200
  3826. #define COMP_ELEM_FRIENDLYNAME 0x00000400
  3827. #define COMP_ELEM_SUBSCRIBEDURL 0x00000800
  3828. #define COMP_ELEM_ORIGINAL_CSI 0x00001000
  3829. #define COMP_ELEM_RESTORED_CSI 0x00002000
  3830. #define COMP_ELEM_CURITEMSTATE 0x00004000
  3831. #define COMP_ELEM_ALL (COMP_ELEM_TYPE | COMP_ELEM_CHECKED | COMP_ELEM_DIRTY | \
  3832. COMP_ELEM_NOSCROLL | COMP_ELEM_POS_LEFT | COMP_ELEM_SIZE_WIDTH | \
  3833. COMP_ELEM_SIZE_HEIGHT | COMP_ELEM_POS_ZINDEX | COMP_ELEM_SOURCE | \
  3834. COMP_ELEM_FRIENDLYNAME | COMP_ELEM_POS_TOP | COMP_ELEM_SUBSCRIBEDURL | \
  3835. COMP_ELEM_ORIGINAL_CSI | COMP_ELEM_RESTORED_CSI | COMP_ELEM_CURITEMSTATE)
  3836. ////////////////////////////////////////////
  3837. // Flags for IActiveDesktop::AddDesktopItemWithUI()
  3838. typedef enum tagDTI_ADTIWUI
  3839. {
  3840. DTI_ADDUI_DEFAULT = 0x00000000,
  3841. DTI_ADDUI_DISPSUBWIZARD = 0x00000001,
  3842. DTI_ADDUI_POSITIONITEM = 0x00000002,
  3843. };
  3844. ////////////////////////////////////////////
  3845. // Flags for IActiveDesktop::AddUrl()
  3846. #define ADDURL_SILENT 0X0001
  3847. ////////////////////////////////////////////
  3848. // Default positions for ADI
  3849. #define COMPONENT_DEFAULT_LEFT (0xFFFF)
  3850. #define COMPONENT_DEFAULT_TOP (0xFFFF)
  3851. //
  3852. // Interface for manipulating the Active Desktop.
  3853. //
  3854. #undef INTERFACE
  3855. #define INTERFACE IActiveDesktop
  3856. DECLARE_INTERFACE_( IActiveDesktop, IUnknown )
  3857. {
  3858. // IUnknown methods
  3859. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3860. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  3861. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  3862. // IActiveDesktop methods
  3863. STDMETHOD (ApplyChanges)(THIS_ DWORD dwFlags) PURE;
  3864. STDMETHOD (GetWallpaper)(THIS_ LPWSTR pwszWallpaper, UINT cchWallpaper, DWORD dwReserved) PURE;
  3865. STDMETHOD (SetWallpaper)(THIS_ LPCWSTR pwszWallpaper, DWORD dwReserved) PURE;
  3866. STDMETHOD (GetWallpaperOptions)(THIS_ LPWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
  3867. STDMETHOD (SetWallpaperOptions)(THIS_ LPCWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
  3868. STDMETHOD (GetPattern)(THIS_ LPWSTR pwszPattern, UINT cchPattern, DWORD dwReserved) PURE;
  3869. STDMETHOD (SetPattern)(THIS_ LPCWSTR pwszPattern, DWORD dwReserved) PURE;
  3870. STDMETHOD (GetDesktopItemOptions)(THIS_ LPCOMPONENTSOPT pco, DWORD dwReserved) PURE;
  3871. STDMETHOD (SetDesktopItemOptions)(THIS_ LPCCOMPONENTSOPT pco, DWORD dwReserved) PURE;
  3872. STDMETHOD (AddDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
  3873. STDMETHOD (AddDesktopItemWithUI)(THIS_ HWND hwnd, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  3874. STDMETHOD (ModifyDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwFlags) PURE;
  3875. STDMETHOD (RemoveDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
  3876. STDMETHOD (GetDesktopItemCount)(THIS_ LPINT lpiCount, DWORD dwReserved) PURE;
  3877. STDMETHOD (GetDesktopItem)(THIS_ int nComponent, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  3878. STDMETHOD (GetDesktopItemByID)(THIS_ ULONG_PTR dwID, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  3879. STDMETHOD (GenerateDesktopItemHtml)(THIS_ LPCWSTR pwszFileName, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  3880. STDMETHOD (AddUrl)(THIS_ HWND hwnd, LPCWSTR pszSource, LPCOMPONENT pcomp, DWORD dwFlags) PURE;
  3881. STDMETHOD (GetDesktopItemBySource)(THIS_ LPCWSTR pwszSource, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  3882. };
  3883. typedef IActiveDesktop * LPACTIVEDESKTOP;
  3884. // Flags for SetSafeMode
  3885. #define SSM_CLEAR 0x0000
  3886. #define SSM_SET 0x0001
  3887. #define SSM_REFRESH 0x0002
  3888. #define SSM_UPDATE 0x0004
  3889. // Flags for Set/GetScheme
  3890. #define SCHEME_DISPLAY 0x0001
  3891. #define SCHEME_EDIT 0x0002
  3892. #define SCHEME_LOCAL 0x0004
  3893. #define SCHEME_GLOBAL 0x0008
  3894. #define SCHEME_REFRESH 0x0010
  3895. #define SCHEME_UPDATE 0x0020
  3896. #define SCHEME_DONOTUSE 0x0040 // used to be SCHEME_ENUMERATE; no longer supported
  3897. #define SCHEME_CREATE 0x0080
  3898. #undef INTERFACE
  3899. #define INTERFACE IActiveDesktopP
  3900. DECLARE_INTERFACE_( IActiveDesktopP, IUnknown )
  3901. {
  3902. // IUnknown methods
  3903. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3904. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  3905. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  3906. // IActiveDesktopP methods
  3907. STDMETHOD (SetSafeMode)(THIS_ DWORD dwFlags) PURE;
  3908. STDMETHOD (EnsureUpdateHTML)(THIS) PURE;
  3909. STDMETHOD (SetScheme)(THIS_ LPCWSTR pwszSchemeName, DWORD dwFlags) PURE;
  3910. STDMETHOD (GetScheme)(THIS_ LPWSTR pwszSchemeName, DWORD *lpdwcchBuffer, DWORD dwFlags) PURE;
  3911. //
  3912. };
  3913. typedef IActiveDesktopP * LPACTIVEDESKTOPP;
  3914. //Flags for GetObjectFlags
  3915. #define GADOF_DIRTY 0x00000001
  3916. #undef INTERFACE
  3917. #define INTERFACE IADesktopP2
  3918. DECLARE_INTERFACE_( IADesktopP2, IUnknown )
  3919. {
  3920. // IUnknown methods
  3921. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3922. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  3923. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  3924. // IADesktopP2 methods
  3925. STDMETHOD (ReReadWallpaper)(THIS) PURE;
  3926. STDMETHOD (GetADObjectFlags)(THIS_ DWORD *lpdwFlags, DWORD dwMask) PURE;
  3927. STDMETHOD (UpdateAllDesktopSubscriptions)(THIS) PURE;
  3928. STDMETHOD (MakeDynamicChanges)(THIS_ IOleObject *pOleObj) PURE;
  3929. };
  3930. typedef IADesktopP2 * LPADESKTOPP2;
  3931. #endif // _WININET_
  3932. #if (_WIN32_IE >= 0x0500)
  3933. #define MAX_COLUMN_NAME_LEN 80
  3934. #define MAX_COLUMN_DESC_LEN 128
  3935. #include <pshpack1.h>
  3936. typedef struct {
  3937. SHCOLUMNID scid; // OUT the unique identifier of this column
  3938. VARTYPE vt; // OUT the native type of the data returned
  3939. DWORD fmt; // OUT this listview format (LVCFMT_LEFT, usually)
  3940. UINT cChars; // OUT the default width of the column, in characters
  3941. DWORD csFlags; // OUT SHCOLSTATE flags
  3942. WCHAR wszTitle[MAX_COLUMN_NAME_LEN]; // OUT the title of the column
  3943. WCHAR wszDescription[MAX_COLUMN_DESC_LEN]; // OUT full description of this column
  3944. } SHCOLUMNINFO, *LPSHCOLUMNINFO;
  3945. typedef const SHCOLUMNINFO* LPCSHCOLUMNINFO;
  3946. #include <poppack.h> /* Return to default */
  3947. #include <pshpack8.h>
  3948. typedef struct {
  3949. ULONG dwFlags; // initialization flags
  3950. ULONG dwReserved; // reserved for future use.
  3951. WCHAR wszFolder[MAX_PATH]; // fully qualified folder path (or empty if multiple folders)
  3952. } SHCOLUMNINIT, *LPSHCOLUMNINIT;
  3953. typedef const SHCOLUMNINIT* LPCSHCOLUMNINIT;
  3954. #define SHCDF_UPDATEITEM 0x00000001 // this flag is a hint that the file has changed since the last call to GetItemData
  3955. typedef struct {
  3956. ULONG dwFlags; // combination of SHCDF_ flags.
  3957. DWORD dwFileAttributes; // file attributes.
  3958. ULONG dwReserved; // reserved for future use.
  3959. WCHAR* pwszExt; // address of file name extension
  3960. WCHAR wszFile[MAX_PATH]; // Absolute path of file.
  3961. } SHCOLUMNDATA, *LPSHCOLUMNDATA;
  3962. typedef const SHCOLUMNDATA* LPCSHCOLUMNDATA;
  3963. #include <poppack.h> /* Return to byte packing */
  3964. #undef INTERFACE
  3965. #define INTERFACE IColumnProvider
  3966. // Note: these objects must be threadsafe! GetItemData _will_ be called
  3967. // simultaneously from multiple threads.
  3968. DECLARE_INTERFACE_(IColumnProvider, IUnknown)
  3969. {
  3970. // IUnknown methods
  3971. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3972. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  3973. STDMETHOD_(ULONG, Release)(THIS) PURE;
  3974. // IColumnProvider methods
  3975. STDMETHOD (Initialize)(THIS_ LPCSHCOLUMNINIT psci) PURE;
  3976. STDMETHOD (GetColumnInfo)(THIS_ DWORD dwIndex, SHCOLUMNINFO *psci) PURE;
  3977. STDMETHOD (GetItemData)(THIS_ LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData) PURE;
  3978. };
  3979. ///////////////////////////////////////////////////////
  3980. //
  3981. // Drag and Drop helper
  3982. //
  3983. // Purpose: To expose the Shell drag images
  3984. //
  3985. // This interface is implemented in the shell by CLSID_DragDropHelper.
  3986. //
  3987. // To use:
  3988. // If you are the source of a drag (i.e. in response to LV_DRAGBEGIN or
  3989. // equivelent begin drag message) call
  3990. // IDragSourceHelper::InitializeFromWindow
  3991. // (<hwnd of window supporting DI_GETDRAGIMAGE>,
  3992. // <pointer to POINT indicating offset to the mouse from
  3993. // the upper left corner of the image>,
  3994. // <pointer to data object>)
  3995. //
  3996. // NOTE: The Data object must support IDataObject::SetData with multiple
  3997. // data types and GetData must implement data type cloning
  3998. // (Including HGLOBAL), not just aliasing.
  3999. //
  4000. // If you wish to have an image while over your application add the
  4001. // IDragImages::Dr* calls to your IDropTarget implementation. For Example:
  4002. //
  4003. // STDMETHODIMP CUserDropTarget::DragEnter(IDataObject* pDataObject,
  4004. // DWORD grfKeyState,
  4005. // POINTL pt, DWORD* pdwEffect)
  4006. // {
  4007. // // Process your DragEnter
  4008. // // Call IDragImages::DragEnter last.
  4009. // _pDropTargetHelper->DragEnter(_hwndDragOver, pDataObject,
  4010. // (POINT*)&pt, *pdwEffect);
  4011. // return hres;
  4012. // }
  4013. //
  4014. //
  4015. // If you wish to be able to source a drag image from a custom control,
  4016. // implement a handler for the RegisterWindowMessage(DI_GETDRAGIMAGE).
  4017. // The LPARAM is a pointer to an SHDRAGIMAGE structure.
  4018. //
  4019. // sizeDragImage - Calculate the length and width required to render
  4020. // the images.
  4021. // ptOffset - Calculate the offset from the upper left corner to
  4022. // the mouse cursor within the image
  4023. // hbmpDragImage - CreateBitmap( sizeDragImage.cx, sizeDragImage.cy,
  4024. // GetDeviceCaps(hdcScreen, PLANES),
  4025. // GetDeviceCaps(hdcScreen, BITSPIXEL),
  4026. // NULL);
  4027. //
  4028. // Drag Images will only be displayed on Windows NT 5.0 or later.
  4029. //
  4030. //
  4031. // Note about IDropTargetHelper::Show - This method is provided for
  4032. // showing/hiding the Drag image in low color depth video modes. When
  4033. // painting to a window that is currently being dragged over (i.e. For
  4034. // indicating a selection) you need to hide the drag image by calling this
  4035. // method passing FALSE. After the window is done painting, Show the image
  4036. // again by passing TRUE.
  4037. #include <pshpack8.h>
  4038. typedef struct
  4039. {
  4040. SIZE sizeDragImage; // OUT - The length and Width of the
  4041. // rendered image
  4042. POINT ptOffset; // OUT - The Offset from the mouse cursor to
  4043. // the upper left corner of the image
  4044. HBITMAP hbmpDragImage; // OUT - The Bitmap containing the rendered
  4045. // drag images
  4046. COLORREF crColorKey; // OUT - The COLORREF that has been blitted
  4047. // to the background of the images
  4048. } SHDRAGIMAGE, *LPSHDRAGIMAGE;
  4049. #include <poppack.h> /* Return to byte packing */
  4050. // This is sent to a window to get the rendered images to a bitmap
  4051. // Call RegisterWindowMessage to get the ID
  4052. #define DI_GETDRAGIMAGE TEXT("ShellGetDragImage")
  4053. #undef INTERFACE
  4054. #define INTERFACE IDropTargetHelper
  4055. DECLARE_INTERFACE_( IDropTargetHelper, IUnknown )
  4056. {
  4057. // IUnknown methods
  4058. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  4059. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  4060. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  4061. // IDropTargetHelper
  4062. STDMETHOD (DragEnter)(THIS_ HWND hwndTarget, IDataObject* pDataObject,
  4063. POINT* ppt, DWORD dwEffect) PURE;
  4064. STDMETHOD (DragLeave)(THIS) PURE;
  4065. STDMETHOD (DragOver)(THIS_ POINT* ppt, DWORD dwEffect) PURE;
  4066. STDMETHOD (Drop)(THIS_ IDataObject* pDataObject, POINT* ppt,
  4067. DWORD dwEffect) PURE;
  4068. STDMETHOD (Show)(THIS_ BOOL fShow) PURE;
  4069. };
  4070. #undef INTERFACE
  4071. #define INTERFACE IDragSourceHelper
  4072. DECLARE_INTERFACE_( IDragSourceHelper, IUnknown )
  4073. {
  4074. // IUnknown methods
  4075. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  4076. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  4077. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  4078. // IDragSourceHelper
  4079. STDMETHOD (InitializeFromBitmap)(THIS_ LPSHDRAGIMAGE pshdi,
  4080. IDataObject* pDataObject) PURE;
  4081. STDMETHOD (InitializeFromWindow)(THIS_ HWND hwnd, POINT* ppt,
  4082. IDataObject* pDataObject) PURE;
  4083. };
  4084. #endif // _WIN32_IE >= 0x0500
  4085. #endif // _WIN32_IE
  4086. //==========================================================================
  4087. // Clipboard format which may be supported by IDataObject from system
  4088. // defined shell folders (such as directories, network, ...).
  4089. //==========================================================================
  4090. #define CFSTR_SHELLIDLISTP TEXT("Shell IDLData Private") ;Internal
  4091. #define CFSTR_SHELLIDLIST TEXT("Shell IDList Array") // CF_IDLIST
  4092. #define CFSTR_SHELLIDLISTOFFSET TEXT("Shell Object Offsets") // CF_OBJECTPOSITIONS
  4093. #define CFSTR_NETRESOURCES TEXT("Net Resource") // CF_NETRESOURCE
  4094. #define CFSTR_FILEDESCRIPTORA TEXT("FileGroupDescriptor") // CF_FILEGROUPDESCRIPTORA
  4095. #define CFSTR_FILEDESCRIPTORW TEXT("FileGroupDescriptorW") // CF_FILEGROUPDESCRIPTORW
  4096. #define CFSTR_FILECONTENTS TEXT("FileContents") // CF_FILECONTENTS
  4097. #define CFSTR_FILENAMEA TEXT("FileName") // CF_FILENAMEA
  4098. #define CFSTR_FILENAMEW TEXT("FileNameW") // CF_FILENAMEW
  4099. #define CFSTR_PRINTERGROUP TEXT("PrinterFriendlyName") // CF_PRINTERS
  4100. #define CFSTR_FILENAMEMAPA TEXT("FileNameMap") // CF_FILENAMEMAPA
  4101. #define CFSTR_FILENAMEMAPW TEXT("FileNameMapW") // CF_FILENAMEMAPW
  4102. #define CFSTR_SHELLURL TEXT("UniformResourceLocator")
  4103. #define CFSTR_INETURLA CFSTR_SHELLURL
  4104. #define CFSTR_INETURLW TEXT("UniformResourceLocatorW")
  4105. #define CFSTR_SHELLCOPYDATA TEXT("Shell Copy Data") ;Internal
  4106. #define CFSTR_PREFERREDDROPEFFECT TEXT("Preferred DropEffect")
  4107. #define CFSTR_PERFORMEDDROPEFFECT TEXT("Performed DropEffect")
  4108. #define CFSTR_PASTESUCCEEDED TEXT("Paste Succeeded")
  4109. #define CFSTR_INDRAGLOOP TEXT("InShellDragLoop")
  4110. #define CFSTR_DRAGCONTEXT TEXT("DragContext")
  4111. #define CFSTR_MOUNTEDVOLUME TEXT("MountedVolume")
  4112. #define CFSTR_PERSISTEDDATAOBJECT TEXT("PersistedDataObject")
  4113. #define CFSTR_TARGETCLSID TEXT("TargetCLSID") // HGLOBAL with a CLSID of the drop target
  4114. #define CFSTR_LOGICALPERFORMEDDROPEFFECT TEXT("Logical Performed DropEffect")
  4115. #define CFSTR_DROPEFFECTFOLDERLIST TEXT("DropEffectFolderList") ;Internal
  4116. #define CFSTR_AUTOPLAY_SHELLIDLISTS TEXT("Autoplay Enumerated IDList Array") // (HGLOBAL with LPIDA)
  4117. #ifdef UNICODE
  4118. #define CFSTR_FILEDESCRIPTOR CFSTR_FILEDESCRIPTORW
  4119. #define CFSTR_FILENAME CFSTR_FILENAMEW
  4120. #define CFSTR_FILENAMEMAP CFSTR_FILENAMEMAPW
  4121. #define CFSTR_INETURL CFSTR_INETURLW
  4122. #else
  4123. #define CFSTR_FILEDESCRIPTOR CFSTR_FILEDESCRIPTORA
  4124. #define CFSTR_FILENAME CFSTR_FILENAMEA
  4125. #define CFSTR_FILENAMEMAP CFSTR_FILENAMEMAPA
  4126. #define CFSTR_INETURL CFSTR_INETURLA
  4127. #endif
  4128. #define DVASPECT_SHORTNAME 2 // use for CF_HDROP to get short name version of file paths
  4129. #define DVASPECT_COPY 3 // use to indicate format is a "Copy" of the data (FILECONTENTS, FILEDESCRIPTOR, etc)
  4130. #define DVASPECT_LINK 4 // use to indicate format is a "Shortcut" to the data (FILECONTENTS, FILEDESCRIPTOR, etc)
  4131. #include <pshpack8.h>
  4132. //
  4133. // format of CF_NETRESOURCE
  4134. //
  4135. typedef struct _NRESARRAY { // anr
  4136. UINT cItems;
  4137. NETRESOURCE nr[1];
  4138. } NRESARRAY, * LPNRESARRAY;
  4139. #include <poppack.h> /* Return to byte packing */
  4140. //
  4141. // format of CF_IDLIST
  4142. //
  4143. typedef struct _IDA {
  4144. UINT cidl; // number of relative IDList
  4145. UINT aoffset[1]; // [0]: folder IDList, [1]-[cidl]: item IDList
  4146. } CIDA, * LPIDA;
  4147. //
  4148. // FILEDESCRIPTOR.dwFlags field indicate which fields are to be used
  4149. //
  4150. typedef enum {
  4151. FD_CLSID = 0x0001,
  4152. FD_SIZEPOINT = 0x0002,
  4153. FD_ATTRIBUTES = 0x0004,
  4154. FD_CREATETIME = 0x0008,
  4155. FD_ACCESSTIME = 0x0010,
  4156. FD_WRITESTIME = 0x0020,
  4157. FD_FILESIZE = 0x0040,
  4158. FD_PROGRESSUI = 0x4000, // Show Progress UI w/Drag and Drop
  4159. FD_LINKUI = 0x8000, // 'link' UI is prefered
  4160. } FD_FLAGS;
  4161. typedef struct _FILEDESCRIPTORA { // fod
  4162. DWORD dwFlags;
  4163. CLSID clsid;
  4164. SIZEL sizel;
  4165. POINTL pointl;
  4166. DWORD dwFileAttributes;
  4167. FILETIME ftCreationTime;
  4168. FILETIME ftLastAccessTime;
  4169. FILETIME ftLastWriteTime;
  4170. DWORD nFileSizeHigh;
  4171. DWORD nFileSizeLow;
  4172. CHAR cFileName[ MAX_PATH ];
  4173. } FILEDESCRIPTORA, *LPFILEDESCRIPTORA;
  4174. typedef struct _FILEDESCRIPTORW { // fod
  4175. DWORD dwFlags;
  4176. CLSID clsid;
  4177. SIZEL sizel;
  4178. POINTL pointl;
  4179. DWORD dwFileAttributes;
  4180. FILETIME ftCreationTime;
  4181. FILETIME ftLastAccessTime;
  4182. FILETIME ftLastWriteTime;
  4183. DWORD nFileSizeHigh;
  4184. DWORD nFileSizeLow;
  4185. WCHAR cFileName[ MAX_PATH ];
  4186. } FILEDESCRIPTORW, *LPFILEDESCRIPTORW;
  4187. #ifdef UNICODE
  4188. #define FILEDESCRIPTOR FILEDESCRIPTORW
  4189. #define LPFILEDESCRIPTOR LPFILEDESCRIPTORW
  4190. #else
  4191. #define FILEDESCRIPTOR FILEDESCRIPTORA
  4192. #define LPFILEDESCRIPTOR LPFILEDESCRIPTORA
  4193. #endif
  4194. //
  4195. // format of CF_FILEGROUPDESCRIPTOR
  4196. //
  4197. typedef struct _FILEGROUPDESCRIPTORA { // fgd
  4198. UINT cItems;
  4199. FILEDESCRIPTORA fgd[1];
  4200. } FILEGROUPDESCRIPTORA, * LPFILEGROUPDESCRIPTORA;
  4201. typedef struct _FILEGROUPDESCRIPTORW { // fgd
  4202. UINT cItems;
  4203. FILEDESCRIPTORW fgd[1];
  4204. } FILEGROUPDESCRIPTORW, * LPFILEGROUPDESCRIPTORW;
  4205. #ifdef UNICODE
  4206. #define FILEGROUPDESCRIPTOR FILEGROUPDESCRIPTORW
  4207. #define LPFILEGROUPDESCRIPTOR LPFILEGROUPDESCRIPTORW
  4208. #else
  4209. #define FILEGROUPDESCRIPTOR FILEGROUPDESCRIPTORA
  4210. #define LPFILEGROUPDESCRIPTOR LPFILEGROUPDESCRIPTORA
  4211. #endif
  4212. //
  4213. // format of CF_HDROP and CF_PRINTERS, in the HDROP case the data that follows
  4214. // is a double null terinated list of file names, for printers they are printer
  4215. // friendly names
  4216. //
  4217. typedef struct _DROPFILES {
  4218. DWORD pFiles; // offset of file list
  4219. POINT pt; // drop point (client coords)
  4220. BOOL fNC; // is it on NonClient area
  4221. // and pt is in screen coords
  4222. BOOL fWide; // WIDE character switch
  4223. } DROPFILES, *LPDROPFILES;
  4224. // ;Internal
  4225. // Win 3.1 style HDROP ;Internal
  4226. // ;Internal
  4227. // Notes: Our API works only if pFiles == sizeof(DROPFILES16) ;Internal
  4228. // ;Internal
  4229. typedef struct _DROPFILES16 { ;Internal
  4230. WORD pFiles; // offset to double null list of files ;Internal
  4231. POINTS pt; // drop point (client coords) ;Internal
  4232. WORD fNC; // is it on non client area ;Internal
  4233. // and pt is in screen coords ;Internal
  4234. } DROPFILES16, * LPDROPFILES16; ;Internal
  4235. ;Internal
  4236. // ;Internal
  4237. // format of CF_SHELLCOPYDATA ;Internal
  4238. // ;Internal
  4239. ;Internal
  4240. typedef struct _SHELLCOPYDATA { ;Internal
  4241. DWORD dwEffect; // Intended effect ;Internal
  4242. } SHELLCOPYDATA; ;Internal
  4243. ;begin_internal
  4244. //
  4245. // CFSTR_DROPEFFECTFOLDERLIST defines the drop effects to certain folders
  4246. // this is applied when dropping to a file system folder.
  4247. //
  4248. typedef struct {
  4249. DWORD dwDropEffect;
  4250. WCHAR wszPath[MAX_PATH];
  4251. } DROPEFFECTFOLDER;
  4252. typedef struct {
  4253. DWORD dwDefaultDropEffect; // default drop effect (==0 for current behaviour)
  4254. INT cFolders; // number of folders in the list
  4255. DROPEFFECTFOLDER aFolders[1];
  4256. } DROPEFFECTFOLDERLIST;
  4257. ;end_internal
  4258. //====== File System Notification APIs ===============================
  4259. //
  4260. //------ See shelldll\fsnotify.c for function descriptions. ---------- ;Internal
  4261. ;Internal
  4262. // ;Internal
  4263. // Definition of the function type to be called by the notification ;Internal
  4264. // service when a file the client has registered to monitor changes. ;Internal
  4265. // ;Internal
  4266. // DOC'ed for DOJ compliance: ;Internal
  4267. typedef struct _SHChangeNotifyEntry
  4268. {
  4269. LPCITEMIDLIST pidl;
  4270. BOOL fRecursive;
  4271. } SHChangeNotifyEntry;
  4272. //
  4273. // File System Notification flags
  4274. //
  4275. #define SHCNRF_InterruptLevel 0x0001 ;Internal
  4276. #define SHCNRF_ShellLevel 0x0002 ;Internal
  4277. // If the caller passes SHCNRF_RecursiveInterrupt (meaning that they want interrupt events on the whole ;Internal
  4278. // subtree), then they must also pass SHCNRF_InterruptLevel flag (duh), and they must be a recursive (eg ;Internal
  4279. // fRecursive == TRUE) type notification. ;Internal
  4280. #define SHCNRF_RecursiveInterrupt 0x1000 ;Internal
  4281. #define SHCNRF_ResumeThread 0x2000 ;Internal
  4282. #define SHCNRF_CreateSuspended 0x4000 ;Internal
  4283. #define SHCNRF_NewDelivery 0x8000 ;Internal
  4284. ;begin_internal
  4285. // !! WARNING !!
  4286. // If you change/add any new SHCNE_ events, you will need
  4287. // to possibly modify the SHCNE_XXXXEVENTS masks that are
  4288. // defined below as well.
  4289. ;end_internal
  4290. #define SHCNE_RENAMEITEM 0x00000001L
  4291. #define SHCNE_CREATE 0x00000002L
  4292. #define SHCNE_DELETE 0x00000004L
  4293. #define SHCNE_MKDIR 0x00000008L
  4294. #define SHCNE_RMDIR 0x00000010L
  4295. #define SHCNE_MEDIAINSERTED 0x00000020L
  4296. #define SHCNE_MEDIAREMOVED 0x00000040L
  4297. #define SHCNE_DRIVEREMOVED 0x00000080L
  4298. #define SHCNE_DRIVEADD 0x00000100L
  4299. #define SHCNE_NETSHARE 0x00000200L
  4300. #define SHCNE_NETUNSHARE 0x00000400L
  4301. #define SHCNE_ATTRIBUTES 0x00000800L
  4302. #define SHCNE_UPDATEDIR 0x00001000L
  4303. #define SHCNE_UPDATEITEM 0x00002000L
  4304. #define SHCNE_SERVERDISCONNECT 0x00004000L
  4305. #define SHCNE_UPDATEIMAGE 0x00008000L
  4306. #define SHCNE_DRIVEADDGUI 0x00010000L
  4307. #define SHCNE_RENAMEFOLDER 0x00020000L
  4308. #define SHCNE_FREESPACE 0x00040000L
  4309. #if (_WIN32_IE >= 0x0400)
  4310. // SHCNE_EXTENDED_EVENT: the extended event is identified in dwItem1,
  4311. // packed in LPITEMIDLIST format (same as SHCNF_DWORD packing).
  4312. // Additional information can be passed in the dwItem2 parameter
  4313. // of SHChangeNotify (called "pidl2" below), which if present, must also
  4314. // be in LPITEMIDLIST format.
  4315. //
  4316. // Unlike the standard events, the extended events are ORDINALs, so we
  4317. // don't run out of bits. Extended events follow the SHCNEE_* naming
  4318. // convention.
  4319. //
  4320. // The dwItem2 parameter varies according to the extended event.
  4321. #define SHCNE_EXTENDED_EVENT 0x04000000L
  4322. #endif // _WIN32_IE >= 0x0400
  4323. #define SHCNE_ASSOCCHANGED 0x08000000L
  4324. #define SHCNE_DISKEVENTS 0x0002381FL
  4325. ;begin_internal
  4326. // NOTE: SHCNE_GLOBALEVENTS are typically used to pass
  4327. // non-pidl information (packed into pidl format). We cannot
  4328. // extend SHCNE_GLOBALEVENTS and expect clients of the new
  4329. // events to work on a down-level shell32. In fact, they
  4330. // may very well fault during psfDesktop->CompareIDs.
  4331. // So be careful when adding to this bitfield!
  4332. //
  4333. // Win95 and NT4 and IE4 shipped with 0x0C0581E0L.
  4334. ;end_internal
  4335. #define SHCNE_GLOBALEVENTS 0x0C0581E0L // Events that dont match pidls first
  4336. #define SHCNE_ALLEVENTS 0x7FFFFFFFL
  4337. #define SHCNE_INTERRUPT 0x80000000L // The presence of this flag indicates
  4338. // that the event was generated by an
  4339. // interrupt. It is stripped out before
  4340. // the clients of SHCNNotify_ see it.
  4341. ;begin_internal
  4342. // We use this event mask to tell if we need to possibly throw out a SHCNE_UPDATEDIR that was
  4343. // generated by the filesystem because we have a more specific event already in our queue.
  4344. // NOTE: only non-interrupt events could cause us to throw out a interrupt generated UPDATEDIR event.
  4345. #define SHCNE_UPDATEDIR_OVERRIDE_EVENTS 0x00023818L
  4346. ;end_internal
  4347. #if (_WIN32_IE >= 0x0400)
  4348. // SHCNE_EXTENDED_EVENT extended events. These events are ordinals.
  4349. // This is not a bitfield.
  4350. ;begin_internal
  4351. // This event was defined early on in IE4 for the Theme Switcher to
  4352. // notify the shell that a system-wide update needed to happen.
  4353. // This has been removed but I don't want to re-use the id just yet...
  4354. //#define SHCNEE_THEMECHANGED 1L // The theme changed
  4355. ;end_internal
  4356. #define SHCNEE_ORDERCHANGED 2L // pidl2 is the changed folder
  4357. ;begin_internal
  4358. #define SHCNEE_WININETCHANGED 3L // dwItem2 contains CACHE_NOTIFY_* bits
  4359. ;end_internal
  4360. #define SHCNEE_MSI_CHANGE 4L // pidl2 is a SHChangeProductKeyAsIDList
  4361. #define SHCNEE_MSI_UNINSTALL 5L // pidl2 is a SHChangeProductKeyAsIDList
  4362. ;begin_internal
  4363. #if (_WIN32_IE >= 0x0500)
  4364. #define SHCNEE_PROMOTEDITEM 6L // pidl2 is the pidl of the Promoted item
  4365. #define SHCNEE_DEMOTEDITEM 7L // pidl2 is the pidl of the demoted item
  4366. #define SHCNEE_ALIASINUSE 8L // some alias style folder is now being used
  4367. #endif
  4368. #if (_WIN32_IE >= 0x0600)
  4369. #define SHCNEE_SHORTCUTINVOKE 9L // an app has been launched via a shortcut
  4370. // pidl1 = SHShortcutInvokeAsIDList, pidl2=unused
  4371. #define SHCNEE_PINLISTCHANGED 10L // a change was made to the pin list
  4372. // pidl1 = SHChangeDWORDAsIDList, pidl2=unused
  4373. #define SHCNEE_USERINFOCHANGED 11L // A user picture was updated. pidl1 = SHChangeDWORDAsIDList, pidl2=unused
  4374. #define SHCNEE_UPDATEFOLDERLOCATION 12L // a special folder changed pidl1 = {SHChangeDWORDAsIDList, csidlFolder}, pidl2=unused
  4375. #endif
  4376. ;end_internal
  4377. #endif
  4378. // Update types for the UpdateEntryList api ;Internal
  4379. #define SHCNNU_SET 1 // Set the notify list to passed in list ;Internal
  4380. #define SHCNNU_ADD 2 // Add the items to the current list ;Internal
  4381. #define SHCNNU_REMOVE 3 // Remove the items from the current list ;Internal
  4382. // Flags
  4383. // uFlags & SHCNF_TYPE is an ID which indicates what dwItem1 and dwItem2 mean
  4384. #define SHCNF_IDLIST 0x0000 // LPITEMIDLIST
  4385. #define SHCNF_PATHA 0x0001 // path name
  4386. #define SHCNF_PRINTERA 0x0002 // printer friendly name
  4387. #define SHCNF_DWORD 0x0003 // DWORD
  4388. #define SHCNF_PRINTJOBA 0x0004 // dwItem1: printer name ;Internal
  4389. // dwItem2: SHCNF_PRINTJOB_DATA ;Internal
  4390. #define SHCNF_PATHW 0x0005 // path name
  4391. #define SHCNF_PRINTERW 0x0006 // printer friendly name
  4392. #define SHCNF_PRINTJOBW 0x0007 // dwItem1: printer name ;Internal
  4393. // dwItem2: SHCNF_PRINTJOB_DATA ;Internal
  4394. #define SHCNF_INSTRUMENT 0x0080 // dwItem1: LPSHCNF_INSTRUMENT ;Internal
  4395. #define SHCNF_TYPE 0x00FF
  4396. #define SHCNF_FLUSH 0x1000
  4397. #define SHCNF_FLUSHNOWAIT 0x2000
  4398. #define SHCNF_TRANSLATEDALIAS 0x4000 // for internals to filter on ;Internal
  4399. #define SHCNF_ONLYNOTIFYINTERNALS 0x8000 // only notify internal clients ;Internal
  4400. #ifdef UNICODE
  4401. #define SHCNF_PATH SHCNF_PATHW
  4402. #define SHCNF_PRINTER SHCNF_PRINTERW
  4403. #else
  4404. #define SHCNF_PATH SHCNF_PATHA
  4405. #define SHCNF_PRINTER SHCNF_PRINTERA
  4406. #endif
  4407. #ifdef UNICODE ;Internal
  4408. #define SHCNF_PRINTJOB SHCNF_PRINTJOBW ;Internal
  4409. #else ;Internal
  4410. #define SHCNF_PRINTJOB SHCNF_PRINTJOBA ;Internal
  4411. #endif ;Internal
  4412. ;Internal
  4413. typedef struct tagSHCNF_PRINTJOB_DATA { ;Internal
  4414. DWORD JobId; ;Internal
  4415. DWORD Status; ;Internal
  4416. DWORD TotalPages; ;Internal
  4417. DWORD Size; ;Internal
  4418. DWORD PagesPrinted; ;Internal
  4419. } SHCNF_PRINTJOB_DATA, *LPSHCNF_PRINTJOB_DATA; ;Internal
  4420. // ;Internal
  4421. // This is all the INSTRUMENTation stuff... ;Internal
  4422. // make this look like an ITEMIDLIST (uOffset points to 0 uTerm) ;Internal
  4423. #include <pshpack1.h> ;Internal
  4424. typedef struct tagSHCNF_INSTRUMENT { ;Internal
  4425. USHORT uOffset; ;Internal
  4426. USHORT uAlign; ;Internal
  4427. DWORD dwEventType; ;Internal
  4428. DWORD dwEventStructure; ;Internal
  4429. SYSTEMTIME st; ;Internal
  4430. union tagEvents { ;Internal
  4431. struct tagSTRING { ;Internal
  4432. TCHAR sz[32]; ;Internal
  4433. } string; ;Internal
  4434. struct tagHOTKEY { ;Internal
  4435. WPARAM wParam; ;Internal
  4436. } hotkey; ;Internal
  4437. struct tagWNDPROC { ;Internal
  4438. HWND hwnd; ;Internal
  4439. UINT uMsg; ;Internal
  4440. WPARAM wParam; ;Internal
  4441. LPARAM lParam; ;Internal
  4442. } wndproc; ;Internal
  4443. struct tagCOMMAND { ;Internal
  4444. HWND hwnd; ;Internal
  4445. UINT idCmd; ;Internal
  4446. } command; ;Internal
  4447. struct tagDROP { ;Internal
  4448. HWND hwnd; ;Internal
  4449. UINT idCmd; ;Internal
  4450. // TCHAR sz[32]; // convert pDataObject into something we can log ;Internal
  4451. } drop; ;Internal
  4452. } e; ;Internal
  4453. USHORT uTerm; ;Internal
  4454. } SHCNF_INSTRUMENT_INFO, * LPSHCNF_INSTRUMENT_INFO; ;Internal
  4455. #include <poppack.h> ;Internal
  4456. ;Internal
  4457. #define SHCNFI_EVENT_STATECHANGE 0 // dwEventType ;Internal
  4458. #define SHCNFI_EVENT_STRING 1 // e.string ;Internal
  4459. #define SHCNFI_EVENT_HOTKEY 2 // e.hotkey ;Internal
  4460. #define SHCNFI_EVENT_WNDPROC 3 // e.wndproc ;Internal
  4461. #define SHCNFI_EVENT_WNDPROC_HOOK 4 // e.wndproc ;Internal
  4462. #define SHCNFI_EVENT_ONCOMMAND 5 // e.command ;Internal
  4463. #define SHCNFI_EVENT_INVOKECOMMAND 6 // e.command ;Internal
  4464. #define SHCNFI_EVENT_TRACKPOPUPMENU 7 // e.command ;Internal
  4465. #define SHCNFI_EVENT_DROP 8 // e.drop ;Internal
  4466. #define SHCNFI_EVENT_MAX 9 ;Internal
  4467. ;Internal
  4468. #define SHCNFI_STRING_SHOWEXTVIEW 0 ;Internal
  4469. ;Internal
  4470. #define SHCNFI_STATE_KEYBOARDACTIVE 0 // _KEYBOARDACTIVE or _MOUSEACTIVE ;Internal
  4471. #define SHCNFI_STATE_MOUSEACTIVE 1 // _KEYBOARDACTIVE or _MOUSEACTIVE ;Internal
  4472. #define SHCNFI_STATE_ACCEL_TRAY 2 // _ACCEL_TRAY or _ACCEL_DESKTOP ;Internal
  4473. #define SHCNFI_STATE_ACCEL_DESKTOP 3 // _ACCEL_TRAY or _ACCEL_DESKTOP ;Internal
  4474. #define SHCNFI_STATE_START_DOWN 4 // _START_DOWN or _START_UP ;Internal
  4475. #define SHCNFI_STATE_START_UP 5 // _START_DOWN or _START_UP ;Internal
  4476. #define SHCNFI_STATE_TRAY_CONTEXT 6 ;Internal
  4477. #define SHCNFI_STATE_TRAY_CONTEXT_CLOCK 7 ;Internal
  4478. #define SHCNFI_STATE_TRAY_CONTEXT_START 8 ;Internal
  4479. #define SHCNFI_STATE_DEFVIEWX_ALT_DBLCLK 9 ;Internal
  4480. #define SHCNFI_STATE_DEFVIEWX_SHIFT_DBLCLK 10 ;Internal
  4481. #define SHCNFI_STATE_DEFVIEWX_DBLCLK 11 ;Internal
  4482. ;Internal
  4483. #define SHCNFI_GLOBALHOTKEY 0 ;Internal
  4484. ;Internal
  4485. #define SHCNFI_CABINET_WNDPROC 0 ;Internal
  4486. #define SHCNFI_DESKTOP_WNDPROC 1 ;Internal
  4487. #define SHCNFI_PROXYDESKTOP_WNDPROC 2 ;Internal
  4488. #define SHCNFI_TRAY_WNDPROC 3 ;Internal
  4489. #define SHCNFI_DRIVES_WNDPROC 4 ;Internal
  4490. #define SHCNFI_ONETREE_WNDPROC 5 ;Internal
  4491. #define SHCNFI_MAIN_WNDPROC 6 ;Internal
  4492. #define SHCNFI_FOLDEROPTIONS_DLGPROC 7 ;Internal
  4493. #define SHCNFI_VIEWOPTIONS_DLGPROC 8 ;Internal
  4494. #define SHCNFI_FT_DLGPROC 9 ;Internal
  4495. #define SHCNFI_FTEdit_DLGPROC 10 ;Internal
  4496. #define SHCNFI_FTCmd_DLGPROC 11 ;Internal
  4497. #define SHCNFI_TASKMAN_DLGPROC 12 ;Internal
  4498. #define SHCNFI_TRAYVIEWOPTIONS_DLGPROC 13 ;Internal
  4499. #define SHCNFI_INITSTARTMENU_DLGPROC 14 ;Internal
  4500. #define SHCNFI_PRINTERQUEUE_DLGPROC 15 ;Internal
  4501. ;Internal
  4502. #define SHCNFI_CABINET_ONCOMMAND 0 ;Internal
  4503. #define SHCNFI_TRAYCOMMAND 1 ;Internal
  4504. ;Internal
  4505. #define SHCNFI_BITBUCKET_DFM_INVOKE 0 ;Internal
  4506. #define SHCNFI_BITBUCKET_FNV_INVOKE 1 ;Internal
  4507. #define SHCNFI_BITBUCKET_INVOKE 2 ;Internal
  4508. #define SHCNFI_BITBUCKETBG_DFM_INVOKE 3 ;Internal
  4509. #define SHCNFI_CONTROLS_DFM_INVOKE 4 ;Internal
  4510. #define SHCNFI_CONTROLS_FNV_INVOKE 5 ;Internal
  4511. #define SHCNFI_CONTROLSBG_DFM_INVOKE 6 ;Internal
  4512. #define SHCNFI_DEFFOLDER_DFM_INVOKE 7 ;Internal
  4513. #define SHCNFI_DEFFOLDER_INVOKE 8 ;Internal
  4514. #define SHCNFI_FINDEXT_INVOKE 9 ;Internal
  4515. #define SHCNFI_DEFFOLDER_FNV_INVOKE 10 ;Internal
  4516. #define SHCNFI_DRIVESBG_DFM_INVOKE 11 ;Internal
  4517. #define SHCNFI_DRIVES_FNV_INVOKE 12 ;Internal
  4518. #define SHCNFI_DRIVES_DFM_INVOKE 13 ;Internal
  4519. #define SHCNFI_FOLDERBG_DFM_INVOKE 14 ;Internal
  4520. #define SHCNFI_FOLDER_FNV_INVOKE 15 ;Internal
  4521. #define SHCNFI_FOLDER_DFM_INVOKE 16 ;Internal
  4522. #define SHCNFI_NETWORKBG_DFM_INVOKE 17 ;Internal
  4523. #define SHCNFI_NETWORK_FNV_INVOKE 18 ;Internal
  4524. #define SHCNFI_NETWORK_DFM_INVOKE 19 ;Internal
  4525. #define SHCNFI_NETWORKPRINTER_DFM_INVOKE 20 ;Internal
  4526. #define SHCNFI_DESKTOPBG_DFM_INVOKE 21 ;Internal
  4527. #define SHCNFI_DESKTOP_DFM_INVOKE 22 ;Internal
  4528. #define SHCNFI_DESKTOP_FNV_INVOKE 23 ;Internal
  4529. #define SHCNFI_PRINTERS_DFM_INVOKE 24 ;Internal
  4530. #define SHCNFI_PRINTERSBG_DFM_INVOKE 25 ;Internal
  4531. #define SHCNFI_PRINTERS_FNV_INVOKE 26 ;Internal
  4532. #define SHCNFI_DEFVIEWX_INVOKE 27 ;Internal
  4533. ;Internal
  4534. #define SHCNFI_FOLDER_DROP 0 ;Internal
  4535. #define SHCNFI_PRINTQUEUE_DROP 1 ;Internal
  4536. #define SHCNFI_DEFVIEWX_TPM 2 ;Internal
  4537. #define SHCNFI_DROP_EXE_TPM 3 ;Internal
  4538. #define SHCNFI_IDLDT_TPM 4 ;Internal
  4539. ;Internal
  4540. #define SHCNFI_DROP_BITBUCKET 0 ;Internal
  4541. #define SHCNFI_DROP_PRINTFOLDER 1 ;Internal
  4542. #define SHCNFI_DROP_PRINTER 2 ;Internal
  4543. #define SHCNFI_DROP_RUN 3 ;Internal
  4544. #define SHCNFI_DROP_SHELLLINK 4 ;Internal
  4545. #define SHCNFI_DROP_DRIVES 5 ;Internal
  4546. #define SHCNFI_DROP_FS 6 ;Internal
  4547. #define SHCNFI_DROP_EXE 7 ;Internal
  4548. #define SHCNFI_DROP_NETROOT 8 ;Internal
  4549. #define SHCNFI_DROP_PRINTQUEUE 9 ;Internal
  4550. #define SHCNFI_DROP_BRIEFCASE 10 ;Internal
  4551. ;Internal
  4552. #ifdef WANT_SHELL_INSTRUMENTATION ;Internal
  4553. #define INSTRUMENT_STATECHANGE(t) \ ;Internal
  4554. { \ ;Internal
  4555. SHCNF_INSTRUMENT_INFO s; \ ;Internal
  4556. s.dwEventType=(t); \ ;Internal
  4557. s.dwEventStructure=SHCNFI_EVENT_STATECHANGE; \ ;Internal
  4558. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \ ;Internal
  4559. } ;Internal
  4560. #define INSTRUMENT_STRING(t,p) \ ;Internal
  4561. { \ ;Internal
  4562. SHCNF_INSTRUMENT_INFO s; \ ;Internal
  4563. s.dwEventType=(t); \ ;Internal
  4564. s.dwEventStructure=SHCNFI_EVENT_STRING; \ ;Internal
  4565. lstrcpyn(s.e.string.sz,(p),ARRAYSIZE(s.e.string.sz)); \ ;Internal
  4566. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \ ;Internal
  4567. } ;Internal
  4568. #define INSTRUMENT_HOTKEY(t,w) \ ;Internal
  4569. { \ ;Internal
  4570. SHCNF_INSTRUMENT_INFO s; \ ;Internal
  4571. s.dwEventType=(t); \ ;Internal
  4572. s.dwEventStructure=SHCNFI_EVENT_HOTKEY; \ ;Internal
  4573. s.e.hotkey.wParam=(w); \ ;Internal
  4574. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \ ;Internal
  4575. } ;Internal
  4576. #define INSTRUMENT_WNDPROC(t,h,u,w,l) \ ;Internal
  4577. { \ ;Internal
  4578. SHCNF_INSTRUMENT_INFO s; \ ;Internal
  4579. s.dwEventType=(t); \ ;Internal
  4580. s.dwEventStructure=SHCNFI_EVENT_WNDPROC; \ ;Internal
  4581. s.e.wndproc.hwnd=(h); \ ;Internal
  4582. s.e.wndproc.uMsg=(u); \ ;Internal
  4583. s.e.wndproc.wParam=(w); \ ;Internal
  4584. s.e.wndproc.lParam=(l); \ ;Internal
  4585. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \ ;Internal
  4586. } ;Internal
  4587. #define INSTRUMENT_WNDPROC_HOOK(h,u,w,l) \ ;Internal
  4588. { \ ;Internal
  4589. SHCNF_INSTRUMENT_INFO s; \ ;Internal
  4590. s.dwEventType=0; \ ;Internal
  4591. s.dwEventStructure=SHCNFI_EVENT_WNDPROC_HOOK; \ ;Internal
  4592. s.e.wndproc.hwnd=(h); \ ;Internal
  4593. s.e.wndproc.uMsg=(u); \ ;Internal
  4594. s.e.wndproc.wParam=(w); \ ;Internal
  4595. s.e.wndproc.lParam=(l); \ ;Internal
  4596. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \ ;Internal
  4597. } ;Internal
  4598. #define INSTRUMENT_ONCOMMAND(t,h,u) \ ;Internal
  4599. { \ ;Internal
  4600. SHCNF_INSTRUMENT_INFO s; \ ;Internal
  4601. s.dwEventType=(t); \ ;Internal
  4602. s.dwEventStructure=SHCNFI_EVENT_ONCOMMAND; \ ;Internal
  4603. s.e.command.hwnd=(h); \ ;Internal
  4604. s.e.command.idCmd=(u); \ ;Internal
  4605. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \ ;Internal
  4606. } ;Internal
  4607. #define INSTRUMENT_INVOKECOMMAND(t,h,u) \ ;Internal
  4608. { \ ;Internal
  4609. SHCNF_INSTRUMENT_INFO s; \ ;Internal
  4610. s.dwEventType=(t); \ ;Internal
  4611. s.dwEventStructure=SHCNFI_EVENT_INVOKECOMMAND; \ ;Internal
  4612. s.e.command.hwnd=(h); \ ;Internal
  4613. s.e.command.idCmd=(u); \ ;Internal
  4614. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \ ;Internal
  4615. } ;Internal
  4616. #define INSTRUMENT_TRACKPOPUPMENU(t,h,u) \ ;Internal
  4617. { \ ;Internal
  4618. SHCNF_INSTRUMENT_INFO s; \ ;Internal
  4619. s.dwEventType=(t); \ ;Internal
  4620. s.dwEventStructure=SHCNFI_EVENT_TRACKPOPUPMENU; \ ;Internal
  4621. s.e.command.hwnd=(h); \ ;Internal
  4622. s.e.command.idCmd=(u); \ ;Internal
  4623. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \ ;Internal
  4624. } ;Internal
  4625. #define INSTRUMENT_DROP(t,h,u,p) \ ;Internal
  4626. { \ ;Internal
  4627. SHCNF_INSTRUMENT_INFO s; \ ;Internal
  4628. s.dwEventType=(t); \ ;Internal
  4629. s.dwEventStructure=SHCNFI_EVENT_DROP; \ ;Internal
  4630. s.e.drop.hwnd=(h); \ ;Internal
  4631. s.e.drop.idCmd=(u); \ ;Internal
  4632. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \ ;Internal
  4633. } ;Internal
  4634. #else ;Internal
  4635. #define INSTRUMENT_STATECHANGE(t) ;Internal
  4636. #define INSTRUMENT_STRING(t,p) ;Internal
  4637. #define INSTRUMENT_HOTKEY(t,w) ;Internal
  4638. #define INSTRUMENT_WNDPROC(t,h,u,w,l) ;Internal
  4639. #define INSTRUMENT_WNDPROC_HOOK(h,u,w,l) ;Internal
  4640. #define INSTRUMENT_ONCOMMAND(t,h,u) ;Internal
  4641. #define INSTRUMENT_INVOKECOMMAND(t,h,u) ;Internal
  4642. #define INSTRUMENT_TRACKPOPUPMENU(t,h,u) ;Internal
  4643. #define INSTRUMENT_DROP(t,h,u,p) ;Internal
  4644. #endif //WANT_SHELL_INSTRUMENTATION ;Internal
  4645. // ;Internal
  4646. //
  4647. // APIs
  4648. //
  4649. SHSTDAPI_(void) SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2);
  4650. //
  4651. // IShellChangeNotify
  4652. //
  4653. #undef INTERFACE
  4654. #define INTERFACE IShellChangeNotify
  4655. DECLARE_INTERFACE_(IShellChangeNotify, IUnknown)
  4656. {
  4657. // *** IUnknown methods ***
  4658. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  4659. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  4660. STDMETHOD_(ULONG,Release) (THIS) PURE;
  4661. // *** IShellChangeNotify methods ***
  4662. STDMETHOD(OnChange) (THIS_ LONG lEvent, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  4663. } ;
  4664. //
  4665. // IQueryInfo
  4666. //
  4667. //-------------------------------------------------------------------------
  4668. //
  4669. // IQueryInfo interface
  4670. //
  4671. // [Methods]
  4672. // ::GetInfoTip()
  4673. //-------------------------------------------------------------------------
  4674. #undef INTERFACE
  4675. #define INTERFACE IQueryInfo
  4676. DECLARE_INTERFACE_(IQueryInfo, IUnknown)
  4677. {
  4678. // *** IUnknown methods ***
  4679. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  4680. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  4681. STDMETHOD_(ULONG,Release) (THIS) PURE;
  4682. // *** IQueryInfo methods ***
  4683. STDMETHOD(GetInfoTip)(THIS_ DWORD dwFlags, WCHAR **ppwszTip) PURE;
  4684. STDMETHOD(GetInfoFlags)(THIS_ DWORD *pdwFlags) PURE;
  4685. } ;
  4686. #define QITIPF_DEFAULT 0x00000000
  4687. #define QITIPF_USENAME 0x00000001
  4688. #define QITIPF_LINKNOTARGET 0x00000002
  4689. #define QITIPF_LINKUSETARGET 0x00000004
  4690. #define QITIPF_USESLOWTIP 0x00000008 // Flag says it's OK to take a long time generating tip
  4691. #define QIF_CACHED 0x00000001
  4692. #define QIF_DONTEXPANDFOLDER 0x00000002
  4693. ;begin_internal
  4694. //
  4695. // IQueryCodePage
  4696. //
  4697. #undef INTERFACE
  4698. #define INTERFACE IQueryCodePage
  4699. DECLARE_INTERFACE_(IQueryCodePage, IUnknown)
  4700. {
  4701. // *** IUnknown methods ***
  4702. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  4703. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  4704. STDMETHOD_(ULONG,Release) (THIS) PURE;
  4705. // *** IQueryCodePage methods ***
  4706. STDMETHOD(GetCodePage)(THIS_ UINT * puiCodePage) PURE;
  4707. STDMETHOD(SetCodePage)(THIS_ UINT uiCodePage) PURE;
  4708. } ;
  4709. ;end_internal
  4710. //
  4711. // SHAddToRecentDocs
  4712. //
  4713. #define SHARD_PIDL 0x00000001L
  4714. #define SHARD_PATHA 0x00000002L
  4715. #define SHARD_PATHW 0x00000003L
  4716. #ifdef UNICODE
  4717. #define SHARD_PATH SHARD_PATHW
  4718. #else
  4719. #define SHARD_PATH SHARD_PATHA
  4720. #endif
  4721. SHSTDAPI_(void) SHAddToRecentDocs(UINT uFlags, LPCVOID pv);
  4722. ;begin_internal
  4723. SHSTDAPI_(void) SHWaitOp_Operate(HANDLE hWaitOp, DWORD dwProcId);
  4724. // DOC'ed for DOJ compliance:
  4725. ;end_internal
  4726. typedef struct _SHChangeDWORDAsIDList {
  4727. USHORT cb;
  4728. DWORD dwItem1;
  4729. DWORD dwItem2;
  4730. USHORT cbZero;
  4731. } SHChangeDWORDAsIDList, *LPSHChangeDWORDAsIDList;
  4732. #if (_WIN32_IE >= 0x0400) ;both
  4733. ;begin_internal
  4734. // Use this instead of SHChangeDWORDAsIDList for SHCNEE_ORDERCHANGED
  4735. // SHCNEE_PROMOTEDITEM and SHCNEE_DEMOTEDITEM
  4736. //
  4737. // When filling in the pSender, cast LPVOID directly to INT64.
  4738. // Do not cast through DWORD_PTR because that will not sign extend
  4739. // properly on Win32.
  4740. typedef struct _SHChangeMenuAsIDList {
  4741. USHORT cb;
  4742. DWORD dwItem1; // SHCNEE_EXTENDED_EVENT requires this
  4743. // pSender must appear immediately after dwItem1 for IE5.0 compat
  4744. INT64 pSender; // address of sender (64-bit for Win64)
  4745. DWORD dwProcessID; // pid of sender
  4746. USHORT cbZero;
  4747. } SHChangeMenuAsIDList, * LPSHChangeMenuAsIDList;
  4748. //DOC'ed for DOJ compliance:
  4749. ;end_internal
  4750. typedef struct _SHChangeUpdateImageIDList {
  4751. USHORT cb;
  4752. int iIconIndex;
  4753. int iCurIndex;
  4754. UINT uFlags;
  4755. DWORD dwProcessID;
  4756. WCHAR szName[MAX_PATH];
  4757. USHORT cbZero;
  4758. } SHChangeUpdateImageIDList, * LPSHChangeUpdateImageIDList;
  4759. SHSTDAPI_(int) SHHandleUpdateImage( LPCITEMIDLIST pidlExtra );
  4760. typedef struct _SHChangeProductKeyAsIDList {
  4761. USHORT cb;
  4762. WCHAR wszProductKey[39];
  4763. USHORT cbZero;
  4764. } SHChangeProductKeyAsIDList, *LPSHChangeProductKeyAsIDList;
  4765. ;begin_internal
  4766. typedef struct _SHShortcutInvokeAsIDList {
  4767. USHORT cb;
  4768. DWORD dwItem1; // SHCNEE_EXTENDED_EVENT requires this
  4769. DWORD dwPid; // PID of target application
  4770. WCHAR szShortcutName[MAX_PATH]; // Path to shortcut
  4771. WCHAR szTargetName[MAX_PATH]; // Path to target application
  4772. USHORT cbZero;
  4773. } SHShortcutInvokeAsIDList, *LPSHShortcutInvokeAsIDList;
  4774. ;end_internal
  4775. SHSTDAPI_(void) SHUpdateImage%(LPCTSTR% pszHashItem, int iIndex, UINT uFlags, int iImageIndex);
  4776. #endif /* _WIN32_IE */ ;both
  4777. ;begin_internal
  4778. #define SHChangeNotifyHandleEvents() SHChangeNotify(0, SHCNF_FLUSH, NULL, NULL)
  4779. // DOC'ed for DOJ compliance
  4780. ;end_internal
  4781. SHSTDAPI_(ULONG) SHChangeNotifyRegister(HWND hwnd, int fSources, LONG fEvents, UINT wMsg, int cEntries, SHChangeNotifyEntry *pshcne);
  4782. ;begin_internal
  4783. #define SHChangeNotifyRegisterORD 2
  4784. // DOC'ed for DOJ compliance
  4785. ;end_internal
  4786. SHSTDAPI_(BOOL) SHChangeNotifyDeregister(unsigned long ulID);
  4787. ;begin_internal
  4788. #define SHChangeNotifyDeregisterORD 4
  4789. SHSTDAPI_(BOOL) SHChangeNotifyUpdateEntryList(unsigned long ulID, int iUpdateType, int cEntries, SHChangeNotifyEntry *pshcne);
  4790. SHSTDAPI_(void) SHChangeNotifyReceive(LONG lEvent, UINT uFlags, LPCITEMIDLIST pidl, LPCITEMIDLIST pidlExtra);
  4791. SHSTDAPI_(BOOL) SHChangeRegistrationReceive(HANDLE hChangeNotification, DWORD dwProcId);
  4792. SHSTDAPI_(void) SHChangeNotifyDeregisterWindow(HWND hwnd);
  4793. SHSTDAPI_(LRESULT) SHChangeNotifySuspendResumeReceive(WPARAM wParam, LPARAM lParam);
  4794. SHSTDAPI_(BOOL) SHChangeNotifySuspendResume(BOOL bSuspend, LPITEMIDLIST pidlSuspend, BOOL bRescursive, DWORD dwReserved);
  4795. typedef HANDLE LPSHChangeNotificationLock;
  4796. // DOC'ed for DOJ compliance
  4797. ;end_internal
  4798. SHSTDAPI_(HANDLE) SHChangeNotification_Lock(HANDLE hChangeNotification, DWORD dwProcessId, LPITEMIDLIST **pppidl, LONG *plEvent);
  4799. SHSTDAPI_(BOOL) SHChangeNotification_Unlock(HANDLE hLock);
  4800. ;begin_internal
  4801. // END Internal SHChangeNotify HELPERS
  4802. // DOC'ed for DOJ compliance
  4803. ;end_internal
  4804. #if (_WIN32_IE >= 0x0400)
  4805. // The pidls that are given to the view via the ChangeNotifyEvents are simple Pidls,
  4806. // SHGetRealIDL() will convert them to true PIDLs.
  4807. SHSTDAPI SHGetRealIDL(IShellFolder *psf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST * ppidlReal);
  4808. #endif // _WIN32_IE >= 0x0400
  4809. SHSTDAPI SHGetInstanceExplorer(IUnknown **ppunk);
  4810. //
  4811. // SHGetDataFromIDListA/W
  4812. //
  4813. // SHGetDataFromIDList nFormat values TCHAR
  4814. #define SHGDFIL_FINDDATA 1
  4815. #define SHGDFIL_NETRESOURCE 2
  4816. #define SHGDFIL_DESCRIPTIONID 3
  4817. #define SHDID_ROOT_REGITEM 1
  4818. #define SHDID_FS_FILE 2
  4819. #define SHDID_FS_DIRECTORY 3
  4820. #define SHDID_FS_OTHER 4
  4821. #define SHDID_COMPUTER_DRIVE35 5
  4822. #define SHDID_COMPUTER_DRIVE525 6
  4823. #define SHDID_COMPUTER_REMOVABLE 7
  4824. #define SHDID_COMPUTER_FIXED 8
  4825. #define SHDID_COMPUTER_NETDRIVE 9
  4826. #define SHDID_COMPUTER_CDROM 10
  4827. #define SHDID_COMPUTER_RAMDISK 11
  4828. #define SHDID_COMPUTER_OTHER 12
  4829. #define SHDID_NET_DOMAIN 13
  4830. #define SHDID_NET_SERVER 14
  4831. #define SHDID_NET_SHARE 15
  4832. #define SHDID_NET_RESTOFNET 16
  4833. #define SHDID_NET_OTHER 17
  4834. #define SHDID_COMPUTER_IMAGING 18
  4835. #define SHDID_COMPUTER_AUDIO 19
  4836. #define SHDID_COMPUTER_SHAREDDOCS 20
  4837. #include <pshpack8.h>
  4838. typedef struct _SHDESCRIPTIONID {
  4839. DWORD dwDescriptionId;
  4840. CLSID clsid;
  4841. } SHDESCRIPTIONID, *LPSHDESCRIPTIONID;
  4842. #include <poppack.h> /* Return to byte packing */
  4843. // these delegate to IShellFolder2::GetItemData()
  4844. SHSTDAPI SHGetDataFromIDList%(IShellFolder *psf, LPCITEMIDLIST pidl, int nFormat, void *pv, int cb);
  4845. ;begin_internal
  4846. #ifndef NOOCHOST // {
  4847. //
  4848. // ====== OCHOST CONTROL ==========================================
  4849. //
  4850. // The following are all definations of structures, windows messages needed for OCHOST,
  4851. // the window control you can use to host an OC.
  4852. // To use OCHOST, you must specify the window class as OCHOST_CLASS or "OCHOST"
  4853. // -- To Create and initialize OCHOST:
  4854. // 1. CreateWindow with window title = the string version of class id or the OC
  4855. // 2. CreateWindow with a pointer to the OCHINITSTRUCT structure as the last parameter
  4856. // you must allocate and initialize the OCHINITSTRUCT structure
  4857. // 3. CreateWindow with no title and the last param == NULL, then use the OCM_INITIALIZE message
  4858. // or the OCHost_InitOC macro to initialize it.
  4859. // 4. Use OCM_QUERYINTERFACE to QI an interface pointer from the OC.
  4860. // 5. Simply destroy the window when you exit.
  4861. // SHDRC -- Shell Doc Register Classes
  4862. typedef struct _SHDRC {
  4863. DWORD cbSize; // size of this structure in bytes
  4864. DWORD dwFlags; // SHDRCF_ flags
  4865. } SHDRC;
  4866. #define SHDRCF_OCHOST 0x0001 // Register the OCHOST_CLASS window
  4867. #define SHDRCF_ALL 0x0001 // ;Internal
  4868. SHDOCAPI_(BOOL) DllRegisterWindowClasses(const SHDRC * pshdrc);
  4869. BROWSEUIAPI_(BOOL) InitOCHostClass(const SHDRC *pshdrc);
  4870. #define OCHOST_CLASSA "OCHost"
  4871. #define OCHOST_CLASSW L"OCHost"
  4872. #ifdef UNICODE
  4873. #define OCHOST_CLASS OCHOST_CLASSW
  4874. #else
  4875. #define OCHOST_CLASS OCHOST_CLASSA
  4876. #endif
  4877. // ------------------- Window messages for OC Host --------------------
  4878. // IUnknown::QueryInterface the hosted OC
  4879. typedef struct _QIMSG {
  4880. const IID * qiid;
  4881. void **ppvObject;
  4882. } QIMSG, *LPQIMSG;
  4883. // ................. Query Interface Message ..........
  4884. #define OCM_QUERYINTERFACE (WM_USER+0)
  4885. #ifdef __cplusplus
  4886. inline HRESULT OCHost_QueryInterface(HWND hwndOCH, REFIID riid, void **ppv) \
  4887. { QIMSG qimsg = {&riid, ppv}; \
  4888. return (HRESULT)SNDMSG((hwndOCH), OCM_QUERYINTERFACE, (WPARAM)sizeof(qimsg), (LPARAM)&qimsg); \
  4889. }
  4890. #else
  4891. #define OCHost_QueryInterface(hwndOCH, riid, ppv) \
  4892. { QIMSG qimsg = {&riid, ppv}; \
  4893. SNDMSG((hwndOCH), OCM_QUERYINTERFACE, (WPARAM)sizeof(qimsg), (LPARAM)&qimsg); \
  4894. }
  4895. #endif
  4896. // ------------------- OC Initialization Structure ---------------------
  4897. // This is intended to be passed in as the lParam of the OCM_INITOC message
  4898. typedef struct _OCHINITSTRUCT {
  4899. UINT cbSize; // size of this structure
  4900. CLSID clsidOC; // class ID of the OC
  4901. IUnknown * punkOwner; // owner of OCHOST
  4902. } OCHINITSTRUCT, *LPOCHINITSTRUCT;
  4903. //--------------------------------------------------------------------
  4904. // ................ Initialize and activate the OC ...............
  4905. #define OCM_INITIALIZE (WM_USER+1)
  4906. #define OCM_INITOC OCM_INITIALIZE
  4907. #define OCHost_InitOC(hwndOCH, lpOCS) \
  4908. (HRESULT)SNDMSG((hwndOCH), OCM_INITOC, 0, (LPARAM)lpOCS)
  4909. // ............... give ochost a parent IUnknown .......
  4910. #define OCM_SETOWNER (WM_USER+2)
  4911. #define OCHost_SetOwner(hwndOC, punk) \
  4912. (HRESULT)SNDMSG((hwndOC), OCM_SETOWNER, 0, (LPARAM)(IUnknown*)(punk))
  4913. // ............... DoVerb the OC .......
  4914. // n.b. iVerb is technically a long, WPARAM might truncate it
  4915. #define OCM_DOVERB (WM_USER+3)
  4916. #define OCHost_DoVerb(hwndOC, iVerb, lpMsg) \
  4917. (HRESULT)SNDMSG((hwndOC), OCM_DOVERB, (WPARAM)iVerb, (LPARAM)lpMsg)
  4918. //.................Enable/Disable OC event notifications
  4919. #define OCM_ENABLEEVENTS (WM_USER+4)
  4920. // WPARAM: TRUE to enable event notifications, FALSE to disable.
  4921. // returns: TRUE if successful, otherwise FALSE.
  4922. // Event notification is in the form of a WM_NOTIFY with
  4923. // code OCN_OCEVENT and an NMOCEVENT block.
  4924. #define OCHost_EnableEvents(hwndOC, bEnable) \
  4925. (BOOL)SNDMSG((hwndOC), OCM_ENABLEEVENTS, (WPARAM)bEnable, 0L)
  4926. #define OCM_SETSERVICEPROVIDER (WM_USER+5)
  4927. // LPARAM: IServiceProvider* pSP.
  4928. // This message sets a service provider for SID_OleClientSite delegation.
  4929. // Currently, OCHost will just call this guy with (SID_OleClientSite, IDispatch)
  4930. // and the client-implemented service provider can return an IDispatch to
  4931. // handle ambient properties.
  4932. #define OCHost_SetServiceProvider(hwndOC, pSP) \
  4933. (BOOL)SNDMSG((hwndOC), OCM_SETSERVICEPROVIDER, 0L, (LPARAM) pSP)
  4934. // ------------------ Window Notify messages from OC Host --------------
  4935. #define OCN_FIRST 0x1300
  4936. #define OCN_COCREATEINSTANCE (OCN_FIRST + 1)
  4937. typedef struct _OCNCOCREATEMSG {
  4938. NMHDR nmhdr;
  4939. CLSID clsidOC;
  4940. IUnknown ** ppunk;
  4941. } OCNCOCREATEMSG, *LPOCNCOCREATEMSG;
  4942. // NOTE: return values are defined as the following
  4943. // If the handler of OCN_COCREATEINSTANCE Notify message returns OCNCOCREATE_ALREADYCREATED,
  4944. // on return the (*ppvObj) is assumed to have the value of the OC's IUnkown pointer
  4945. #define OCNCOCREATE_CONTINUE 0
  4946. #define OCNCOCREATE_HANDLED -1
  4947. #define OCN_PERSISTINIT (OCN_FIRST + 2)
  4948. // NOTE: return values are defined as the following
  4949. // If the handler of OCN_PERSISTINIT Notify message returns OCNPERSIST_ABORT,
  4950. // the OCHOST will abort IPersist's initialization.
  4951. #define OCNPERSISTINIT_CONTINUE 0
  4952. #define OCNPERSISTINIT_HANDLED -1
  4953. // The return value on the following notify messages are ignored.
  4954. #define OCN_ACTIVATE (OCN_FIRST + 3)
  4955. #define OCN_DEACTIVATE (OCN_FIRST + 4)
  4956. #define OCN_EXIT (OCN_FIRST + 5)
  4957. #define OCN_ONPOSRECTCHANGE (OCN_FIRST + 6)
  4958. typedef struct _OCNONPOSRECTCHANGEMSG {
  4959. NMHDR nmhdr;
  4960. LPCRECT prcPosRect;
  4961. } OCNONPOSRECTCHANGEMSG, *LPOCNONPOSRECTCHANGEMSG;
  4962. #define OCN_ONUIACTIVATE (OCN_FIRST + 7)
  4963. typedef struct _OCNONUIACTIVATEMSG {
  4964. NMHDR nmhdr;
  4965. IUnknown *punk;
  4966. } OCNONUIACTIVATEMSG, *LPOCNONUIACTIVATEMSG;
  4967. #define OCNONUIACTIVATE_HANDLED -1
  4968. #define OCN_ONSETSTATUSTEXT (OCN_FIRST + 8)
  4969. typedef struct _OCNONSETSTATUSTEXT {
  4970. NMHDR nmhdr;
  4971. LPCOLESTR pwszStatusText;
  4972. } OCNONSETSTATUSTEXTMSG, *LPOCNONSETSTATUSTEXTMSG;
  4973. #define OCN_OCEVENT (OCN_FIRST + 9)
  4974. // OC event notification block.
  4975. // Recipient should return nonzero if any outbound parameters were modified
  4976. // and should be returned to the ActiveX control object; otherwse zero.
  4977. // NOTE: Structure is not properly aligned. Already shipped so too late to fix;internal
  4978. typedef struct tagNMOCEVENT
  4979. {
  4980. IN NMHDR hdr ;
  4981. IN DISPID dispID ;
  4982. IN IID iid ;
  4983. IN LCID lcid ;
  4984. IN WORD wFlags ;
  4985. IN OUT DISPPARAMS *pDispParams ;
  4986. OUT VARIANT *pVarResult ;
  4987. OUT EXCEPINFO *pExepInfo ;
  4988. OUT UINT *puArgErr ;
  4989. } NMOCEVENT, *PNMOCEVENT, *LPNMOCEVENT ;
  4990. #endif // NOOCHOST // }
  4991. ;end_internal
  4992. ;begin_internal
  4993. //
  4994. // Access to shdocvw's active session count
  4995. //
  4996. enum SessionOp {
  4997. SESSION_QUERY = 0,
  4998. SESSION_INCREMENT,
  4999. SESSION_DECREMENT,
  5000. SESSION_INCREMENT_NODEFAULTBROWSERCHECK
  5001. };
  5002. long SetQueryNetSessionCount(enum SessionOp Op);
  5003. SHDOCAPI_(void) IEWriteErrorLog(const EXCEPTION_RECORD* pexr);
  5004. ;end_internal
  5005. //===========================================================================
  5006. ;begin_internal
  5007. //
  5008. // Internal APIs Follow. NOT FOR PUBLIC CONSUMPTION.
  5009. //
  5010. // Errors shared in the shell
  5011. #define E_FILE_NOT_FOUND MAKE_SCODE(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
  5012. #define E_PATH_NOT_FOUND MAKE_SCODE(SEVERITY_ERROR, FACILITY_WIN32, ERROR_PATH_NOT_FOUND)
  5013. // Useful macros
  5014. #define ResultFromShort(i) MAKE_HRESULT(SEVERITY_SUCCESS, 0, (USHORT)(i))
  5015. #define ShortFromResult(r) (short)HRESULT_CODE(r)
  5016. #if (defined(UNICODE) && !defined(_X86_)) // all non-x86 systems require alignment
  5017. #ifndef ALIGNMENT_SCENARIO
  5018. #define ALIGNMENT_SCENARIO
  5019. #endif
  5020. #endif
  5021. #ifndef LPNTSTR_DEFINED
  5022. #define LPNTSTR_DEFINED
  5023. typedef UNALIGNED const WCHAR * LPNCWSTR;
  5024. typedef UNALIGNED WCHAR * LPNWSTR;
  5025. #ifdef UNICODE
  5026. #define LPNCTSTR LPNCWSTR
  5027. #define LPNTSTR LPNWSTR
  5028. #else
  5029. #define LPNCTSTR LPCSTR
  5030. #define LPNTSTR LPSTR
  5031. #endif
  5032. #endif // LPNTSTR_DEFINED
  5033. #define RFN_FIRST (0U-510U) // run file dialog notify
  5034. #define RFN_LAST (0U-519U)
  5035. //=======================================================================
  5036. // String constants for
  5037. // 1. Registration database keywords (prefix STRREG_)
  5038. // 2. Exported functions from handler dlls (prefix STREXP_)
  5039. // 3. .INI file keywords (prefix STRINI_)
  5040. // 4. Others (prefix STR_)
  5041. //=======================================================================
  5042. #define STRREG_SHELLUI TEXT("ShellUIHandler")
  5043. #define STRREG_SHELL TEXT("Shell")
  5044. #define STRREG_DEFICON TEXT("DefaultIcon")
  5045. #define STRREG_SHEX TEXT("shellex")
  5046. #define STRREG_SHEX_PROPSHEET STRREG_SHEX TEXT("\\PropertySheetHandlers")
  5047. #define STRREG_SHEX_DDHANDLER STRREG_SHEX TEXT("\\DragDropHandlers")
  5048. #define STRREG_SHEX_MENUHANDLER STRREG_SHEX TEXT("\\ContextMenuHandlers")
  5049. #define STRREG_SHEX_COPYHOOK TEXT("Directory\\") STRREG_SHEX TEXT("\\CopyHookHandlers")
  5050. #define STRREG_SHEX_PRNCOPYHOOK TEXT("Printers\\") STRREG_SHEX TEXT("\\CopyHookHandlers")
  5051. #define STRREG_STARTMENU TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MenuOrder\\Start Menu")
  5052. #define STRREG_STARTMENU2 TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MenuOrder\\Start Menu2")
  5053. #define STRREG_FAVORITES TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MenuOrder\\Favorites")
  5054. #define STRREG_DISCARDABLE TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Discardable")
  5055. #define STRREG_POSTSETUP TEXT("\\PostSetup")
  5056. #define STREXP_CANUNLOAD "DllCanUnloadNow" // From OLE 2.0
  5057. #define STRINI_CLASSINFO TEXT(".ShellClassInfo") // secton name
  5058. #define STRINI_SHELLUI TEXT("ShellUIHandler")
  5059. #define STRINI_OPENDIRICON TEXT("OpenDirIcon")
  5060. #define STRINI_DIRICON TEXT("DirIcon")
  5061. #define STR_DESKTOPINI TEXT("desktop.ini")
  5062. #define STR_DESKTOPINIA "desktop.ini"
  5063. #define DRIVEID(path) ((*path - 'A') & 31)
  5064. #define PATH_CCH_EXT 64
  5065. // DOC'ed for DOJ Compliance
  5066. ;end_internal
  5067. // PathResolve flags
  5068. #define PRF_VERIFYEXISTS 0x0001
  5069. #define PRF_TRYPROGRAMEXTENSIONS (0x0002 | PRF_VERIFYEXISTS)
  5070. #define PRF_FIRSTDIRDEF 0x0004
  5071. #define PRF_DONTFINDLNK 0x0008 // if PRF_TRYPROGRAMEXTENSIONS is specified
  5072. ;begin_internal
  5073. #ifndef NOUSER ;internal_win40
  5074. typedef struct { ;internal_win40
  5075. NMHDR hdr; ;internal_win40
  5076. TCHAR% szCmd[MAX_PATH*2]; ;internal_win40
  5077. DWORD dwHotKey; ;internal_win40
  5078. HMONITOR hMonitor; ;internal_win40
  5079. } NMVIEWFOLDER%, *LPNMVIEWFOLDER%; ;internal_win40
  5080. #endif
  5081. // ;internal_win40
  5082. // DDE related APIs ;internal_win40
  5083. // ;internal_win40
  5084. SHSTDDOCAPI_(void) ShellDDEInit(BOOL fInit); ;internal_win40
  5085. SHSTDDOCAPI_(BOOL) DDEHandleViewFolderNotify(IShellBrowser* psb, HWND hwnd, LPNMVIEWFOLDER lpnm); ;internal_win40
  5086. SHSTDDOCAPI_(LPNMVIEWFOLDER) DDECreatePostNotify(LPNMVIEWFOLDER lpnm); ;internal_win40
  5087. // DOC'ed for DOJ compliance
  5088. ;end_internal
  5089. SHSTDAPI_(int) RestartDialog(HWND hwnd, LPCWSTR lpPrompt, DWORD dwReturn);
  5090. SHSTDAPI_(int) RestartDialogEx(HWND hwnd, LPCWSTR lpPrompt, DWORD dwReturn, DWORD dwReasonCode);
  5091. SHSTDAPI SHCoCreateInstance(LPCWSTR pszCLSID, const CLSID *pclsid, IUnknown *pUnkOuter, REFIID riid, void **ppv);
  5092. ;begin_internal
  5093. SHSTDAPI CIDLData_CreateFromIDArray(LPCITEMIDLIST pidlFolder, UINT cidl, LPCITEMIDLIST apidl[], IDataObject **ppdtobj);
  5094. SHSTDAPI SHCreateFileDataObject(LPCITEMIDLIST pidlFolder, UINT cidl, LPCITEMIDLIST *apidl, IDataObject *pdtInner, IDataObject **pdtobj);
  5095. // Common strings
  5096. #define STR_DESKTOPCLASS "Progman"
  5097. //
  5098. // Storage name of a scrap/bookmark item
  5099. //
  5100. #define WSTR_SCRAPITEM L"\003ITEM000"
  5101. // DOC'ed for DOJ Compliance
  5102. ;end_internal
  5103. // For CallCPLEntry16
  5104. //
  5105. DECLARE_HANDLE(FARPROC16);
  5106. SHSTDAPI_(LRESULT) CallCPLEntry16(HINSTANCE hinst, FARPROC16 lpfnEntry, HWND hwndCPL, UINT msg, LPARAM lParam1, LPARAM lParam2);
  5107. ;begin_internal
  5108. #ifdef RFN_FIRST
  5109. #define RFN_EXECUTE (RFN_FIRST - 0)
  5110. typedef struct {
  5111. NMHDR hdr;
  5112. LPCTSTR% lpszCmd;
  5113. LPCTSTR% lpszWorkingDir;
  5114. int nShowCmd;
  5115. } NMRUNFILE%, *LPNMRUNFILE%;
  5116. #endif
  5117. // DOC'ed for DOJ compliance
  5118. ;end_internal
  5119. SHSTDAPI SHCreateStdEnumFmtEtc(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **ppenumFormatEtc);
  5120. ;begin_internal
  5121. // Shell create link API
  5122. #define SHCL_USETEMPLATE 0x0001
  5123. #define SHCL_USEDESKTOP 0x0002
  5124. #define SHCL_CONFIRM 0x0004
  5125. #define SHCL_MAKEFOLDERSHORTCUT 0x0008
  5126. #if (_WIN32_IE >= 0x0600)
  5127. #define SHCL_NOUNIQUE 0x0010
  5128. #endif // _WIN2_IE >= 0x0600
  5129. SHSTDAPI SHCreateLinks(HWND hwnd, LPCTSTR pszDir, IDataObject *pDataObj, UINT fFlags, LPITEMIDLIST* ppidl);
  5130. SHSTDAPI SHRegisterDragDrop(HWND hwnd, IDropTarget *pdtgt);
  5131. SHSTDAPI SHRevokeDragDrop(HWND hwnd);
  5132. // DOC'ed for DOJ compliance
  5133. ;end_internal
  5134. SHSTDAPI SHDoDragDrop(HWND hwnd, IDataObject *pdata, IDropSource *pdsrc, DWORD dwEffect, DWORD *pdwEffect);
  5135. ;begin_internal
  5136. //===========================================================================
  5137. // office 9 pluggable UI
  5138. //===========================================================================
  5139. #define PUI_OFFICE_COMMAND (WM_USER + 0x901)
  5140. #define PLUGUI_CMD_SHUTDOWN 0 // wParam value
  5141. #define PLUGUI_CMD_QUERY 1 // wParam value
  5142. #define OFFICE_VERSION_9 9 // standardized value to return for Office 9 apps
  5143. typedef struct _PLUGUI_INFO
  5144. {
  5145. unsigned uMajorVersion : 8; // Used to indicate App's major version number
  5146. unsigned uOleServer : 1; // BOOL, TRUE if this is an OLE process
  5147. unsigned uUnused : 23; // not used
  5148. } PLUGUI_INFO;
  5149. typedef union _PLUGUI_QUERY
  5150. {
  5151. UINT uQueryVal;
  5152. PLUGUI_INFO PlugUIInfo;
  5153. } PLUGUI_QUERY;
  5154. //===========================================================================
  5155. // Image dragging API (definitely private)
  5156. //===========================================================================
  5157. // DOC'ed for DOJ Compliance
  5158. ;end_internal
  5159. // stuff for doing auto scrolling
  5160. #define NUM_POINTS 3
  5161. typedef struct { // asd
  5162. int iNextSample;
  5163. DWORD dwLastScroll;
  5164. BOOL bFull;
  5165. POINT pts[NUM_POINTS];
  5166. DWORD dwTimes[NUM_POINTS];
  5167. } AUTO_SCROLL_DATA;
  5168. ;begin_internal
  5169. //Contains the drag context header.
  5170. // Must be pack1 since it's persisted into a stream that travels between ;internal
  5171. // processes. ;internal
  5172. typedef struct {
  5173. BOOL fImage;
  5174. BOOL fLayered;
  5175. POINT ptOffset;
  5176. } DragContextHeader;
  5177. #define DAD_InitScrollData(pad) (pad)->bFull = FALSE, (pad)->iNextSample = 0, (pad)->dwLastScroll = 0
  5178. // DOC'ed for DOJ Compliance
  5179. ;end_internal
  5180. SHSTDAPI_(BOOL) DAD_SetDragImage(HIMAGELIST him, POINT * pptOffset);
  5181. ;begin_internal
  5182. SHSTDAPI_(BOOL) DAD_DragEnter(HWND hwndTarget);
  5183. // DOC'ed for DOJ Compliance
  5184. ;end_internal
  5185. SHSTDAPI_(BOOL) DAD_DragEnterEx(HWND hwndTarget, const POINT ptStart);
  5186. SHSTDAPI_(BOOL) DAD_DragEnterEx2(HWND hwndTarget, const POINT ptStart, IDataObject *pdtObject);
  5187. SHSTDAPI_(BOOL) DAD_ShowDragImage(BOOL fShow);
  5188. SHSTDAPI_(BOOL) DAD_DragMove(POINT pt);
  5189. SHSTDAPI_(BOOL) DAD_DragLeave(void);
  5190. SHSTDAPI_(BOOL) DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *pad, const POINT *pptNow);
  5191. SHSTDAPI_(BOOL) DAD_SetDragImageFromListView(HWND hwndLV, POINT ptOffset); ;internal
  5192. SHSTDAPI_(void) DAD_InvalidateCursors(void); ;internal
  5193. ;begin_internal
  5194. //----------------------------------------------------------------------------
  5195. // CABINETSTATE holds the global configuration for the Explorer and its cohorts.
  5196. //
  5197. // Originally the cLength was an 'int', it is now two words, allowing us to
  5198. // specify a version number.
  5199. //----------------------------------------------------------------------------
  5200. // DOC'ed for DOJ Compliance
  5201. ;end_internal
  5202. typedef struct {
  5203. WORD cLength;
  5204. WORD nVersion;
  5205. BOOL fFullPathTitle : 1;
  5206. BOOL fSaveLocalView : 1;
  5207. BOOL fNotShell : 1;
  5208. BOOL fSimpleDefault : 1;
  5209. BOOL fDontShowDescBar : 1;
  5210. BOOL fNewWindowMode : 1;
  5211. BOOL fShowCompColor : 1; // NT: Show compressed volumes in a different colour
  5212. BOOL fDontPrettyNames : 1; // NT: Do 8.3 name conversion, or not!
  5213. BOOL fAdminsCreateCommonGroups : 1; // NT: Administrators create comon groups
  5214. UINT fUnusedFlags : 7;
  5215. UINT fMenuEnumFilter;
  5216. } CABINETSTATE, * LPCABINETSTATE;
  5217. #define CABINETSTATE_VERSION 2
  5218. // APIs for reading and writing the cabinet state.
  5219. SHSTDAPI_(BOOL) ReadCabinetState( LPCABINETSTATE lpState, int iSize );
  5220. SHSTDAPI_(BOOL) WriteCabinetState( LPCABINETSTATE lpState );
  5221. ;begin_internal
  5222. // RUN FILE RETURN values from notify message
  5223. #define RFR_NOTHANDLED 0
  5224. #define RFR_SUCCESS 1
  5225. #define RFR_FAILURE 2
  5226. #define PathGetExtensionORD 158
  5227. SHSTDAPI_(LPTSTR) PathGetExtension(LPCTSTR pszPath, LPTSTR pszExtension, int cchExt);
  5228. // DOC'ed for DOJ Compliance
  5229. ;end_internal
  5230. SHSTDAPI_(BOOL) PathMakeUniqueName(LPWSTR pszUniqueName, UINT cchMax, LPCWSTR pszTemplate, LPCWSTR pszLongPlate, LPCWSTR pszDir);
  5231. ;begin_internal
  5232. SHSTDAPI_(BOOL) PathGetShortName(LPCTSTR pszLongName, LPTSTR pszShortName, UINT cbShortName);
  5233. SHSTDAPI_(BOOL) PathGetLongName(LPCTSTR pszShortName, LPTSTR pszLongName, UINT cbLongName);
  5234. SHSTDAPI_(BOOL) PathDirectoryExists(LPCTSTR pszDir);
  5235. // DOC'ed for DOJ Compliance
  5236. ;end_internal
  5237. SHSTDAPI_(void) PathQualify(LPWSTR psz);
  5238. ;begin_internal
  5239. SHSTDAPI_(LPTSTR) PathGetNextComponent(LPCTSTR pszPath, LPTSTR pszComponent);
  5240. // DOC'ed for DOJ Compliance
  5241. ;end_internal
  5242. SHSTDAPI_(BOOL) PathIsExe(LPCWSTR pszPath);
  5243. ;begin_internal
  5244. SHSTDAPI_(BOOL) PathIsEqualOrSubFolder(LPCTSTR pszFolder, LPCTSTR pszSubFolder);
  5245. // DOC'ed for DOJ Compliance
  5246. ;end_internal
  5247. SHSTDAPI_(BOOL) PathIsSlow%(LPCTSTR% pszFile, DWORD dwAttr);
  5248. ;begin_internal
  5249. SHSTDAPI_(BOOL) PathIsTemporary%(LPCTSTR% pszPath);
  5250. // DOC'ed for DOJ Compliance
  5251. ;end_internal
  5252. //
  5253. // Return codes from PathCleanupSpec. Negative return values are
  5254. // unrecoverable errors
  5255. //
  5256. #define PCS_FATAL 0x80000000
  5257. #define PCS_REPLACEDCHAR 0x00000001
  5258. #define PCS_REMOVEDCHAR 0x00000002
  5259. #define PCS_TRUNCATED 0x00000004
  5260. #define PCS_PATHTOOLONG 0x00000008 // Always combined with FATAL
  5261. SHSTDAPI_(int) PathCleanupSpec(LPCWSTR pszDir, LPWSTR pszSpec);
  5262. ;begin_internal
  5263. SHSTDAPI_(int) PathCleanupSpecEx(LPCTSTR pszDir, LPTSTR pszSpec);
  5264. // DOC'ed for DOJ Compliance
  5265. ;end_internal
  5266. SHSTDAPI_(int) PathResolve(LPWSTR pszPath, LPCWSTR dirs[], UINT fFlags);
  5267. ;begin_internal
  5268. SHSTDAPI_(BOOL) ParseField(LPCTSTR szData, int n, LPTSTR szBuf, int iBufLen);
  5269. // Needed for RunFileDlg
  5270. #define RFD_NOBROWSE 0x00000001
  5271. #define RFD_NODEFFILE 0x00000002
  5272. #define RFD_USEFULLPATHDIR 0x00000004
  5273. #define RFD_NOSHOWOPEN 0x00000008
  5274. #define RFD_WOW_APP 0x00000010
  5275. #define RFD_NOSEPMEMORY_BOX 0x00000020
  5276. SHSTDAPI_(int) RunFileDlg(HWND hwnd, HICON hIcon, LPCTSTR pszWorkingDir, LPCTSTR pszTitle,
  5277. LPCTSTR pszPrompt, DWORD dwFlags);
  5278. // DOC'ed for DOJ Compliance
  5279. ;end_internal
  5280. SHSTDAPI_(BOOL) GetFileNameFromBrowse(HWND hwnd, LPWSTR pszFilePath, UINT cbFilePath,
  5281. LPCWSTR pszWorkingDir, LPCWSTR pszDefExt, LPCWSTR pszFilters, LPCWSTR pszTitle);
  5282. SHSTDAPI_(int) DriveType(int iDrive);
  5283. ;begin_internal
  5284. SHSTDAPI_(int) RealDriveTypeFlags(int iDrive, BOOL fOKToHitNet);
  5285. // DOC'ed for DOJ compliance
  5286. ;end_internal
  5287. SHSTDAPI_(int) RealDriveType(int iDrive, BOOL fOKToHitNet);
  5288. ;begin_internal
  5289. SHSTDAPI_(void) InvalidateDriveType(int iDrive);
  5290. // DOC'ed for DOJ Compliance
  5291. ;end_internal
  5292. SHSTDAPI_(int) IsNetDrive(int iDrive);
  5293. ;begin_internal
  5294. //
  5295. // Constants used for dwNumFmtFlags argument in Int64ToString and LargeIntegerToString.
  5296. //
  5297. #define NUMFMT_IDIGITS 0x00000001
  5298. #define NUMFMT_ILZERO 0x00000002
  5299. #define NUMFMT_SGROUPING 0x00000004
  5300. #define NUMFMT_SDECIMAL 0x00000008
  5301. #define NUMFMT_STHOUSAND 0x00000010
  5302. #define NUMFMT_INEGNUMBER 0x00000020
  5303. #define NUMFMT_ALL 0xFFFFFFFF
  5304. SHSTDAPI_(int) LargeIntegerToString(LARGE_INTEGER *pN, LPTSTR szOutStr, UINT nSize, BOOL bFormat, NUMBERFMT *pFmt, DWORD dwNumFmtFlags);
  5305. SHSTDAPI_(int) Int64ToString(_int64 n, LPTSTR szOutStr, UINT nSize, BOOL bFormat, NUMBERFMT *pFmt, DWORD dwNumFmtFlags);
  5306. //-------- drive type identification --------------
  5307. // iDrive drive index (0=A, 1=B, ...)
  5308. //
  5309. #define DRIVE_CDROM 5 // extended DriveType() types
  5310. #define DRIVE_RAMDRIVE 6
  5311. #define DRIVE_TYPE 0x000F // type masek
  5312. #define DRIVE_SLOW 0x0010 // drive is on a slow link
  5313. #define DRIVE_LFN 0x0020 // drive supports LFNs
  5314. #define DRIVE_AUTORUN 0x0040 // drive has AutoRun.inf in root.
  5315. #define DRIVE_AUDIOCD 0x0080 // drive is a AudioCD
  5316. #define DRIVE_AUTOOPEN 0x0100 // should *always* auto open on insert
  5317. #define DRIVE_NETUNAVAIL 0x0200 // Network drive that is not available
  5318. #define DRIVE_SHELLOPEN 0x0400 // should auto open on insert, if shell has focus
  5319. #define DRIVE_SECURITY 0x0800 // Supports ACLs
  5320. #define DRIVE_COMPRESSED 0x1000 // Root of volume is compressed
  5321. #define DRIVE_ISCOMPRESSIBLE 0x2000 // Drive supports compression (not nescesarrily compressed)
  5322. #define DRIVE_DVD 0x4000 // drive is a DVD
  5323. #define DriveTypeFlags(iDrive) DriveType('A' + (iDrive))
  5324. #define DriveIsSlow(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_SLOW)
  5325. #define DriveIsLFN(iDrive) (RealDriveTypeFlags(iDrive, TRUE) & DRIVE_LFN)
  5326. #define DriveIsAutoRun(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_AUTORUN)
  5327. #define DriveIsAutoOpen(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_AUTOOPEN)
  5328. #define DriveIsShellOpen(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_SHELLOPEN)
  5329. #define DriveIsAudioCD(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_AUDIOCD)
  5330. #define DriveIsNetUnAvail(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_NETUNAVAIL)
  5331. #define DriveIsSecure(iDrive) (RealDriveTypeFlags(iDrive, TRUE) & DRIVE_SECURITY)
  5332. #define DriveIsCompressed(iDrive) (RealDriveTypeFlags(iDrive, TRUE) & DRIVE_COMPRESSED)
  5333. #define DriveIsCompressible(iDrive) (RealDriveTypeFlags(iDrive, TRUE) & DRIVE_ISCOMPRESSIBLE)
  5334. #define DriveIsDVD(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_DVD)
  5335. #define IsCDRomDrive(iDrive) (RealDriveType(iDrive, FALSE) == DRIVE_CDROM)
  5336. #define IsRamDrive(iDrive) (RealDriveType(iDrive, FALSE) == DRIVE_RAMDRIVE)
  5337. #define IsRemovableDrive(iDrive) (RealDriveType(iDrive, FALSE) == DRIVE_REMOVABLE)
  5338. #define IsRemoteDrive(iDrive) (RealDriveType(iDrive, FALSE) == DRIVE_REMOTE)
  5339. //
  5340. // For SHCreateDefClassObject
  5341. //
  5342. typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown *pUnkOuter, REFIID riid, void **ppvObject);
  5343. SHSTDAPI SHCreateDefClassObject(REFIID riid, void **ppv, LPFNCREATEINSTANCE lpfn, UINT *pcRefDll, REFIID riidInstance);
  5344. // DOC'ed for DOJ compliance
  5345. ;end_internal
  5346. // Flags for Shell_MergeMenus
  5347. #define MM_ADDSEPARATOR 0x00000001L
  5348. #define MM_SUBMENUSHAVEIDS 0x00000002L
  5349. #define MM_DONTREMOVESEPS 0x00000004L
  5350. SHSTDAPI_(UINT) Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);
  5351. ;begin_internal
  5352. typedef HANDLE HNRES; // for SHGetNetResource
  5353. SHSTDAPI_(UINT) SHGetNetResource(HNRES hnres, UINT iItem, LPNETRESOURCE pnres, UINT cbMax);
  5354. ;end_internal
  5355. /*
  5356. * The SHObjectProperties API provides an easy way to invoke
  5357. * the Properties context menu command on shell objects.
  5358. *
  5359. * PARAMETERS
  5360. *
  5361. * hwnd The window handle of the window which will own the dialog
  5362. * dwType A SHOP_ value as defined below
  5363. * lpObject Name of the object, see SHOP_ values below
  5364. * lpPage The name of the property sheet page to open to or NULL.
  5365. *
  5366. * RETURN
  5367. *
  5368. * TRUE if the Properties command was invoked
  5369. */
  5370. SHSTDAPI_(BOOL) SHObjectProperties(HWND hwnd, DWORD dwType, LPCWSTR lpObject, LPCWSTR lpPage);
  5371. #define SHOP_PRINTERNAME 0x00000001 // lpObject points to a printer friendly name
  5372. #define SHOP_FILEPATH 0x00000002 // lpObject points to a fully qualified path+file name
  5373. #define SHOP_VOLUMEGUID 0x00000004 // lpObject points to a Volume GUID
  5374. ;begin_internal
  5375. #define SHOP_TYPEMASK 0x00000007
  5376. #define SHOP_MODAL 0x80000000
  5377. ;end_internal
  5378. /*
  5379. * The SHFormatDrive API provides access to the Shell
  5380. * format dialog. This allows apps which want to format disks
  5381. * to bring up the same dialog that the Shell does to do it.
  5382. *
  5383. * This dialog is not sub-classable. You cannot put custom
  5384. * controls in it. If you want this ability, you will have
  5385. * to write your own front end for the DMaint_FormatDrive
  5386. * engine.
  5387. *
  5388. * NOTE that the user can format as many diskettes in the specified
  5389. * drive, or as many times, as he/she wishes to. There is no way to
  5390. * force any specififc number of disks to format. If you want this
  5391. * ability, you will have to write your own front end for the
  5392. * DMaint_FormatDrive engine.
  5393. *
  5394. * NOTE also that the format will not start till the user pushes the
  5395. * start button in the dialog. There is no way to do auto start. If
  5396. * you want this ability, you will have to write your own front end
  5397. * for the DMaint_FormatDrive engine.
  5398. *
  5399. * PARAMETERS
  5400. *
  5401. * hwnd = The window handle of the window which will own the dialog
  5402. * NOTE that unlike SHCheckDrive, hwnd == NULL does not cause
  5403. * this dialog to come up as a "top level application" window.
  5404. * This parameter should always be non-null, this dialog is
  5405. * only designed to be the child of another window, not a
  5406. * stand-alone application.
  5407. * drive = The 0 based (A: == 0) drive number of the drive to format
  5408. * fmtID = The ID of the physical format to format the disk with
  5409. * NOTE: The special value SHFMT_ID_DEFAULT means "use the
  5410. * default format specified by the DMaint_FormatDrive
  5411. * engine". If you want to FORCE a particular format
  5412. * ID "up front" you will have to call
  5413. * DMaint_GetFormatOptions yourself before calling
  5414. * this to obtain the valid list of phys format IDs
  5415. * (contents of the PhysFmtIDList array in the
  5416. * FMTINFOSTRUCT).
  5417. * options = There is currently only two option bits defined
  5418. *
  5419. * SHFMT_OPT_FULL
  5420. * SHFMT_OPT_SYSONLY
  5421. *
  5422. * The normal defualt in the Shell format dialog is
  5423. * "Quick Format", setting this option bit indicates that
  5424. * the caller wants to start with FULL format selected
  5425. * (this is useful for folks detecting "unformatted" disks
  5426. * and wanting to bring up the format dialog).
  5427. *
  5428. * The SHFMT_OPT_SYSONLY initializes the dialog to
  5429. * default to just sys the disk.
  5430. *
  5431. * All other bits are reserved for future expansion and
  5432. * must be 0.
  5433. *
  5434. * Please note that this is a bit field and not a value
  5435. * and treat it accordingly.
  5436. *
  5437. * RETURN
  5438. * The return is either one of the SHFMT_* values, or if the
  5439. * returned DWORD value is not == to one of these values, then
  5440. * the return is the physical format ID of the last succesful
  5441. * format. The LOWORD of this value can be passed on subsequent
  5442. * calls as the fmtID parameter to "format the same type you did
  5443. * last time".
  5444. *
  5445. */
  5446. SHSTDAPI_(DWORD) SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options);
  5447. ;begin_internal
  5448. SHSTDAPI_(DWORD) SHChkDskDrive(HWND hwnd, UINT drive);
  5449. // DOC'ed for DOJ compliance
  5450. ;end_internal
  5451. //
  5452. // Special value of fmtID which means "use the default format"
  5453. //
  5454. #define SHFMT_ID_DEFAULT 0xFFFF
  5455. //
  5456. // Option bits for options parameter
  5457. //
  5458. #define SHFMT_OPT_FULL 0x0001
  5459. #define SHFMT_OPT_SYSONLY 0x0002
  5460. //
  5461. // Special return values. PLEASE NOTE that these are DWORD values.
  5462. //
  5463. #define SHFMT_ERROR 0xFFFFFFFFL // Error on last format, drive may be formatable
  5464. #define SHFMT_CANCEL 0xFFFFFFFEL // Last format was canceled
  5465. #define SHFMT_NOFORMAT 0xFFFFFFFDL // Drive is not formatable
  5466. ;begin_internal
  5467. //====== SEMI-PRIVATE API ===============================
  5468. // DOC'ed for DOJ compliance
  5469. ;end_internal
  5470. #ifndef HPSXA_DEFINED
  5471. #define HPSXA_DEFINED
  5472. DECLARE_HANDLE( HPSXA );
  5473. #endif
  5474. WINSHELLAPI HPSXA SHCreatePropSheetExtArray( HKEY hKey, LPCWSTR pszSubKey, UINT max_iface );
  5475. WINSHELLAPI void SHDestroyPropSheetExtArray( HPSXA hpsxa );
  5476. WINSHELLAPI UINT SHAddFromPropSheetExtArray( HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam );
  5477. WINSHELLAPI UINT SHReplaceFromPropSheetExtArray( HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam );
  5478. ;begin_internal
  5479. WINSHELLAPI HPSXA SHCreatePropSheetExtArrayEx( HKEY hKey, LPCTSTR pszSubKey, UINT max_iface, IDataObject * pdo );
  5480. //====== SEMI-PRIVATE API ORDINALS ===============================
  5481. // This is the list of semi-private ordinals we semi-publish.
  5482. #define SHGetNetResourceORD 69
  5483. #define SHObjectPropertiesORD 178
  5484. #define SHAddFromPropSheetExtArrayORD 167
  5485. #define SHCreatePropSheetExtArrayORD 168
  5486. #define SHDestroyPropSheetExtArrayORD 169
  5487. #define SHReplaceFromPropSheetExtArrayORD 170
  5488. #define SHCreateDefClassObjectORD 70
  5489. #define SHEXP_SHGETNETRESOURCE MAKEINTRESOURCE(SHGetNetResourceORD)
  5490. #define SHEXP_SHADDFROMPROPSHEETEXTARRAY MAKEINTRESOURCE(SHAddFromPropSheetExtArrayORD)
  5491. #define SHEXP_SHCREATEPROPSHEETEXTARRAY MAKEINTRESOURCE(SHCreatePropSheetExtArrayORD)
  5492. #define SHEXP_SHDESTROYPROPSHEETEXTARRAY MAKEINTRESOURCE(SHDestroyPropSheetExtArrayORD)
  5493. #define SHEXP_SHREPLACEFROMPROPSHEETEXTARRAY MAKEINTRESOURCE(SHReplaceFromPropSheetExtArrayORD)
  5494. #define SHEXP_SHCREATEDEFCLASSOBJECT MAKEINTRESOURCE(SHCreateDefClassObjectORD)
  5495. // This avoids duplicate definition problems in the net\config project
  5496. // which defines *some* of its own PIDL utility functions, but depends on
  5497. // us for others (ILClone())
  5498. // DOC'ed for DOJ Compliance
  5499. ;end_internal
  5500. SHSTDAPI_(LPITEMIDLIST) ILClone(LPCITEMIDLIST pidl);
  5501. ;begin_internal
  5502. #ifndef AVOID_NET_CONFIG_DUPLICATES
  5503. //===========================================================================
  5504. // ITEMIDLIST
  5505. //===========================================================================
  5506. // flags for ILGetDisplayNameEx
  5507. #define ILGDN_FULLNAME 0
  5508. #define ILGDN_ITEMONLY 1
  5509. #define ILGDN_INFOLDER 2
  5510. // DOC'ed for DOJ Compliance
  5511. ;end_internal
  5512. SHSTDAPI_(LPITEMIDLIST) ILGetNext(LPCITEMIDLIST pidl);
  5513. SHSTDAPI_(UINT) ILGetSize(LPCITEMIDLIST pidl);
  5514. SHSTDAPI_(LPITEMIDLIST) ILFindLastID(LPCITEMIDLIST pidl);
  5515. SHSTDAPI_(BOOL) ILRemoveLastID(LPITEMIDLIST pidl);
  5516. ;begin_internal
  5517. #define ILIsEmpty(pidl) ((pidl) == NULL || (pidl)->mkid.cb==0)
  5518. SHSTDAPI_(LPITEMIDLIST) ILCreate(void);
  5519. // DOC'ed for DOJ Compliance
  5520. ;end_internal
  5521. SHSTDAPI_(LPITEMIDLIST) ILAppendID(LPITEMIDLIST pidl, LPCSHITEMID pmkid, BOOL fAppend);
  5522. SHSTDAPI_(void) ILFree(LPITEMIDLIST pidl);
  5523. ;begin_internal
  5524. SHSTDAPI_(void) ILGlobalFree(LPITEMIDLIST pidl);
  5525. SHSTDAPI_(BOOL) ILGetDisplayName(LPCITEMIDLIST pidl, LPTSTR pszName);
  5526. SHSTDAPI_(BOOL) ILGetDisplayNameEx(IShellFolder *psfRoot, LPCITEMIDLIST pidl, LPTSTR pszName, int fType);
  5527. // DOC'ed for DOJ Compliance
  5528. ;end_internal
  5529. SHSTDAPI_(LPITEMIDLIST) ILCloneFirst(LPCITEMIDLIST pidl);
  5530. ;begin_internal
  5531. SHSTDAPI_(LPITEMIDLIST) ILGlobalClone(LPCITEMIDLIST pidl);
  5532. // DOC'ed for DOJ Compliance
  5533. ;end_internal
  5534. SHSTDAPI_(BOOL) ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  5535. SHSTDAPI_(BOOL) ILIsParent(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, BOOL fImmediate);
  5536. SHSTDAPI_(LPITEMIDLIST) ILFindChild(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild);
  5537. SHSTDAPI_(LPITEMIDLIST) ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  5538. SHSTDAPI ILLoadFromStream(IStream *pstm, LPITEMIDLIST *pidl);
  5539. SHSTDAPI ILSaveToStream(IStream *pstm, LPCITEMIDLIST pidl);
  5540. ;begin_internal
  5541. SHSTDAPI ILLoadFromFile(HFILE hfile, LPITEMIDLIST *pidl);
  5542. SHSTDAPI ILSaveToFile(HFILE hfile, LPCITEMIDLIST pidl);
  5543. // DOC'ed for DOJ Compliance
  5544. ;end_internal
  5545. #if (_WIN32_IE >= 0x0400)
  5546. SHSTDAPI_(LPITEMIDLIST) ILCreateFromPathA(LPCSTR pszPath);
  5547. SHSTDAPI_(LPITEMIDLIST) ILCreateFromPathW(LPCWSTR pszPath);
  5548. #ifdef NO_WRAPPERS_FOR_ILCREATEFROMPATH
  5549. SHSTDAPI_(LPITEMIDLIST) ILCreateFromPath(LPCTSTR pszPath);
  5550. #else
  5551. #ifdef UNICODE
  5552. #define ILCreateFromPath ILCreateFromPathW
  5553. #else
  5554. #define ILCreateFromPath ILCreateFromPathA
  5555. #endif // !UNICODE
  5556. #endif
  5557. #endif
  5558. SHSTDAPI SHILCreateFromPath(LPCWSTR szPath, LPITEMIDLIST *ppidl, DWORD *rgfInOut);
  5559. ;begin_internal
  5560. // helper macros
  5561. #define ILCreateFromID(pmkid) ILAppendID(NULL, pmkid, TRUE)
  5562. #endif // AVOID_NET_CONFIG_DUPLICATES
  5563. // WARNING: this interface is not supported on the current platform, just downlevel
  5564. ;end_internal
  5565. #undef INTERFACE
  5566. #define INTERFACE IDefViewFrame
  5567. DECLARE_INTERFACE_(IDefViewFrame, IUnknown)
  5568. {
  5569. // *** IUnknown methods ***
  5570. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  5571. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  5572. STDMETHOD_(ULONG,Release) (THIS) PURE;
  5573. // *** IDefViewFrame methods ***
  5574. STDMETHOD(GetWindowLV) (THIS_ HWND * phwnd) PURE;
  5575. STDMETHOD(ReleaseWindowLV) (THIS) PURE;
  5576. STDMETHOD(GetShellFolder)(THIS_ IShellFolder **ppsf) PURE;
  5577. };
  5578. ;begin_internal
  5579. #undef INTERFACE
  5580. #define INTERFACE IWebViewOCWinMan
  5581. DECLARE_INTERFACE_(IWebViewOCWinMan, IUnknown)
  5582. {
  5583. // *** IUnknown methods ***
  5584. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  5585. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  5586. STDMETHOD_(ULONG,Release) (THIS) PURE;
  5587. // *** IWebViewOCWinMan methods ***
  5588. STDMETHOD(SwapWindow) (THIS_ HWND hwndLV, IWebViewOCWinMan **pocWinMan) PURE;
  5589. };
  5590. // DOC'ed for DOJ compliance
  5591. ;end_internal
  5592. //===========================================================================
  5593. // Shell restrictions. (Parameter for SHRestricted)
  5594. typedef enum RESTRICTIONS
  5595. {
  5596. ;begin_internal
  5597. // Classic Win95 policy bits. Do NOT add any more bits in
  5598. // this range. See the ranges below to add new policies.
  5599. // | |
  5600. // v v
  5601. ;end_internal
  5602. REST_NONE = 0x00000000,
  5603. REST_NORUN = 0x00000001,
  5604. REST_NOCLOSE = 0x00000002,
  5605. REST_NOSAVESET = 0x00000004,
  5606. REST_NOFILEMENU = 0x00000008,
  5607. REST_NOSETFOLDERS = 0x00000010,
  5608. REST_NOSETTASKBAR = 0x00000020,
  5609. REST_NODESKTOP = 0x00000040,
  5610. REST_NOFIND = 0x00000080,
  5611. REST_NODRIVES = 0x00000100,
  5612. REST_NODRIVEAUTORUN = 0x00000200,
  5613. REST_NODRIVETYPEAUTORUN = 0x00000400,
  5614. REST_NONETHOOD = 0x00000800,
  5615. REST_STARTBANNER = 0x00001000,
  5616. REST_RESTRICTRUN = 0x00002000,
  5617. REST_NOPRINTERTABS = 0x00004000,
  5618. REST_NOPRINTERDELETE = 0x00008000,
  5619. REST_NOPRINTERADD = 0x00010000,
  5620. REST_NOSTARTMENUSUBFOLDERS = 0x00020000,
  5621. REST_MYDOCSONNET = 0x00040000,
  5622. REST_NOEXITTODOS = 0x00080000,
  5623. REST_ENFORCESHELLEXTSECURITY = 0x00100000,
  5624. REST_LINKRESOLVEIGNORELINKINFO = 0x00200000,
  5625. REST_NOCOMMONGROUPS = 0x00400000,
  5626. REST_SEPARATEDESKTOPPROCESS = 0x00800000,
  5627. REST_NOWEB = 0x01000000,
  5628. REST_NOTRAYCONTEXTMENU = 0x02000000,
  5629. REST_NOVIEWCONTEXTMENU = 0x04000000,
  5630. REST_NONETCONNECTDISCONNECT = 0x08000000,
  5631. REST_STARTMENULOGOFF = 0x10000000,
  5632. REST_NOSETTINGSASSIST = 0x20000000,
  5633. ;begin_internal
  5634. // Values starting at 4000001 are treated as raw INTs. New
  5635. // *shell-specific* policies (NOT browser policies) should
  5636. // be added in this range. Use SHRestricted() with these bits.
  5637. // | |
  5638. // v v
  5639. ;end_internal
  5640. REST_NOINTERNETICON = 0x40000001,
  5641. REST_NORECENTDOCSHISTORY = 0x40000002,
  5642. REST_NORECENTDOCSMENU = 0x40000003,
  5643. REST_NOACTIVEDESKTOP = 0x40000004,
  5644. REST_NOACTIVEDESKTOPCHANGES = 0x40000005,
  5645. REST_NOFAVORITESMENU = 0x40000006,
  5646. REST_CLEARRECENTDOCSONEXIT = 0x40000007,
  5647. REST_CLASSICSHELL = 0x40000008,
  5648. REST_NOCUSTOMIZEWEBVIEW = 0x40000009,
  5649. REST_NOHTMLWALLPAPER = 0x40000010,
  5650. REST_NOCHANGINGWALLPAPER = 0x40000011,
  5651. REST_NODESKCOMP = 0x40000012,
  5652. REST_NOADDDESKCOMP = 0x40000013,
  5653. REST_NODELDESKCOMP = 0x40000014,
  5654. REST_NOCLOSEDESKCOMP = 0x40000015,
  5655. REST_NOCLOSE_DRAGDROPBAND = 0x40000016, // Disable Close and Drag & Drop on ALL Bands
  5656. REST_NOMOVINGBAND = 0x40000017, // Disable Moving ALL Bands
  5657. REST_NOEDITDESKCOMP = 0x40000018,
  5658. REST_NORESOLVESEARCH = 0x40000019,
  5659. REST_NORESOLVETRACK = 0x4000001A,
  5660. REST_FORCECOPYACLWITHFILE = 0X4000001B,
  5661. REST_NOLOGO3CHANNELNOTIFY = 0x4000001C,
  5662. REST_NOFORGETSOFTWAREUPDATE = 0x4000001D,
  5663. REST_NOSETACTIVEDESKTOP = 0x4000001E, // No Active desktop on Settings Menu
  5664. REST_NOUPDATEWINDOWS = 0x4000001F, // No Windows Update on Settings Menu
  5665. REST_NOCHANGESTARMENU = 0x40000020, // No Context menu or Drag and Drop on Start menu
  5666. REST_NOFOLDEROPTIONS = 0x40000021, // No Folder Options on Settings Menu
  5667. REST_HASFINDCOMPUTERS = 0x40000022, // Show Start/Search/Computers
  5668. REST_INTELLIMENUS = 0x40000023,
  5669. REST_RUNDLGMEMCHECKBOX = 0x40000024,
  5670. REST_ARP_ShowPostSetup = 0x40000025, // ARP: Show Post-Setup page
  5671. REST_NOCSC = 0x40000026, // Disable the ClientSide caching on SM
  5672. REST_NOCONTROLPANEL = 0x40000027, // Remove the Control Panel only from SM|Settings
  5673. REST_ENUMWORKGROUP = 0x40000028, // Enumerate workgroup in root of nethood
  5674. REST_ARP_NOARP = 0x40000029, // ARP: Don't Allow ARP to come up at all
  5675. REST_ARP_NOREMOVEPAGE = 0x4000002A, // ARP: Don't allow Remove page
  5676. REST_ARP_NOADDPAGE = 0x4000002B, // ARP: Don't allow Add page
  5677. REST_ARP_NOWINSETUPPAGE = 0x4000002C, // ARP: Don't allow opt components page
  5678. REST_GREYMSIADS = 0x4000002D, // SM: Allow the greying of Darwin Ads in SM
  5679. REST_NOCHANGEMAPPEDDRIVELABEL = 0x4000002E, // Don't enable the UI which allows users to rename mapped drive labels
  5680. REST_NOCHANGEMAPPEDDRIVECOMMENT = 0x4000002F, // Don't enable the UI which allows users to change mapped drive comments
  5681. REST_MaxRecentDocs = 0x40000030,
  5682. REST_NONETWORKCONNECTIONS = 0x40000031, // No Start Menu | Settings |Network Connections
  5683. REST_FORCESTARTMENULOGOFF = 0x40000032, // Force logoff on the Start Menu
  5684. REST_NOWEBVIEW = 0x40000033, // Disable Web View
  5685. REST_NOCUSTOMIZETHISFOLDER = 0x40000034, // Disable Customize This Folder
  5686. REST_NOENCRYPTION = 0x40000035, // Don't allow file encryption
  5687. // Do NOT use me 0x40000036,
  5688. REST_DONTSHOWSUPERHIDDEN = 0x40000037, // don't show super hidden files
  5689. REST_NOSHELLSEARCHBUTTON = 0x40000038,
  5690. REST_NOHARDWARETAB = 0x40000039, // No Hardware tab on Drives or in control panel
  5691. REST_NORUNASINSTALLPROMPT = 0x4000003A, // Don't bring up "Run As" prompt for install programs
  5692. REST_PROMPTRUNASINSTALLNETPATH = 0x4000003B, // Force the "Run As" prompt for install programs on unc/network shares
  5693. REST_NOMANAGEMYCOMPUTERVERB = 0x4000003C, // No Manage verb on My Computer
  5694. REST_NORECENTDOCSNETHOOD = 0x4000003D, // dont add the recent docs shares to nethood
  5695. REST_DISALLOWRUN = 0x4000003E, // don't allow certain apps to be run
  5696. REST_NOWELCOMESCREEN = 0x4000003F, // don't allow the welcome screen to be displayed.
  5697. REST_RESTRICTCPL = 0x40000040, // only allow certain cpls to be run
  5698. REST_DISALLOWCPL = 0x40000041, // don't allow certain cpls to be run
  5699. REST_NOSMBALLOONTIP = 0x40000042, // No Start Menu Balloon Tip
  5700. REST_NOSMHELP = 0x40000043, // No Help on the Start Menu
  5701. REST_NOWINKEYS = 0x40000044, // No Windows-X Hot keys
  5702. REST_NOENCRYPTONMOVE = 0x40000045, // Don't automatically try to encrypt files that are moved to encryped directories
  5703. REST_NOLOCALMACHINERUN = 0x40000046, // ignore HKLM\sw\ms\win\cv\Run and all of it's sub keys
  5704. REST_NOCURRENTUSERRUN = 0x40000047, // ignore HKCU\sw\ms\win\cv\Run and all of it's sub keys
  5705. REST_NOLOCALMACHINERUNONCE = 0x40000048, // ignore HKLM\sw\ms\win\cv\RunOnce and all of it's sub keys
  5706. REST_NOCURRENTUSERRUNONCE = 0x40000049, // ignore HKCU\sw\ms\win\cv\RunOnce and all of it's sub keys
  5707. REST_FORCEACTIVEDESKTOPON = 0x4000004A, // Force ActiveDesktop to be turned ON all the time.
  5708. REST_NOCOMPUTERSNEARME = 0x4000004B, // removes the "Computers near me" link
  5709. REST_NOVIEWONDRIVE = 0x4000004C, // disallows CreateViewObject() on specified drives (CFSFolder only)
  5710. REST_NONETCRAWL = 0x4000004D, // disables the crawling of the WNet namespace.
  5711. REST_NOSHAREDDOCUMENTS = 0x4000004E, // don't auto share the Shared Documents/create link
  5712. REST_NOSMMYDOCS = 0x4000004F, // Don't show the My Documents item on the Start Menu.
  5713. REST_NOSMMYPICS = 0x40000050, // Don't show the My Pictures item on the Start Menu
  5714. REST_ALLOWBITBUCKDRIVES = 0x40000051, // Bit mask indicating which which drives have bit bucket support
  5715. REST_NONLEGACYSHELLMODE = 0x40000052, // new consumer shell modes
  5716. REST_NOCONTROLPANELBARRICADE = 0x40000053, // The webview barricade in Control Panel
  5717. REST_NOSTARTPAGE = 0x40000054, // Whistler Start Page on desktop.
  5718. REST_NOAUTOTRAYNOTIFY = 0x40000055, // Whistler auto-tray notify feature
  5719. REST_NOTASKGROUPING = 0x40000056, // Whistler taskbar button grouping feature
  5720. REST_NOCDBURNING = 0x40000057, // whistler cd burning feature
  5721. REST_MYCOMPNOPROP = 0x40000058, // disables Properties on My Computer's context menu
  5722. REST_MYDOCSNOPROP = 0x40000059, // disables Properties on My Documents' context menu
  5723. REST_NOSTARTPANEL = 0x4000005A, // Windows start panel (New start menu) for Whistler.
  5724. REST_NODISPLAYAPPEARANCEPAGE = 0x4000005B, // disable Themes and Appearance tabs in the Display Control Panel.
  5725. REST_NOTHEMESTAB = 0x4000005C, // disable the Themes tab in the Display Control Panel.
  5726. REST_NOVISUALSTYLECHOICE = 0x4000005D, // disable the visual style drop down in the Appearance tab of the Display Control Panel.
  5727. REST_NOSIZECHOICE = 0x4000005E, // disable the size drop down in the Appearance tab of the Display Control Panel.
  5728. REST_NOCOLORCHOICE = 0x4000005F, // disable the color drop down in the Appearance tab of the Display Control Panel.
  5729. REST_SETVISUALSTYLE = 0x40000060, // Load the specified file as the visual style.
  5730. REST_STARTRUNNOHOMEPATH = 0x40000061, // dont use the %HOMEPATH% env var for the Start-Run dialog
  5731. REST_NOUSERNAMEINSTARTPANEL = 0x40000062, // don't show the username is the startpanel.
  5732. REST_NOMYCOMPUTERICON = 0x40000063, // don't show my computer anywhere, hide its contents
  5733. REST_NOSMNETWORKPLACES = 0x40000064, // don't show network places in startpanel.
  5734. REST_NOSMPINNEDLIST = 0x40000065, // don't show the pinned list in startpanel.
  5735. REST_NOSMMYMUSIC = 0x40000066, // don't show MyMusic folder in startpanel
  5736. REST_NOSMEJECTPC = 0x40000067, // don't show "Undoc PC" command in startmenu
  5737. REST_NOSMMOREPROGRAMS = 0x40000068, // don't show "More Programs" button in StartPanel.
  5738. REST_NOSMMFUPROGRAMS = 0x40000069, // don't show the MFU programs list in StartPanel.
  5739. REST_NOTRAYITEMSDISPLAY = 0x4000006A, // disables the display of the system tray
  5740. REST_NOTOOLBARSONTASKBAR = 0x4000006B, // disables toolbar display on the taskbar
  5741. ;begin_internal
  5742. //--- UNUSED -- USE THIS SPACE --- 0x4000006C to 0x4000006E
  5743. ;end_internal
  5744. REST_NOSMCONFIGUREPROGRAMS = 0x4000006F, // No Configure Programs on Settings Menu
  5745. REST_HIDECLOCK = 0x40000070, // don't show the clock
  5746. REST_NOLOWDISKSPACECHECKS = 0x40000071, // disable the low disk space checking
  5747. REST_NOENTIRENETWORK = 0x40000072, // removes the "Entire Network" link (i.e. from "My Network Places")
  5748. REST_NODESKTOPCLEANUP = 0x40000073, // disable the desktop cleanup wizard
  5749. REST_BITBUCKNUKEONDELETE = 0x40000074, // disables recycling of files
  5750. REST_BITBUCKCONFIRMDELETE = 0x40000075, // always show the delete confirmation dialog when deleting files
  5751. REST_BITBUCKNOPROP = 0x40000076, // disables Properties on Recycle Bin's context menu
  5752. REST_NODISPBACKGROUND = 0x40000077, // disables the Desktop tab in the Display CPL
  5753. REST_NODISPSCREENSAVEPG = 0x40000078, // disables the Screen Saver tab in the Display CPL
  5754. REST_NODISPSETTINGSPG = 0x40000079, // disables the Settings tab in the Display CPL
  5755. REST_NODISPSCREENSAVEPREVIEW = 0x4000007A, // disables the screen saver on the Screen Saver tab in the Display CPL
  5756. REST_NODISPLAYCPL = 0x4000007B, // disables the Display CPL
  5757. REST_HIDERUNASVERB = 0x4000007C, // hides the "Run As..." context menu item
  5758. REST_NOTHUMBNAILCACHE = 0x4000007D, // disables use of the thumbnail cache
  5759. REST_NOSTRCMPLOGICAL = 0x4000007E, // dont use StrCmpLogical() instead use default CompareString()
  5760. REST_NOPUBLISHWIZARD = 0x4000007F, // disables publishing wizard (WPW)
  5761. REST_NOONLINEPRINTSWIZARD = 0x40000080, // disables online prints wizard (OPW)
  5762. REST_NOWEBSERVICES = 0x40000081, // disables the web specified services for both OPW and WPW
  5763. REST_ALLOWUNHASHEDWEBVIEW = 0x40000082, // allow the user to be promted to accept web view templates that don't already have an md5 hash in the registry
  5764. REST_ALLOWLEGACYWEBVIEW = 0x40000083, // allow legacy webview template to be shown.
  5765. REST_REVERTWEBVIEWSECURITY = 0x40000084, // disable added webview security measures (revert to w2k functionality).
  5766. REST_INHERITCONSOLEHANDLES = 0x40000086, // ShellExec() will check for the current process and target process being console processes to inherit handles
  5767. REST_NODISCONNECT = 0x41000001, // No Disconnect option in Start menu
  5768. REST_NOSECURITY = 0x41000002, // No Security option in start menu
  5769. REST_NOFILEASSOCIATE = 0x41000003, // Do not allow user to change file association
  5770. } RESTRICTIONS;
  5771. ;begin_internal
  5772. // Browser restrictions (parameter for SHRestricted2)
  5773. //
  5774. // The browser restrictions are divided into two ranges, "explorer restrictions" and
  5775. // "infodelivery restrictions". Explorer restrictions are kept under "Software\\Microsoft\\
  5776. // Windows\\CurrentVersion\\Policies\\Explorer," while infodelivery restrictions are kept
  5777. // under "Software\\Policies\\Microsoft\\Internet Explorer\\Infodelivery\\Restrictions."
  5778. //
  5779. // **NOTE**: SHRestricted2 assumes each range is continuous.
  5780. typedef enum {
  5781. // explorer restrictions
  5782. REST_BROWSER_NONE = 0x00000000, // REST_EXPLORER_FIRST
  5783. REST_NOTOOLBARCUSTOMIZE = 0x00000001,
  5784. REST_NOBANDCUSTOMIZE = 0x00000002,
  5785. REST_SMALLICONS = 0x00000003,
  5786. REST_LOCKICONSIZE = 0x00000004,
  5787. REST_SPECIFYDEFAULTBUTTONS = 0x00000005,
  5788. REST_BTN_BACK = 0x00000006,
  5789. REST_BTN_FORWARD = 0x00000007,
  5790. REST_BTN_STOPDOWNLOAD = 0x00000008,
  5791. REST_BTN_REFRESH = 0x00000009,
  5792. REST_BTN_HOME = 0x0000000A,
  5793. REST_BTN_SEARCH = 0x0000000B,
  5794. REST_BTN_HISTORY = 0x0000000C,
  5795. REST_BTN_FAVORITES = 0x0000000D,
  5796. REST_BTN_ALLFOLDERS = 0x0000000E,
  5797. REST_BTN_THEATER = 0x0000000F,
  5798. REST_BTN_TOOLS = 0x00000010,
  5799. REST_BTN_MAIL = 0x00000011,
  5800. REST_BTN_FONTS = 0x00000012,
  5801. REST_BTN_PRINT = 0x00000013,
  5802. REST_BTN_EDIT = 0x00000014,
  5803. REST_BTN_DISCUSSIONS = 0x00000015,
  5804. REST_BTN_CUT = 0x00000016,
  5805. REST_BTN_COPY = 0x00000017,
  5806. REST_BTN_PASTE = 0x00000018,
  5807. REST_BTN_ENCODING = 0x00000019,
  5808. REST_NoUserAssist = 0x0000001A,
  5809. REST_NoWindowsUpdate = 0x0000001B,
  5810. REST_NoExpandedNewMenu = 0x0000001C,
  5811. REST_NOFILEURL = 0x0000001D,
  5812. REST_BTN_PRINTPREVIEW = 0X0000001E,
  5813. REST_BTN_MEDIABAR = 0x0000001F, // REST_EXPLORER_LAST
  5814. // infodelivery restrictions
  5815. REST_NoChannelUI = 0x50000001, // REST_INFO_FIRST
  5816. REST_NoAddingChannels = 0x50000002,
  5817. REST_NoEditingChannels = 0x50000003,
  5818. REST_NoRemovingChannels = 0x50000004,
  5819. REST_NoAddingSubscriptions = 0x50000005,
  5820. REST_NoEditingSubscriptions = 0x50000006,
  5821. REST_NoRemovingSubscriptions = 0x50000007,
  5822. REST_NoChannelLogging = 0x50000008,
  5823. REST_NoManualUpdates = 0x50000009,
  5824. REST_NoScheduledUpdates = 0x5000000A,
  5825. REST_NoUnattendedDialing = 0x5000000B,
  5826. REST_NoChannelContent = 0x5000000C,
  5827. REST_NoSubscriptionContent = 0x5000000D,
  5828. REST_NoEditingScheduleGroups = 0x5000000E,
  5829. REST_MaxChannelSize = 0x5000000F,
  5830. REST_MaxSubscriptionSize = 0x50000010,
  5831. REST_MaxChannelCount = 0x50000011,
  5832. REST_MaxSubscriptionCount = 0x50000012,
  5833. REST_MinUpdateInterval = 0x50000013,
  5834. REST_UpdateExcludeBegin = 0x50000014,
  5835. REST_UpdateExcludeEnd = 0x50000015,
  5836. REST_UpdateInNewProcess = 0x50000016,
  5837. REST_MaxWebcrawlLevels = 0x50000017,
  5838. REST_MaxChannelLevels = 0x50000018,
  5839. REST_NoSubscriptionPasswords = 0x50000019,
  5840. REST_NoBrowserSaveWebComplete = 0x5000001A,
  5841. REST_NoSearchCustomization = 0x5000001B,
  5842. REST_NoSplash = 0x5000001C, // REST_INFO_LAST
  5843. // restrictions ported from SP2
  5844. REST_NoFileOpen = 0x60000001, // REST_BROWSER_FIRST
  5845. REST_NoFileNew = 0x60000002,
  5846. REST_NoBrowserSaveAs = 0x60000003,
  5847. REST_NoBrowserOptions = 0x60000004,
  5848. REST_NoFavorites = 0x60000005,
  5849. REST_NoSelectDownloadDir = 0x60000006,
  5850. REST_NoBrowserContextMenu = 0x60000007,
  5851. REST_NoBrowserClose = 0x60000008,
  5852. REST_NoOpeninNewWnd = 0x60000009,
  5853. REST_NoTheaterMode = 0x6000000A,
  5854. REST_NoFindFiles = 0x6000000B,
  5855. REST_NoViewSource = 0x6000000C,
  5856. REST_GoMenu = 0x6000000D,
  5857. REST_NoToolbarOptions = 0x6000000E,
  5858. REST_NoHelpItem_TipOfTheDay = 0x6000000F,
  5859. REST_NoHelpItem_NetscapeHelp = 0x60000010,
  5860. REST_NoHelpItem_Tutorial = 0x60000011,
  5861. REST_NoHelpItem_SendFeedback = 0x60000012,
  5862. REST_AlwaysPromptWhenDownload = 0x60000013,
  5863. REST_NoNavButtons = 0x60000014,
  5864. REST_NoHelpMenu = 0x60000015,
  5865. REST_NoBrowserBars = 0x60000016,
  5866. REST_NoToolBar = 0x60000017,
  5867. REST_NoAddressBar = 0x60000018,
  5868. REST_NoLinksBar = 0x60000019,
  5869. REST_NoPrinting = 0x60000020,
  5870. REST_No_LaunchMediaBar = 0x60000021,
  5871. REST_No_MediaBarOnlineContent = 0x60000022, // REST_BROWSER_LAST
  5872. } BROWSER_RESTRICTIONS;
  5873. #define REST_EXPLORER_FIRST REST_BROWSER_NONE
  5874. #define REST_EXPLORER_LAST REST_BTN_MEDIABAR
  5875. #define REST_INFO_FIRST REST_NoChannelUI
  5876. #define REST_INFO_LAST REST_NoSplash
  5877. #define REST_BROWSER_FIRST REST_NoFileOpen
  5878. #define REST_BROWSER_LAST REST_No_MediaBarOnlineContent
  5879. // codes for REST_BTN policies
  5880. #define RESTOPT_BTN_STATE_DEFAULT 0 // must be zero, else break browseui\itbar.cpp assumption
  5881. #define RESTOPT_BTN_STATE_VISIBLE 1
  5882. #define RESTOPT_BTN_STATE_HIDDEN 2
  5883. // REST_INTELLIMENUS
  5884. #define RESTOPT_INTELLIMENUS_USER 0
  5885. #define RESTOPT_INTELLIMENUS_DISABLED 1 // Match Restriction assumption: 1 == Off
  5886. #define RESTOPT_INTELLIMENUS_ENABLED 2
  5887. // FTP Exports
  5888. STDAPI IsIEDefautlFTPClient(void);
  5889. STDAPI MakeIEDefautlFTPClient(void);
  5890. STDAPI RestoreFTPClient(void);
  5891. SHSTDAPI_(void) SHSettingsChanged(WPARAM wParam, LPARAM lParam);
  5892. SHSTDAPI_(BOOL) SHIsBadInterfacePtr(LPCVOID pv, UINT cbVtbl);
  5893. // DOC'ed for DOJ Compliance
  5894. ;end_internal
  5895. SHSTDAPI_(IStream *) OpenRegStream(HKEY hkey, LPCWSTR pszSubkey, LPCWSTR pszValue, DWORD grfMode);
  5896. ;begin_internal
  5897. SHSTDAPI_(void) SHHandleDiskFull(HWND hwnd, int idDrive);
  5898. // DOC'ed for DOJ compliance
  5899. ;end_internal
  5900. SHSTDAPI_(BOOL) SHFindFiles(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile);
  5901. ;begin_internal
  5902. SHSTDAPI_(BOOL) SHFindComputer(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile);
  5903. // DOC'ed for DOJ Compliance
  5904. ;end_internal
  5905. SHSTDAPI_(void) PathGetShortPath(LPWSTR pszLongPath);
  5906. SHSTDAPI_(BOOL) PathYetAnotherMakeUniqueName(LPWSTR pszUniqueName, LPCWSTR pszPath, LPCWSTR pszShort, LPCWSTR pszFileSpec);
  5907. ;begin_internal
  5908. SHSTDAPI_(BOOL) Win32CreateDirectory(LPCTSTR pszPath, SECURITY_ATTRIBUTES *psa);
  5909. SHSTDAPI_(BOOL) Win32RemoveDirectory(LPCTSTR pszPath);
  5910. // DOC'ed for DOJ Compliance
  5911. ;end_internal
  5912. SHSTDAPI_(BOOL) Win32DeleteFile(LPCWSTR pszPath);
  5913. ;begin_internal
  5914. SHSTDAPI_(void) SHUpdateRecycleBinIcon();
  5915. // DOC'ed for DOJ Compliance
  5916. ;end_internal
  5917. //
  5918. // Path processing function
  5919. //
  5920. #define PPCF_ADDQUOTES 0x00000001 // return a quoted name if required
  5921. #define PPCF_ADDARGUMENTS 0x00000003 // appends arguments (and wraps in quotes if required)
  5922. #define PPCF_NODIRECTORIES 0x00000010 // don't match to directories
  5923. #define PPCF_FORCEQUALIFY 0x00000040 // qualify even non-relative names
  5924. #define PPCF_LONGESTPOSSIBLE 0x00000080 // always find the longest possible name
  5925. SHSTDAPI_(LONG) PathProcessCommand(LPCWSTR lpSrc, LPWSTR lpDest, int iMax, DWORD dwFlags);
  5926. ;begin_internal
  5927. SHSTDAPI_(LPITEMIDLIST) SHLogILFromFSIL(LPCITEMIDLIST pidlFS);
  5928. SHSTDAPI_(BOOL) StrRetToStrN(LPTSTR szOut, UINT uszOut, STRRET *pStrRet, LPCITEMIDLIST pidl);
  5929. SHSTDAPI_(DWORD) SHWaitForFileToOpen(LPCITEMIDLIST pidl, UINT uOptions, DWORD dwtimeout);
  5930. SHSTDAPI_(void) SetAppStartingCursor(HWND hwnd, BOOL fSet);
  5931. // DOC'ed for DOJ compliance
  5932. ;end_internal
  5933. SHSTDAPI_(DWORD) SHRestricted(RESTRICTIONS rest);
  5934. ;begin_internal
  5935. SHSTDAPI_(void *) SHGetHandlerEntry(LPCTSTR szHandler, LPCSTR szProcName, HINSTANCE *lpModule);
  5936. // This is sent to a browser windows letting them know that we have
  5937. // opened a folder, i.e. the folder open operation is done.
  5938. // Call RegisterWindowMessage to get the ID
  5939. #define SH_FILEOPENED TEXT("ShellFileOpened")
  5940. // DOC'ed for DOJ compliance
  5941. ;end_internal
  5942. SHSTDAPI_(BOOL) SignalFileOpen(LPCITEMIDLIST pidl);
  5943. SHSTDAPI_(LPITEMIDLIST) SHSimpleIDListFromPath(LPCWSTR pszPath);
  5944. ;begin_internal
  5945. SHSTDAPI SHCreatePropertyBag(REFIID riid, void **ppv);
  5946. SHSTDAPI_(DWORD) SHNetConnectionDialog(HWND hwnd, LPTSTR pszRemoteName, DWORD dwType);
  5947. // DOC'ed for DOJ Compliance
  5948. ;end_internal
  5949. SHSTDAPI SHLoadOLE(LPARAM lParam);
  5950. SHSTDAPI SHStartNetConnectionDialog%(HWND hwnd, LPCTSTR% pszRemoteName, DWORD dwType);
  5951. SHSTDAPI SHDefExtractIcon%(LPCTSTR% pszIconFile, int iIndex, UINT uFlags,
  5952. HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
  5953. ;begin_internal
  5954. SHSTDAPI_(int) SHLookupIconIndex%(LPCTSTR% pszFile, int iIconIndex, UINT uFlags);
  5955. SHSTDAPI_(UINT) SHExtractIcons%(LPCTSTR% pszFileName, int nIconIndex, int cxIcon, int cyIcon,
  5956. HICON *phicon, UINT *piconid, UINT nIcons, UINT flags);
  5957. SHSTDAPI SHGetAssociations(LPCITEMIDLIST pidl, void **ppvQueryAssociations);
  5958. #define SHLookupIconIndexAORD 7
  5959. #define SHLookupIconIndexWORD 8
  5960. #ifdef UNICODE
  5961. #define SHLookupIconIndexORD SHLookupIconIndexWORD
  5962. #else
  5963. #define SHDefExtractIcon SHDefExtractIconA
  5964. #endif
  5965. // OpenAsInfo flags
  5966. #define OAIF_ALLOW_REGISTRATION 0x00000001 // enable the "always use this file" checkbox (NOTE if you dont pass this, it will be disabled)
  5967. #define OAIF_REGISTER_EXT 0x00000002 // do the registration after the user hits "ok"
  5968. #define OAIF_EXEC 0x00000004 // execute file after registering
  5969. #define OAIF_FORCE_REGISTRATION 0x00000008 // force the "always use this file" checkbox to be checked (normally, you wont use the OAIF_ALLOW_REGISTRATION wen you pass this)
  5970. #define OAIF_ALL (OAIF_ALLOW_REGISTRATION | OAIF_REGISTER_EXT | OAIF_EXEC | OAIF_FORCE_REGISTRATION) // ;internal
  5971. #include <pshpack8.h>
  5972. typedef struct _openasinfo
  5973. {
  5974. LPCTSTR pcszFile; // [in] file name
  5975. LPCTSTR pcszClass; // [in] file class description. NULL means
  5976. // use pcszFile's extension
  5977. DWORD dwInFlags; // [in] input flags from OAIF_*
  5978. TCHAR szApp[MAX_PATH]; // [out] application selected
  5979. } OPENASINFO, * POPENASINFO;
  5980. #include <poppack.h> /* Return to byte packing */
  5981. SHSTDAPI OpenAsDialog(HWND hwnd, POPENASINFO poainfo);
  5982. //
  5983. // Interface pointer validation
  5984. //
  5985. #define IsBadInterfacePtr(pitf, ITF) SHIsBadInterfacePtr(pitf, sizeof(ITF##Vtbl))
  5986. //===========================================================================
  5987. // Another block of private API
  5988. //===========================================================================
  5989. // indexes into the shell image lists (Shell_GetImageList) for default images
  5990. // If you add to this list, you also need to update II_LASTSYSICON!
  5991. #define II_DOCNOASSOC 0 // document (blank page) (not associated)
  5992. #define II_DOCUMENT 1 // document (with stuff on the page)
  5993. #define II_APPLICATION 2 // application (exe, com, bat)
  5994. #define II_FOLDER 3 // folder (plain)
  5995. #define II_FOLDEROPEN 4 // folder (open)
  5996. #define II_DRIVE525 5
  5997. #define II_DRIVE35 6
  5998. #define II_DRIVEREMOVE 7
  5999. #define II_DRIVEFIXED 8
  6000. #define II_DRIVENET 9
  6001. #define II_DRIVENETDISABLED 10
  6002. #define II_DRIVECD 11
  6003. #define II_DRIVERAM 12
  6004. #define II_WORLD 13
  6005. #define II_NETWORK 14
  6006. #define II_SERVER 15
  6007. #define II_PRINTER 16
  6008. #define II_MYNETWORK 17
  6009. #define II_GROUP 18
  6010. // Startmenu images.
  6011. #define II_STPROGS 19
  6012. #define II_STDOCS 20
  6013. #define II_STSETNGS 21
  6014. #define II_STFIND 22
  6015. #define II_STHELP 23
  6016. #define II_STRUN 24
  6017. #define II_STSUSPEND 25
  6018. #define II_STEJECT 26
  6019. #define II_STSHUTD 27
  6020. #define II_SHARE 28
  6021. #define II_LINK 29
  6022. #define II_SLOWFILE 30
  6023. #define II_RECYCLER 31
  6024. #define II_RECYCLERFULL 32
  6025. #define II_RNA 33
  6026. #define II_DESKTOP 34
  6027. // More startmenu image.
  6028. #define II_STCPANEL 35
  6029. #define II_STSPROGS 36
  6030. #define II_STPRNTRS 37
  6031. #define II_STFONTS 38
  6032. #define II_STTASKBR 39
  6033. #define II_CDAUDIO 40
  6034. #define II_TREE 41
  6035. #define II_STCPROGS 42
  6036. #define II_STFAVORITES 43
  6037. #define II_STLOGOFF 44
  6038. #define II_STFLDRPROP 45
  6039. #define II_WINUPDATE 46
  6040. #define II_MU_STSECURITY 47
  6041. #define II_MU_STDISCONN 48
  6042. #ifdef WINNT // hydra specific id
  6043. #define II_LASTSYSICON II_MU_STDISCONN
  6044. #else
  6045. // Last system image list icon index - used by icon cache manager
  6046. #define II_LASTSYSICON II_WINUPDATE
  6047. #endif
  6048. // Overlay indexes
  6049. #define II_OVERLAYFIRST II_SHARE
  6050. #define II_OVERLAYLAST II_SLOWFILE
  6051. #define II_NDSCONTAINER 72
  6052. #define II_SERVERSHARE 73
  6053. SHSTDAPI_(BOOL) FileIconInit( BOOL fRestoreCache );
  6054. // DOC'ed for DOJ compliance
  6055. ;end_internal
  6056. SHSTDAPI_(BOOL) Shell_GetImageLists(HIMAGELIST *phiml, HIMAGELIST *phimlSmall);
  6057. ;begin_internal
  6058. SHSTDAPI_(void) Shell_SysColorChange(void);
  6059. // DOC'ed for DOJ compliance
  6060. ;end_internal
  6061. SHSTDAPI_(int) Shell_GetCachedImageIndex(LPCWSTR pszIconPath, int iIconIndex, UINT uIconFlags);
  6062. ;begin_internal
  6063. //
  6064. // OLE string
  6065. //
  6066. SHSTDAPI_(int) OleStrToStrN(LPTSTR, int, LPCOLESTR, int);
  6067. SHSTDAPI_(int) StrToOleStrN(LPOLESTR, int, LPCTSTR, int);
  6068. SHSTDAPI_(int) OleStrToStr(LPTSTR, LPCOLESTR);
  6069. SHSTDAPI_(int) StrToOleStr(LPOLESTR, LPCTSTR);
  6070. #define LIPF_ENABLE 0x00000001 // create the object (vs release the object)
  6071. #define LIPF_HOLDREF 0x00000002 // hold ref on object after creation (vs release immediately)
  6072. typedef struct
  6073. {
  6074. CLSID clsid;
  6075. DWORD dwFlags;
  6076. } LOADINPROCDATA, *PLOADINPROCDATA;
  6077. // Tray CopyData Messages
  6078. #define TCDM_APPBAR 0x00000000
  6079. #define TCDM_NOTIFY 0x00000001
  6080. #define TCDM_LOADINPROC 0x00000002
  6081. //
  6082. // Private QueryContextMenuFlag passed from Bands
  6083. //
  6084. #define CMF_BANDCMD 0x00020000 // Install Band Context menu commands
  6085. //
  6086. // Functions to help the cabinets sync to each other
  6087. // uOptions parameter to SHWaitForFileOpen
  6088. //
  6089. #define WFFO_WAITTIME 10000L
  6090. #define WFFO_ADD 0x0001
  6091. #define WFFO_REMOVE 0x0002
  6092. #define WFFO_WAIT 0x0004
  6093. #define WFFO_SIGNAL 0x0008
  6094. //
  6095. // NOTES: IShellService is used when we share a service component
  6096. // (which implements a certain interface) among multiple clients
  6097. // (such as IE 3.0 and Explorer). The client always CoCreateInstance
  6098. // it and call SetOwner(this). When the client is going away
  6099. // (typically when the window is closed), it calls SetOwner(NULL)
  6100. // to let the service object releases the reference to the owner
  6101. // object.
  6102. //
  6103. #undef INTERFACE
  6104. #define INTERFACE IShellService
  6105. DECLARE_INTERFACE_(IShellService, IUnknown)
  6106. {
  6107. // *** IUnknown methods ***
  6108. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6109. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6110. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6111. // *** IShellService specific methods ***
  6112. STDMETHOD(SetOwner)(THIS_ struct IUnknown* punkOwner) PURE;
  6113. };
  6114. //
  6115. // NOTES: IHistSFPrivate is used when manipulating a history IShellFolder object
  6116. // It includes methods for pointing the shell folder at the correct virtual
  6117. // directory. QIing for IHistSFPrivate also guarantees the pidl format can
  6118. // safely be delved into to access the INTERNET_CACHE_ENTRY_INFO structure
  6119. //
  6120. #undef INTERFACE
  6121. #define INTERFACE IHistSFPrivate
  6122. DECLARE_INTERFACE_(IHistSFPrivate, IUnknown)
  6123. {
  6124. // *** IUnknown methods ***
  6125. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6126. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6127. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6128. // *** IHistPrivate specific methods ***
  6129. STDMETHOD(SetCachePrefix)(THIS_ LPCWSTR pszCachePrefix) PURE;
  6130. STDMETHOD(SetDomain)(THIS_ LPCWSTR pszDomain) PURE;
  6131. STDMETHOD(WriteHistory)(THIS_ LPCWSTR pszPrefixedUrl, FILETIME ftExpires, FILETIME ftModified, LPITEMIDLIST * ppidlSelect) PURE;
  6132. STDMETHOD(ClearHistory) (THIS) PURE;
  6133. };
  6134. //
  6135. // NOTES: IShellFolderViewType lets a shell folder support different "views" on
  6136. // its contents (meaning different hierarchical layouts of its data) with
  6137. // the default "view" being the one the shell folder displays normally.
  6138. // This enumerator returns pidls that are special hidden folders at the
  6139. // top level of the shell folder (which are not otherwise enumerated).
  6140. #undef INTERFACE
  6141. #define INTERFACE IShellFolderViewType
  6142. DECLARE_INTERFACE_(IShellFolderViewType, IUnknown)
  6143. {
  6144. // *** IUnknown methods ***
  6145. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6146. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6147. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6148. // *** IShellFolderViewType Methods ***
  6149. // NOTE: "Views" are seen by the user as hidden folders off the
  6150. // root (represented by pidls). Whenever appropriate, the
  6151. // default view (coming off the root folder) is represented
  6152. // as the NULL *or* empty pidl.
  6153. // EnumViews:
  6154. // Return an enumerator which will give out one pidl for every extended view.
  6155. STDMETHOD(EnumViews)(THIS_ ULONG grfFlags, IEnumIDList **ppenum) PURE;
  6156. // GetDefaultViewName:
  6157. // Return the name of the default view. The names of the other views
  6158. // can be retrieved by calling GetDisplayNameOf.
  6159. STDMETHOD(GetDefaultViewName)(THIS_ DWORD uFlags, LPWSTR *ppwszName) PURE;
  6160. STDMETHOD(GetViewTypeProperties)(THIS_ LPCITEMIDLIST pidl, DWORD *pdwFlags) PURE;
  6161. // TranslateViewPidl:
  6162. // Attempt to take a pidl represented in one heirarchical representation of
  6163. // the shell folder, and find it in a different representation.
  6164. // pidl should be relative to the root folder.
  6165. // Remember to ILFree ppidlOut
  6166. STDMETHOD(TranslateViewPidl)(THIS_ LPCITEMIDLIST pidl, LPCITEMIDLIST pidlView, LPITEMIDLIST *ppidlOut) PURE;
  6167. };
  6168. #define SFVTFLAG_NOTIFY_CREATE 0x00000001
  6169. #define SFVTFLAG_NOTIFY_RESORT 0x00000002
  6170. //
  6171. // NOTES: IShellFolderSearchableCallback allows the searcher to provide
  6172. // callback routines that moniter the search process
  6173. //
  6174. #undef INTERFACE
  6175. #define INTERFACE IShellFolderSearchableCallback
  6176. DECLARE_INTERFACE_(IShellFolderSearchableCallback, IUnknown)
  6177. {
  6178. // *** IUnknown methods ***
  6179. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6180. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6181. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6182. // *** IShellFolderSearchableCallback Methods ***
  6183. // NOTE: Caller may pass NULL for pVar or pdwFlags as a legal value
  6184. STDMETHOD(RunBegin)(THIS_ DWORD dwReserved) PURE;
  6185. STDMETHOD(RunEnd)(THIS_ DWORD dwReserved) PURE;
  6186. };
  6187. //
  6188. // NOTES: IShellFolderSearchable allows a shell extension to provide a searchable
  6189. // namespace.
  6190. #undef INTERFACE
  6191. #define INTERFACE IShellFolderSearchable
  6192. DECLARE_INTERFACE_(IShellFolderSearchable, IUnknown)
  6193. {
  6194. // *** IUnknown methods ***
  6195. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6196. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6197. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6198. // *** IShellFolderSearchable methods ***
  6199. // FindString -
  6200. // The returned shell folder's enumerator will have any
  6201. // search hits for the given search string.
  6202. // As no flags are currently defined, we suggest you pass
  6203. // NULL as lpdword
  6204. // punkOnAsyncSearch will be QI'd for IShellFolderSearchableCallback
  6205. STDMETHOD(FindString)(THIS_ LPCWSTR pwszTarget, DWORD *pdwFlags,
  6206. IUnknown *punkOnAsyncSearch, LPITEMIDLIST *ppidlOut) PURE;
  6207. // CancelAsyncSearch -
  6208. // Begins the process of cancelling any pending
  6209. // asynchronous search from this pidl.
  6210. // When the search is actually cancelled, RunEnd will be called
  6211. // Returns: S_OK => cancelling, S_FALSE => not running
  6212. STDMETHOD(CancelAsyncSearch) (THIS_ LPCITEMIDLIST pidlSearch, DWORD *pdwFlags) PURE;
  6213. // InvalidateSearch -
  6214. // Makes this pidl no longer a valid portion of the shell folder
  6215. // also does some cleanup of any databases used in the search and
  6216. // will cause the eventual release of the IRunHook callback
  6217. // May cause async search to be cancelled
  6218. STDMETHOD(InvalidateSearch) (THIS_ LPCITEMIDLIST pidlSearch, DWORD *pdwFlags) PURE;
  6219. };
  6220. //
  6221. // NOTES: IBandSiteHelper is used to let explorer's BandSite implementation,
  6222. // which aggregates shdocvw's BandSite, provide callback hooks for shdocvw
  6223. // to call.
  6224. //
  6225. #undef INTERFACE
  6226. #define INTERFACE IBandSiteHelper
  6227. DECLARE_INTERFACE_(IBandSiteHelper, IUnknown)
  6228. {
  6229. // *** IUnknown methods ***
  6230. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6231. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6232. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6233. // *** IBandSiteHelper specific methods ***
  6234. STDMETHOD(LoadFromStreamBS)(THIS_ struct IStream* pstm, REFIID riid, void **ppv) PURE;
  6235. STDMETHOD(SaveToStreamBS)(THIS_ struct IUnknown* punk, struct IStream* pstm) PURE;
  6236. };
  6237. // This private interface is added such that some of the support features that is in
  6238. // SHDocvw's Internet explorer frame automation code, that is not part of publicly
  6239. // defined interfaces can be used in the Explorer code...
  6240. //
  6241. // Note: FindCIE4ConnectionPoint was a hack for IE4. New code should use
  6242. // shlwapi helper functions like IConnectionPoint_Invoke instead.
  6243. //
  6244. #ifdef __cplusplus
  6245. class CIE4ConnectionPoint;
  6246. #else
  6247. typedef struct CIE4ConnectionPoint CIE4ConnectionPoint;
  6248. #endif
  6249. #undef INTERFACE
  6250. #define INTERFACE IExpDispSupport
  6251. DECLARE_INTERFACE_(IExpDispSupport, IUnknown)
  6252. {
  6253. // *** IUnknown methods ***
  6254. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6255. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6256. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6257. // *** IExpDispSupport specific methods ***
  6258. STDMETHOD(FindCIE4ConnectionPoint)(THIS_ REFIID riid, CIE4ConnectionPoint **ppccp) PURE;
  6259. STDMETHOD(OnTranslateAccelerator)(THIS_ MSG *pMsg, DWORD grfModifiers) PURE;
  6260. STDMETHOD(OnInvoke)(THIS_ DISPID dispidMember, REFIID iid, LCID lcid, WORD wFlags, DISPPARAMS *pdispparams,
  6261. VARIANT *pVarResult, EXCEPINFO *pexcepinfo, UINT *puArgErr) PURE;
  6262. };
  6263. //
  6264. // This interface is related to the above. It contains functions
  6265. // that would only be implemented on the WebBrowserOC version if IExpDispSupport.
  6266. //
  6267. #undef INTERFACE
  6268. #define INTERFACE IExpDispSupportOC
  6269. DECLARE_INTERFACE_(IExpDispSupportOC, IUnknown)
  6270. {
  6271. // *** IUnknown methods ***
  6272. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6273. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6274. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6275. // *** IExpDispSupportOC specific methods ***
  6276. STDMETHOD(OnOnControlInfoChanged)(THIS) PURE;
  6277. STDMETHOD(GetDoVerbMSG)(THIS_ MSG *pMsg) PURE;
  6278. };
  6279. //===========================================================================
  6280. // IConnectionPointCB interface
  6281. #undef INTERFACE
  6282. #define INTERFACE IConnectionPointCB
  6283. DECLARE_INTERFACE_(IConnectionPointCB, IUnknown)
  6284. {
  6285. // *** IUnknown methods ***
  6286. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6287. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6288. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6289. // *** IConnectionPointCB Methods ***
  6290. STDMETHOD(OnAdvise) (THIS_ REFIID iid, DWORD cSinks, ULONG_PTR dwCookie) PURE;
  6291. STDMETHOD(OnUnadvise) (THIS_ REFIID iid, DWORD cSinks, ULONG_PTR dwCookie) PURE;
  6292. };
  6293. //===========================================================================
  6294. // IDelegateDropTargetCB interface
  6295. //
  6296. // This interface is used by CDelegateDropTarget implementation in shdocvw
  6297. // to generate an IDropTarget implementation that delegates to different
  6298. // IDropTarget implementations depending on the point currently over. The
  6299. // implementor of IDelegateDropTargetCB can handle feedback, scrolling,
  6300. // hit testing, and returning interfaces for ids returned from hit testing.
  6301. //
  6302. // GetWindows returns the hwnd to lock and the hwnd to scroll (not necesarily
  6303. // the same window, as you often want to lock the parent of the window
  6304. // you want to scroll)
  6305. //
  6306. // HitTest should return an id of the object over as well as
  6307. // uptate UI (highlights, etc). if ppt is NULL
  6308. // that means remove any UI as the drag is terminating.
  6309. // this should be able to handle hittesting on points not
  6310. // even inside hwndScroll.
  6311. //
  6312. // GetObject returns an interface for an id returned from HitTest
  6313. //
  6314. // OnDrop gives the CB a chance to take action on the drop.
  6315. // returning S_FALSE from this function prevents
  6316. // CDelegateDropTarget from calling pdt->Drop(...).
  6317. //
  6318. #undef INTERFACE
  6319. #define INTERFACE IDelegateDropTargetCB
  6320. DECLARE_INTERFACE_(IDelegateDropTargetCB, IUnknown)
  6321. {
  6322. // *** IUnknown methods ***
  6323. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6324. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6325. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6326. // *** IDelegateDropTargetCB Methods ***
  6327. STDMETHOD(GetWindows) (THIS_ HWND * phwndLock, HWND * phwndScroll) PURE;
  6328. STDMETHOD(HitTest) (THIS_ LPPOINT ppt, DWORD * pdwId) PURE;
  6329. STDMETHOD(GetObject) (THIS_ DWORD dwId, REFIID riid, void **ppv) PURE;
  6330. STDMETHOD(OnDrop) (THIS_ IDropTarget *pdt, IDataObject *pdtobj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) PURE;
  6331. };
  6332. #ifdef __COMMCTRL_DA_DEFINED__ // we need HDPAs for this interface
  6333. //
  6334. // IOrderList - for ordering info in favorites/channels
  6335. //
  6336. // Typical usage is: GetOrderList, AllocOrderItem, insert into correct
  6337. // position, SetOrderList, and then FreeOrderList.
  6338. //
  6339. typedef struct
  6340. {
  6341. LPITEMIDLIST pidl; // IDlist for this item
  6342. int nOrder; // Ordinal indicating user preference
  6343. DWORD lParam; // store custom order info.
  6344. } ORDERITEM, * PORDERITEM;
  6345. // Values for SortOrderList
  6346. #define OI_SORTBYNAME 0
  6347. #define OI_SORTBYORDINAL 1
  6348. #define OI_MERGEBYNAME 2
  6349. #undef INTERFACE
  6350. #define INTERFACE IOrderList
  6351. DECLARE_INTERFACE_(IOrderList, IUnknown)
  6352. {
  6353. // *** IUnknown methods ***
  6354. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6355. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6356. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6357. // *** IOrderList Methods ***
  6358. STDMETHOD(GetOrderList)(THIS_ HDPA * phdpa) PURE;
  6359. STDMETHOD(SetOrderList)(THIS_ HDPA hdpa, IShellFolder *psf) PURE;
  6360. STDMETHOD(FreeOrderList)(THIS_ HDPA hdpa) PURE;
  6361. STDMETHOD(SortOrderList)(THIS_ HDPA hdpa, DWORD dw) PURE;
  6362. STDMETHOD(AllocOrderItem)(THIS_ PORDERITEM * ppoi, LPCITEMIDLIST pidl) PURE;
  6363. STDMETHOD(FreeOrderItem)(THIS_ PORDERITEM poi) PURE;
  6364. };
  6365. #undef INTERFACE
  6366. #define INTERFACE IOrderList2
  6367. DECLARE_INTERFACE_(IOrderList2, IOrderList)
  6368. {
  6369. // *** IUnknown methods ***
  6370. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE;
  6371. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6372. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6373. // *** IOrderList Methods ***
  6374. STDMETHOD(GetOrderList)(THIS_ HDPA * phdpa) PURE; // WARNING (lamadio): This assumes Favorites Menu
  6375. STDMETHOD(SetOrderList)(THIS_ HDPA hdpa, IShellFolder *psf) PURE; // WARNING (lamadio): This assumes Favorites Menu
  6376. STDMETHOD(FreeOrderList)(THIS_ HDPA hdpa) PURE;
  6377. STDMETHOD(SortOrderList)(THIS_ HDPA hdpa, DWORD dw) PURE;
  6378. STDMETHOD(AllocOrderItem)(THIS_ PORDERITEM * ppoi, LPCITEMIDLIST pidl) PURE;
  6379. STDMETHOD(FreeOrderItem)(THIS_ PORDERITEM poi) PURE;
  6380. // *** IOrderList2
  6381. STDMETHOD(LoadFromStream)(THIS_ IStream* pstm, HDPA* phdpa, IShellFolder* psf) PURE;
  6382. STDMETHOD(SaveToStream)(THIS_ IStream* pstm, HDPA hdpa) PURE;
  6383. };
  6384. #endif
  6385. //===========================================================================
  6386. // IShellHTMLWindowSupport private COmWindow interface. This should never be exposed.
  6387. typedef struct IHTMLElement IHTMLElement;
  6388. #undef INTERFACE
  6389. #define INTERFACE IShellHTMLWindowSupport
  6390. DECLARE_INTERFACE_(IShellHTMLWindowSupport, IUnknown)
  6391. {
  6392. // *** IUnknown methods ***
  6393. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6394. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6395. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6396. STDMETHOD(ViewReleaseIntelliForms)(THIS) PURE;
  6397. STDMETHOD(ViewReleased)(THIS) PURE;
  6398. STDMETHOD(ViewActivated)(THIS) PURE;
  6399. STDMETHOD(ReadyStateChangedTo)(THIS_ long, IShellView* ) PURE;
  6400. STDMETHOD(CanNavigate)(THIS) PURE;
  6401. STDMETHOD(ActiveElementChanged)(THIS_ IHTMLElement * pHTMLElement) PURE;
  6402. };
  6403. //===========================================================================
  6404. // IShellHTMLWindowSupport2 private COmWindow interface. This should never be exposed.
  6405. #undef INTERFACE
  6406. #define INTERFACE IShellHTMLWindowSupport2
  6407. DECLARE_INTERFACE_(IShellHTMLWindowSupport2, IShellHTMLWindowSupport)
  6408. {
  6409. STDMETHOD(IsGalleryMeta)(THIS_ BOOL bFlag) PURE;
  6410. };
  6411. //===========================================================================
  6412. // IBandProxy private COmWindow interface. This should never be exposed.
  6413. #undef INTERFACE
  6414. #define INTERFACE IBandProxy
  6415. DECLARE_INTERFACE_(IBandProxy, IUnknown)
  6416. {
  6417. // *** IUnknown methods ***
  6418. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6419. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6420. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6421. // *** IBandProxy Methods ***
  6422. STDMETHOD(SetSite) (THIS_ IUnknown* punkSite) PURE;
  6423. STDMETHOD(CreateNewWindow) (THIS_ IUnknown** ppunk) PURE;
  6424. STDMETHOD(GetBrowserWindow) (THIS_ IUnknown** ppunk) PURE;
  6425. STDMETHOD(IsConnected) (THIS) PURE;
  6426. STDMETHOD(NavigateToPIDL) (THIS_ LPCITEMIDLIST pidl) PURE;
  6427. STDMETHOD(NavigateToURL) (THIS_ LPCWSTR wzUrl, VARIANT * Flags) PURE;
  6428. };
  6429. //===========================================================================
  6430. //
  6431. // Make it sure that we include ole2x.h and shlobj.h
  6432. //
  6433. #if defined(__IOleInPlaceSite_FWD_DEFINED__) && defined(FCIDM_SHVIEWFIRST)
  6434. #ifdef HLINK_H
  6435. #include <pshpack8.h>
  6436. typedef struct {
  6437. HWND _hwnd;
  6438. ITravelLog *_ptl;
  6439. IHlinkFrame *_phlf;
  6440. IWebBrowser2 *_pautoWB2; // use this to reference _pauto's IWebBrowser2 functions
  6441. IExpDispSupport *_pautoEDS; // use this to reference _pauto's IExpDispSupport functions
  6442. IShellService *_pautoSS; // use this to reference _pauto's IShellService functions
  6443. int _eSecureLockIcon;
  6444. DWORD _fCreatingViewWindow :1;
  6445. UINT _uActivateState; // this is the state we should use when we go active..
  6446. // this is here so that derived classes can set us for UI or non-UI active
  6447. // The following pidl is used in CBaseBrowser2::GetViewStateStream because
  6448. // at that time, neither _pidlCur nor _pidlPending are initialized.
  6449. LPCITEMIDLIST _pidlNewShellView;
  6450. IOleCommandTarget* _pctView;
  6451. LPITEMIDLIST _pidlCur;
  6452. IShellView *_psv;
  6453. IShellFolder *_psf; // IShellFolder for _psv (used in CVOCBrowser)
  6454. HWND _hwndView;
  6455. LPWSTR _pszTitleCur;
  6456. LPITEMIDLIST _pidlPending;
  6457. IShellView *_psvPending;
  6458. IShellFolder *_psfPending;
  6459. HWND _hwndViewPending;
  6460. LPWSTR _pszTitlePending;
  6461. BOOL _fIsViewMSHTML;
  6462. BOOL _fPrivacyImpacted;
  6463. } BASEBROWSERDATA, *LPBASEBROWSERDATA;
  6464. typedef const BASEBROWSERDATA *LPCBASEBROWSERDATA;
  6465. #include <poppack.h>
  6466. #else
  6467. // so (unref'ed) ifaces will compile (?)
  6468. typedef LPVOID BASEBROWSERDATA;
  6469. typedef LPCVOID *LPBASEBROWSERDATA;
  6470. typedef LPCVOID *LPCBASEBROWSERDATA;
  6471. #endif // hlink_h
  6472. typedef struct _travellog * PTRAVELLOG;
  6473. #undef INTERFACE
  6474. #define INTERFACE IBrowserService
  6475. DECLARE_INTERFACE_(IBrowserService, IUnknown)
  6476. {
  6477. // *** IUnknown methods ***
  6478. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6479. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6480. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6481. // *** IBrowserService specific methods ***
  6482. STDMETHOD(GetParentSite)(THIS_ struct IOleInPlaceSite** ppipsite) PURE;
  6483. STDMETHOD(SetTitle)(THIS_ IShellView* psv, LPCWSTR pszName) PURE;
  6484. STDMETHOD(GetTitle)(THIS_ IShellView* psv, LPWSTR pszName, DWORD cchName) PURE;
  6485. STDMETHOD(GetOleObject)(THIS_ struct IOleObject** ppobjv) PURE;
  6486. // think about this one.. I'm not sure we want to expose this -- Chee
  6487. // My impression is that we won't document this whole interface???
  6488. STDMETHOD(GetTravelLog)(THIS_ ITravelLog** pptl) PURE;
  6489. STDMETHOD(ShowControlWindow)(THIS_ UINT id, BOOL fShow) PURE;
  6490. STDMETHOD(IsControlWindowShown)(THIS_ UINT id, BOOL *pfShown) PURE;
  6491. STDMETHOD(IEGetDisplayName)(THIS_ LPCITEMIDLIST pidl, LPWSTR pwszName, UINT uFlags) PURE;
  6492. STDMETHOD(IEParseDisplayName)(THIS_ UINT uiCP, LPCWSTR pwszPath, LPITEMIDLIST * ppidlOut) PURE;
  6493. STDMETHOD(DisplayParseError)(THIS_ HRESULT hres, LPCWSTR pwszPath) PURE;
  6494. STDMETHOD(NavigateToPidl)(THIS_ LPCITEMIDLIST pidl, DWORD grfHLNF) PURE;
  6495. STDMETHOD (SetNavigateState)(THIS_ BNSTATE bnstate) PURE;
  6496. STDMETHOD (GetNavigateState) (THIS_ BNSTATE *pbnstate) PURE;
  6497. STDMETHOD (NotifyRedirect) (THIS_ struct IShellView* psv, LPCITEMIDLIST pidl, BOOL *pfDidBrowse) PURE;
  6498. STDMETHOD (UpdateWindowList) (THIS) PURE;
  6499. STDMETHOD (UpdateBackForwardState) (THIS) PURE;
  6500. STDMETHOD(SetFlags)(THIS_ DWORD dwFlags, DWORD dwFlagMask) PURE;
  6501. STDMETHOD(GetFlags)(THIS_ DWORD *pdwFlags) PURE;
  6502. // Tells if it can navigate now or not.
  6503. STDMETHOD (CanNavigateNow) (THIS) PURE;
  6504. STDMETHOD (GetPidl) (THIS_ LPITEMIDLIST *ppidl) PURE;
  6505. STDMETHOD (SetReferrer) (THIS_ LPITEMIDLIST pidl) PURE;
  6506. STDMETHOD_(DWORD, GetBrowserIndex)(THIS) PURE;
  6507. STDMETHOD (GetBrowserByIndex)(THIS_ DWORD dwID, IUnknown **ppunk) PURE;
  6508. STDMETHOD (GetHistoryObject)(THIS_ IOleObject **ppole, IStream **pstm, IBindCtx **ppbc) PURE;
  6509. STDMETHOD (SetHistoryObject)(THIS_ IOleObject *pole, BOOL fIsLocalAnchor) PURE;
  6510. STDMETHOD (CacheOLEServer)(THIS_ IOleObject *pole) PURE;
  6511. STDMETHOD (GetSetCodePage)(THIS_ VARIANT* pvarIn, VARIANT* pvarOut) PURE;
  6512. STDMETHOD (OnHttpEquiv)(THIS_ IShellView* psv, BOOL fDone, VARIANT* pvarargIn, VARIANT* pvarargOut) PURE;
  6513. STDMETHOD (GetPalette)( THIS_ HPALETTE * hpal ) PURE;
  6514. STDMETHOD (RegisterWindow)(THIS_ BOOL fUnregister, int swc) PURE;
  6515. // Warning! Do not add any new methods to this interface
  6516. // because IE4 shell32.dll uses it, so changing the interface
  6517. // breaks IE4 interop.
  6518. };
  6519. #define BSF_REGISTERASDROPTARGET 0x00000001
  6520. #define BSF_THEATERMODE 0x00000002
  6521. #define BSF_NOLOCALFILEWARNING 0x00000010
  6522. #define BSF_UISETBYAUTOMATION 0x00000100
  6523. #define BSF_RESIZABLE 0x00000200
  6524. #define BSF_CANMAXIMIZE 0x00000400
  6525. #define BSF_TOPBROWSER 0x00000800
  6526. #define BSF_NAVNOHISTORY 0x00001000
  6527. #define BSF_HTMLNAVCANCELED 0x00002000
  6528. #define BSF_DONTSHOWNAVCANCELPAGE 0x00004000
  6529. #define BSF_SETNAVIGATABLECODEPAGE 0x00008000
  6530. #define BSF_DELEGATEDNAVIGATION 0x00010000
  6531. #define TRAVELLOG_LOCALANCHOR 0x00000001
  6532. #define TRAVELLOG_FORCEUPDATE 0x00000002
  6533. #include <pshpack8.h>
  6534. typedef struct SToolbarItem {
  6535. IDockingWindow * ptbar;
  6536. BORDERWIDTHS rcBorderTool;
  6537. LPWSTR pwszItem;
  6538. BOOL fShow;
  6539. HMONITOR hMon;
  6540. } TOOLBARITEM, *LPTOOLBARITEM;
  6541. #define ITB_VIEW ((UINT)-1) // view
  6542. #include <poppack.h> /* Assume byte packing throughout */
  6543. struct tagFolderSetData;
  6544. // TEMPORARY. this is so that we don't have to keep writing dummy subs in basesb as we're
  6545. // building basesb2
  6546. DECLARE_INTERFACE_(IBrowserService2, IBrowserService)
  6547. {
  6548. // *** IUnknown methods ***
  6549. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6550. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6551. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6552. // *** IBrowserService specific methods ***
  6553. // TODO: break into 3 sections (outer, inner, and both/inherit)
  6554. STDMETHOD(GetParentSite)(THIS_ struct IOleInPlaceSite** ppipsite) PURE;
  6555. STDMETHOD(SetTitle)(THIS_ IShellView* psv, LPCWSTR pszName) PURE;
  6556. STDMETHOD(GetTitle)(THIS_ IShellView* psv, LPWSTR pszName, DWORD cchName) PURE;
  6557. STDMETHOD(GetOleObject)(THIS_ struct IOleObject** ppobjv) PURE;
  6558. // think about this one.. I'm not sure we want to expose this -- Chee
  6559. // My impression is that we won't document this whole interface???
  6560. STDMETHOD(GetTravelLog)(THIS_ ITravelLog** pptl) PURE;
  6561. STDMETHOD(ShowControlWindow)(THIS_ UINT id, BOOL fShow) PURE;
  6562. STDMETHOD(IsControlWindowShown)(THIS_ UINT id, BOOL *pfShown) PURE;
  6563. STDMETHOD(IEGetDisplayName)(THIS_ LPCITEMIDLIST pidl, LPWSTR pwszName, UINT uFlags) PURE;
  6564. STDMETHOD(IEParseDisplayName)(THIS_ UINT uiCP, LPCWSTR pwszPath, LPITEMIDLIST * ppidlOut) PURE;
  6565. STDMETHOD(DisplayParseError)(THIS_ HRESULT hres, LPCWSTR pwszPath) PURE;
  6566. STDMETHOD(NavigateToPidl)(THIS_ LPCITEMIDLIST pidl, DWORD grfHLNF) PURE;
  6567. STDMETHOD (SetNavigateState)(THIS_ BNSTATE bnstate) PURE;
  6568. STDMETHOD (GetNavigateState) (THIS_ BNSTATE *pbnstate) PURE;
  6569. STDMETHOD (NotifyRedirect) (THIS_ struct IShellView* psv, LPCITEMIDLIST pidl, BOOL *pfDidBrowse) PURE;
  6570. STDMETHOD (UpdateWindowList) (THIS) PURE;
  6571. STDMETHOD (UpdateBackForwardState) (THIS) PURE;
  6572. STDMETHOD(SetFlags)(THIS_ DWORD dwFlags, DWORD dwFlagMask) PURE;
  6573. STDMETHOD(GetFlags)(THIS_ DWORD *pdwFlags) PURE;
  6574. // Tells if it can navigate now or not.
  6575. STDMETHOD (CanNavigateNow) (THIS) PURE;
  6576. STDMETHOD (GetPidl) (THIS_ LPITEMIDLIST *ppidl) PURE;
  6577. STDMETHOD (SetReferrer) (THIS_ LPITEMIDLIST pidl) PURE;
  6578. STDMETHOD_(DWORD, GetBrowserIndex)(THIS) PURE;
  6579. STDMETHOD (GetBrowserByIndex)(THIS_ DWORD dwID, IUnknown **ppunk) PURE;
  6580. STDMETHOD (GetHistoryObject)(THIS_ IOleObject **ppole, IStream **pstm, IBindCtx **ppbc) PURE;
  6581. STDMETHOD (SetHistoryObject)(THIS_ IOleObject *pole, BOOL fIsLocalAnchor) PURE;
  6582. STDMETHOD (CacheOLEServer)(THIS_ IOleObject *pole) PURE;
  6583. STDMETHOD (GetSetCodePage)(THIS_ VARIANT* pvarIn, VARIANT* pvarOut) PURE;
  6584. STDMETHOD (OnHttpEquiv)(THIS_ IShellView* psv, BOOL fDone, VARIANT* pvarargIn, VARIANT* pvarargOut) PURE;
  6585. STDMETHOD (GetPalette)( THIS_ HPALETTE * hpal ) PURE;
  6586. STDMETHOD (RegisterWindow)(THIS_ BOOL fUnregister, int swc) PURE;
  6587. // Stuff added for shbrowse->shbrows2 split
  6588. // These remove "friend" functions and classes
  6589. //
  6590. STDMETHOD_(LRESULT, WndProcBS)(THIS_ HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  6591. STDMETHOD (SetAsDefFolderSettings)(THIS) PURE;
  6592. STDMETHOD (GetViewRect)(THIS_ RECT * prc) PURE;
  6593. STDMETHOD (OnSize)(THIS_ WPARAM wParam) PURE;
  6594. STDMETHOD (OnCreate)(THIS_ LPCREATESTRUCT pcs) PURE;
  6595. STDMETHOD_(LRESULT, OnCommand)(THIS_ WPARAM wParam, LPARAM lParam) PURE;
  6596. STDMETHOD (OnDestroy)(THIS ) PURE;
  6597. STDMETHOD_(LRESULT, OnNotify)(THIS_ NMHDR * pnm) PURE;
  6598. STDMETHOD (OnSetFocus)(THIS ) PURE;
  6599. STDMETHOD (OnFrameWindowActivateBS)(THIS_ BOOL fActive) PURE;
  6600. STDMETHOD (ReleaseShellView)(THIS ) PURE;
  6601. STDMETHOD (ActivatePendingView)(THIS ) PURE;
  6602. STDMETHOD (CreateViewWindow)(THIS_ IShellView* psvNew, IShellView* psvOld, LPRECT prcView, HWND* phwnd) PURE;
  6603. STDMETHOD (CreateBrowserPropSheetExt)(THIS_ REFIID riid, void **ppv) PURE;
  6604. // these could be base browser only interfaces
  6605. // they are not overridden by anyone, and perhaps only there for the aggregators to get info from the
  6606. // aggregatee. NOTE: where basesb calls these,
  6607. // it does NOT go through _pbsOuter
  6608. STDMETHOD (GetViewWindow)(THIS_ HWND * phwndView) PURE;
  6609. STDMETHOD (GetBaseBrowserData)(THIS_ LPCBASEBROWSERDATA * pbbd) PURE;
  6610. STDMETHOD_(LPBASEBROWSERDATA, PutBaseBrowserData)(THIS) PURE;
  6611. STDMETHOD (InitializeTravelLog)(THIS_ ITravelLog* ptl, DWORD dw) PURE;
  6612. STDMETHOD (SetTopBrowser)(THIS) PURE;
  6613. STDMETHOD (Offline)(THIS_ int iCmd) PURE;
  6614. STDMETHOD (AllowViewResize)(THIS_ BOOL f) PURE;
  6615. STDMETHOD (SetActivateState)(THIS_ UINT u) PURE;
  6616. STDMETHOD (UpdateSecureLockIcon)(THIS_ int eSecureLock) PURE;
  6617. STDMETHOD (InitializeDownloadManager)(THIS) PURE;
  6618. STDMETHOD (InitializeTransitionSite)(THIS) PURE;
  6619. STDMETHOD (_Initialize)(THIS_ HWND hwnd, IUnknown *pauto) PURE;
  6620. // BEGIN REVIEW: review names and need of each.
  6621. //
  6622. // this first set could be basebrowser only members. no one overrides
  6623. // NOTE: where basesb calls these, it does NOT go throug _pbsOuter
  6624. STDMETHOD (_CancelPendingNavigationAsync)(THIS) PURE;
  6625. STDMETHOD (_CancelPendingView)(THIS) PURE;
  6626. STDMETHOD (_MaySaveChanges)(THIS) PURE;
  6627. STDMETHOD (_PauseOrResumeView)(THIS_ BOOL fPaused) PURE;
  6628. STDMETHOD (_DisableModeless)(THIS) PURE;
  6629. // rethink these... are all of these necessary?
  6630. STDMETHOD (_NavigateToPidl)(THIS_ LPCITEMIDLIST pidl, DWORD grfHLNF, DWORD dwFlags)PURE;
  6631. STDMETHOD (_TryShell2Rename)(THIS_ IShellView* psv, LPCITEMIDLIST pidlNew)PURE;
  6632. STDMETHOD (_SwitchActivationNow)(THIS )PURE;
  6633. // this set is overridden and called thru _pbsOuter (and SUPER:_pbsInner)
  6634. STDMETHOD (_ExecChildren)(THIS_ IUnknown *punkBar, BOOL fBroadcast,
  6635. const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt,
  6636. VARIANTARG *pvarargIn, VARIANTARG *pvarargOut)PURE;
  6637. STDMETHOD (_SendChildren)(THIS_ HWND hwndBar, BOOL fBroadcast,
  6638. UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  6639. //END REVIEW:
  6640. // querying from the outer.
  6641. STDMETHOD (GetFolderSetData)(THIS_ struct tagFolderSetData* pfsd) PURE;
  6642. // Toolbar stuff is here temporarily. Eventually it will move out
  6643. // of basesb into commonsb, so I'm keeping the underscore "_"
  6644. // Except those noted below, none of these are overridden by
  6645. // outer guys, so no calls are made through _pbsOuter
  6646. STDMETHOD (_OnFocusChange)(THIS_ UINT itb) PURE;
  6647. STDMETHOD (v_ShowHideChildWindows)(THIS_ BOOL fChildOnly) PURE; // NOTE: overridden and called thru _pbsOuter
  6648. STDMETHOD_(UINT,_get_itbLastFocus)(THIS) PURE;
  6649. STDMETHOD (_put_itbLastFocus)(THIS_ UINT itbLastFocus) PURE;
  6650. STDMETHOD (_UIActivateView)(THIS_ UINT uState) PURE;
  6651. // Check the following functions
  6652. STDMETHOD (_GetViewBorderRect)(THIS_ RECT* prc) PURE;
  6653. STDMETHOD (_UpdateViewRectSize)(THIS) PURE;
  6654. STDMETHOD (_ResizeNextBorder)(THIS_ UINT itb) PURE;
  6655. STDMETHOD (_ResizeView)(THIS) PURE;
  6656. STDMETHOD (_GetEffectiveClientArea)(THIS_ LPRECT lprectBorder, HMONITOR hmon) PURE;
  6657. // Desktop needs to override this from commonsb
  6658. STDMETHOD_(IStream*,v_GetViewStream)(THIS_ LPCITEMIDLIST pidl, DWORD grfMode, LPCWSTR pwszName) PURE;
  6659. // Desktop needs access to these commonsb functions, they are not overridden:
  6660. STDMETHOD_(LRESULT,ForwardViewMsg)(THIS_ UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  6661. STDMETHOD (SetAcceleratorMenu)(THIS_ HACCEL hacc) PURE;
  6662. STDMETHOD_(int,_GetToolbarCount)(THIS) PURE;
  6663. STDMETHOD_(LPTOOLBARITEM,_GetToolbarItem)(THIS_ int itb) PURE;
  6664. STDMETHOD (_SaveToolbars)(THIS_ IStream* pstm) PURE;
  6665. STDMETHOD (_LoadToolbars)(THIS_ IStream* pstm) PURE;
  6666. STDMETHOD (_CloseAndReleaseToolbars)(THIS_ BOOL fClose) PURE;
  6667. STDMETHOD (v_MayGetNextToolbarFocus)(THIS_ LPMSG lpMsg, UINT itbNext, int citb, LPTOOLBARITEM * pptbi, HWND * phwnd) PURE;
  6668. STDMETHOD (_ResizeNextBorderHelper)(THIS_ UINT itb, BOOL bUseHmonitor) PURE;
  6669. STDMETHOD_(UINT,_FindTBar)(THIS_ IUnknown* punkSrc) PURE;
  6670. STDMETHOD (_SetFocus)(THIS_ LPTOOLBARITEM ptbi, HWND hwnd, LPMSG lpMsg) PURE;
  6671. STDMETHOD (v_MayTranslateAccelerator)(THIS_ MSG* pmsg) PURE;
  6672. STDMETHOD (_GetBorderDWHelper)(THIS_ IUnknown* punkSrc, LPRECT lprectBorder, BOOL bUseHmonitor) PURE;
  6673. // Shell browser needs to override this from basesb.
  6674. STDMETHOD (v_CheckZoneCrossing)(THIS_ LPCITEMIDLIST pidl) PURE;
  6675. };
  6676. DECLARE_INTERFACE_(IBrowserService3, IBrowserService2)
  6677. {
  6678. // *** IUnknown methods ***
  6679. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6680. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6681. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6682. // *** IBrowserService specific methods ***
  6683. // TODO: break into 3 sections (outer, inner, and both/inherit)
  6684. STDMETHOD(GetParentSite)(THIS_ struct IOleInPlaceSite** ppipsite) PURE;
  6685. STDMETHOD(SetTitle)(THIS_ IShellView* psv, LPCWSTR pszName) PURE;
  6686. STDMETHOD(GetTitle)(THIS_ IShellView* psv, LPWSTR pszName, DWORD cchName) PURE;
  6687. STDMETHOD(GetOleObject)(THIS_ struct IOleObject** ppobjv) PURE;
  6688. // think about this one.. I'm not sure we want to expose this -- Chee
  6689. // My impression is that we won't document this whole interface???
  6690. STDMETHOD(GetTravelLog)(THIS_ ITravelLog** pptl) PURE;
  6691. STDMETHOD(ShowControlWindow)(THIS_ UINT id, BOOL fShow) PURE;
  6692. STDMETHOD(IsControlWindowShown)(THIS_ UINT id, BOOL *pfShown) PURE;
  6693. STDMETHOD(IEGetDisplayName)(THIS_ LPCITEMIDLIST pidl, LPWSTR pwszName, UINT uFlags) PURE;
  6694. STDMETHOD(IEParseDisplayName)(THIS_ UINT uiCP, LPCWSTR pwszPath, LPITEMIDLIST * ppidlOut) PURE;
  6695. STDMETHOD(DisplayParseError)(THIS_ HRESULT hres, LPCWSTR pwszPath) PURE;
  6696. STDMETHOD(NavigateToPidl)(THIS_ LPCITEMIDLIST pidl, DWORD grfHLNF) PURE;
  6697. STDMETHOD (SetNavigateState)(THIS_ BNSTATE bnstate) PURE;
  6698. STDMETHOD (GetNavigateState) (THIS_ BNSTATE *pbnstate) PURE;
  6699. STDMETHOD (NotifyRedirect) (THIS_ struct IShellView* psv, LPCITEMIDLIST pidl, BOOL *pfDidBrowse) PURE;
  6700. STDMETHOD (UpdateWindowList) (THIS) PURE;
  6701. STDMETHOD (UpdateBackForwardState) (THIS) PURE;
  6702. STDMETHOD(SetFlags)(THIS_ DWORD dwFlags, DWORD dwFlagMask) PURE;
  6703. STDMETHOD(GetFlags)(THIS_ DWORD *pdwFlags) PURE;
  6704. // Tells if it can navigate now or not.
  6705. STDMETHOD (CanNavigateNow) (THIS) PURE;
  6706. STDMETHOD (GetPidl) (THIS_ LPITEMIDLIST *ppidl) PURE;
  6707. STDMETHOD (SetReferrer) (THIS_ LPITEMIDLIST pidl) PURE;
  6708. STDMETHOD_(DWORD, GetBrowserIndex)(THIS) PURE;
  6709. STDMETHOD (GetBrowserByIndex)(THIS_ DWORD dwID, IUnknown **ppunk) PURE;
  6710. STDMETHOD (GetHistoryObject)(THIS_ IOleObject **ppole, IStream **pstm, IBindCtx **ppbc) PURE;
  6711. STDMETHOD (SetHistoryObject)(THIS_ IOleObject *pole, BOOL fIsLocalAnchor) PURE;
  6712. STDMETHOD (CacheOLEServer)(THIS_ IOleObject *pole) PURE;
  6713. STDMETHOD (GetSetCodePage)(THIS_ VARIANT* pvarIn, VARIANT* pvarOut) PURE;
  6714. STDMETHOD (OnHttpEquiv)(THIS_ IShellView* psv, BOOL fDone, VARIANT* pvarargIn, VARIANT* pvarargOut) PURE;
  6715. STDMETHOD (GetPalette)( THIS_ HPALETTE * hpal ) PURE;
  6716. STDMETHOD (RegisterWindow)(THIS_ BOOL fUnregister, int swc) PURE;
  6717. // Stuff added for shbrowse->shbrows2 split
  6718. // These remove "friend" functions and classes
  6719. //
  6720. STDMETHOD_(LRESULT, WndProcBS)(THIS_ HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  6721. STDMETHOD (SetAsDefFolderSettings)(THIS) PURE;
  6722. STDMETHOD (GetViewRect)(THIS_ RECT * prc) PURE;
  6723. STDMETHOD (OnSize)(THIS_ WPARAM wParam) PURE;
  6724. STDMETHOD (OnCreate)(THIS_ LPCREATESTRUCT pcs) PURE;
  6725. STDMETHOD_(LRESULT, OnCommand)(THIS_ WPARAM wParam, LPARAM lParam) PURE;
  6726. STDMETHOD (OnDestroy)(THIS ) PURE;
  6727. STDMETHOD_(LRESULT, OnNotify)(THIS_ NMHDR * pnm) PURE;
  6728. STDMETHOD (OnSetFocus)(THIS ) PURE;
  6729. STDMETHOD (OnFrameWindowActivateBS)(THIS_ BOOL fActive) PURE;
  6730. STDMETHOD (ReleaseShellView)(THIS ) PURE;
  6731. STDMETHOD (ActivatePendingView)(THIS ) PURE;
  6732. STDMETHOD (CreateViewWindow)(THIS_ IShellView* psvNew, IShellView* psvOld, LPRECT prcView, HWND* phwnd) PURE;
  6733. STDMETHOD (CreateBrowserPropSheetExt)(THIS_ REFIID riid, void **ppv) PURE;
  6734. // these could be base browser only interfaces
  6735. // they are not overridden by anyone, and perhaps only there for the aggregators to get info from the
  6736. // aggregatee. NOTE: where basesb calls these,
  6737. // it does NOT go through _pbsOuter
  6738. STDMETHOD (GetViewWindow)(THIS_ HWND * phwndView) PURE;
  6739. STDMETHOD (GetBaseBrowserData)(THIS_ LPCBASEBROWSERDATA * pbbd) PURE;
  6740. STDMETHOD_(LPBASEBROWSERDATA, PutBaseBrowserData)(THIS) PURE;
  6741. STDMETHOD (InitializeTravelLog)(THIS_ ITravelLog* ptl, DWORD dw) PURE;
  6742. STDMETHOD (SetTopBrowser)(THIS) PURE;
  6743. STDMETHOD (Offline)(THIS_ int iCmd) PURE;
  6744. STDMETHOD (AllowViewResize)(THIS_ BOOL f) PURE;
  6745. STDMETHOD (SetActivateState)(THIS_ UINT u) PURE;
  6746. STDMETHOD (UpdateSecureLockIcon)(THIS_ int eSecureLock) PURE;
  6747. STDMETHOD (InitializeDownloadManager)(THIS) PURE;
  6748. STDMETHOD (InitializeTransitionSite)(THIS) PURE;
  6749. STDMETHOD (_Initialize)(THIS_ HWND hwnd, IUnknown *pauto) PURE;
  6750. // BEGIN REVIEW: review names and need of each.
  6751. //
  6752. // this first set could be basebrowser only members. no one overrides
  6753. // NOTE: where basesb calls these, it does NOT go throug _pbsOuter
  6754. STDMETHOD (_CancelPendingNavigationAsync)(THIS) PURE;
  6755. STDMETHOD (_CancelPendingView)(THIS) PURE;
  6756. STDMETHOD (_MaySaveChanges)(THIS) PURE;
  6757. STDMETHOD (_PauseOrResumeView)(THIS_ BOOL fPaused) PURE;
  6758. STDMETHOD (_DisableModeless)(THIS) PURE;
  6759. // rethink these... are all of these necessary?
  6760. STDMETHOD (_NavigateToPidl)(THIS_ LPCITEMIDLIST pidl, DWORD grfHLNF, DWORD dwFlags)PURE;
  6761. STDMETHOD (_TryShell2Rename)(THIS_ IShellView* psv, LPCITEMIDLIST pidlNew)PURE;
  6762. STDMETHOD (_SwitchActivationNow)(THIS )PURE;
  6763. // this set is overridden and called thru _pbsOuter (and SUPER:_pbsInner)
  6764. STDMETHOD (_ExecChildren)(THIS_ IUnknown *punkBar, BOOL fBroadcast,
  6765. const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt,
  6766. VARIANTARG *pvarargIn, VARIANTARG *pvarargOut)PURE;
  6767. STDMETHOD (_SendChildren)(THIS_ HWND hwndBar, BOOL fBroadcast,
  6768. UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  6769. //END REVIEW:
  6770. // querying from the outer.
  6771. STDMETHOD (GetFolderSetData)(THIS_ struct tagFolderSetData* pfsd) PURE;
  6772. // Toolbar stuff is here temporarily. Eventually it will move out
  6773. // of basesb into commonsb, so I'm keeping the underscore "_"
  6774. // Except those noted below, none of these are overridden by
  6775. // outer guys, so no calls are made through _pbsOuter
  6776. STDMETHOD (_OnFocusChange)(THIS_ UINT itb) PURE;
  6777. STDMETHOD (v_ShowHideChildWindows)(THIS_ BOOL fChildOnly) PURE; // NOTE: overridden and called thru _pbsOuter
  6778. STDMETHOD_(UINT,_get_itbLastFocus)(THIS) PURE;
  6779. STDMETHOD (_put_itbLastFocus)(THIS_ UINT itbLastFocus) PURE;
  6780. STDMETHOD (_UIActivateView)(THIS_ UINT uState) PURE;
  6781. // Check the following functions
  6782. STDMETHOD (_GetViewBorderRect)(THIS_ RECT* prc) PURE;
  6783. STDMETHOD (_UpdateViewRectSize)(THIS) PURE;
  6784. STDMETHOD (_ResizeNextBorder)(THIS_ UINT itb) PURE;
  6785. STDMETHOD (_ResizeView)(THIS) PURE;
  6786. STDMETHOD (_GetEffectiveClientArea)(THIS_ LPRECT lprectBorder, HMONITOR hmon) PURE;
  6787. // Desktop needs to override this from commonsb
  6788. STDMETHOD_(IStream*,v_GetViewStream)(THIS_ LPCITEMIDLIST pidl, DWORD grfMode, LPCWSTR pwszName) PURE;
  6789. // Desktop needs access to these commonsb functions, they are not overridden:
  6790. STDMETHOD_(LRESULT,ForwardViewMsg)(THIS_ UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  6791. STDMETHOD (SetAcceleratorMenu)(THIS_ HACCEL hacc) PURE;
  6792. STDMETHOD_(int,_GetToolbarCount)(THIS) PURE;
  6793. STDMETHOD_(LPTOOLBARITEM,_GetToolbarItem)(THIS_ int itb) PURE;
  6794. STDMETHOD (_SaveToolbars)(THIS_ IStream* pstm) PURE;
  6795. STDMETHOD (_LoadToolbars)(THIS_ IStream* pstm) PURE;
  6796. STDMETHOD (_CloseAndReleaseToolbars)(THIS_ BOOL fClose) PURE;
  6797. STDMETHOD (v_MayGetNextToolbarFocus)(THIS_ LPMSG lpMsg, UINT itbNext, int citb, LPTOOLBARITEM * pptbi, HWND * phwnd) PURE;
  6798. STDMETHOD (_ResizeNextBorderHelper)(THIS_ UINT itb, BOOL bUseHmonitor) PURE;
  6799. STDMETHOD_(UINT,_FindTBar)(THIS_ IUnknown* punkSrc) PURE;
  6800. STDMETHOD (_SetFocus)(THIS_ LPTOOLBARITEM ptbi, HWND hwnd, LPMSG lpMsg) PURE;
  6801. STDMETHOD (v_MayTranslateAccelerator)(THIS_ MSG* pmsg) PURE;
  6802. STDMETHOD (_GetBorderDWHelper)(THIS_ IUnknown* punkSrc, LPRECT lprectBorder, BOOL bUseHmonitor) PURE;
  6803. // Shell browser needs to override this from basesb.
  6804. STDMETHOD (v_CheckZoneCrossing)(THIS_ LPCITEMIDLIST pidl) PURE;
  6805. // IBrowserService3
  6806. STDMETHOD (_PositionViewWindow)(THIS_ HWND hwnd, LPRECT prc) PURE; // this was virtual in basesb/shbrowse, but missed this interface!
  6807. };
  6808. typedef enum
  6809. {
  6810. NAVDATA_DONTUPDATETRAVELLOG = 0x00000001,
  6811. NAVDATA_FRAMEWINDOW = 0x00000002,
  6812. NAVDATA_FRAMECREATION = 0x00000004,
  6813. NAVDATA_RESTARTLOAD = 0x00000008,
  6814. } ENUMNAVDATA;
  6815. typedef struct IHTMLWindow2 IHTMLWindow2;
  6816. #undef INTERFACE
  6817. #define INTERFACE ITridentService
  6818. DECLARE_INTERFACE_(ITridentService, IUnknown)
  6819. {
  6820. // *** IUnknown methods ***
  6821. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6822. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6823. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6824. // *** ITridentService specific methods ***
  6825. STDMETHOD(FireBeforeNavigate2)(THIS_
  6826. IDispatch * pDispatch,
  6827. LPCTSTR lpszUrl,
  6828. DWORD dwFlags,
  6829. LPCTSTR lpszFrameName,
  6830. LPBYTE pPostData,
  6831. DWORD cbPostData,
  6832. LPCTSTR lpszHeaders,
  6833. BOOL fPlayNavSound,
  6834. BOOL * pfCancel) PURE;
  6835. STDMETHOD(FireNavigateComplete2)(THIS_ IHTMLWindow2 * pHTMLWindow2,
  6836. DWORD dwFlags) PURE;
  6837. STDMETHOD(FireDownloadBegin)(THIS) PURE;
  6838. STDMETHOD(FireDownloadComplete)(THIS) PURE;
  6839. STDMETHOD(FireDocumentComplete)(THIS_
  6840. IHTMLWindow2 * pHTMLWindow,
  6841. DWORD dwFlags) PURE;
  6842. STDMETHOD(UpdateDesktopComponent)(THIS_ IHTMLWindow2 * pHTMLWindow) PURE;
  6843. STDMETHOD(GetPendingUrl)(THIS_ BSTR * pbstrPendingUrl) PURE;
  6844. STDMETHOD(ActiveElementChanged)(THIS_ IHTMLElement * pHTMLElement) PURE;
  6845. STDMETHOD(GetUrlSearchComponent)(THIS_ BSTR * pbstrSearch) PURE;
  6846. STDMETHOD(IsErrorUrl)(THIS_ LPCTSTR lpszUrl, BOOL *pfIsError) PURE;
  6847. };
  6848. #undef INTERFACE
  6849. #define INTERFACE ITridentService2
  6850. DECLARE_INTERFACE_(ITridentService2, ITridentService)
  6851. {
  6852. // *** ITridentService2 methods ***
  6853. STDMETHOD(AttachMyPics)(THIS_ void *pDoc2, void **ppMyPics) PURE;
  6854. STDMETHOD_(BOOL,ReleaseMyPics)(THIS_ void *pMyPics) PURE;
  6855. STDMETHOD(IsGalleryMeta)(THIS_ BOOL bFlag, void *pMyPics) PURE;
  6856. STDMETHOD(EmailPicture)(THIS_ BSTR bstrURL) PURE;
  6857. STDMETHOD(FireNavigateError)(THIS_ IHTMLWindow2 * pHTMLWindow2,
  6858. BSTR bstrURL,
  6859. BSTR bstrTargetFrameName,
  6860. DWORD dwStatusCode,
  6861. BOOL * pfCancel) PURE;
  6862. STDMETHOD(FirePrintTemplateEvent)(THIS_ IHTMLWindow2 * pHTMLWindow2,
  6863. DISPID dispidPrintEvent) PURE;
  6864. STDMETHOD(FireUpdatePageStatus)(THIS_ IHTMLWindow2 * pHTMLWindow2,
  6865. DWORD nPage,
  6866. BOOL fDone) PURE;
  6867. STDMETHOD(FirePrivacyImpactedStateChange)(THIS_ BOOL bPrivacyImpacted) PURE;
  6868. STDMETHOD(InitAutoImageResize)(THIS) PURE;
  6869. STDMETHOD(UnInitAutoImageResize)(THIS) PURE;
  6870. };
  6871. #undef INTERFACE
  6872. #define INTERFACE IWebBrowserPriv
  6873. DECLARE_INTERFACE_(IWebBrowserPriv, IUnknown)
  6874. {
  6875. // *** IUnknown methods ***
  6876. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6877. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6878. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6879. // *** IWebBrowserPriv specific methods ***
  6880. STDMETHOD(NavigateWithBindCtx)(THIS_ VARIANT *pvarUrl,
  6881. VARIANT *pvarFlags,
  6882. VARIANT *pvarTargetFrameName,
  6883. VARIANT *pvarPostData,
  6884. VARIANT *pvarHeaders,
  6885. IBindCtx * pBindCtx,
  6886. BSTR bstrLocation) PURE;
  6887. STDMETHOD(OnClose)(THIS) PURE;
  6888. };
  6889. // these MUST be listed in the same order a c_szPropNames in deskbar.cpp
  6890. typedef enum {
  6891. PROPDATA_SIDE = 0,
  6892. PROPDATA_MODE,
  6893. PROPDATA_LEFT,
  6894. PROPDATA_TOP,
  6895. PROPDATA_RIGHT,
  6896. PROPDATA_BOTTOM,
  6897. PROPDATA_DELETEABLE,
  6898. PROPDATA_X,
  6899. PROPDATA_Y,
  6900. PROPDATA_CX,
  6901. PROPDATA_CY,
  6902. PROPDATA_COUNT
  6903. } ENUMPROPDATA ;
  6904. // PROPDATA_MODE values:
  6905. // (aka. WBM_* -- webbar modes (_eMode))
  6906. #define WBM_BOTTOMMOST ((UINT) 0x0) // bottommost
  6907. #define WBM_TOPMOST ((UINT) 0x1) // topmost
  6908. #define WBM_FLOATING ((UINT) 0x2) // floating
  6909. #define WBM_NIL ((UINT) 0x7) // nil
  6910. #undef INTERFACE
  6911. #define INTERFACE IDockingBarPropertyBagInit
  6912. DECLARE_INTERFACE_(IDockingBarPropertyBagInit, IUnknown)
  6913. {
  6914. // *** IUnknown methods ***
  6915. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  6916. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  6917. STDMETHOD_(ULONG,Release)(THIS) PURE;
  6918. // *** IDockingBarPropertyBag ***
  6919. STDMETHOD(SetDataDWORD)(THIS_ ENUMPROPDATA e, DWORD dwData) PURE;
  6920. } ;
  6921. #if (_WIN32_IE) >= 0x0400
  6922. //===========================================================================
  6923. // IAddressList private COmWindow interface. This should never be exposed.
  6924. #undef INTERFACE
  6925. #define INTERFACE IAddressList
  6926. DECLARE_INTERFACE_(IAddressList, IWinEventHandler)
  6927. {
  6928. // *** IUnknown methods ***
  6929. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6930. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6931. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6932. // *** IWinEventHandler Methods ***
  6933. STDMETHOD(OnWinEvent) (THIS_ HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* plres) PURE;
  6934. STDMETHOD(IsWindowOwner) (THIS_ HWND hwnd) PURE;
  6935. // *** IAddressList Methods ***
  6936. STDMETHOD(Connect) (THIS_ BOOL fConnect, HWND hwnd, IBrowserService* pbs, IBandProxy* pbp, IAutoComplete * pac) PURE;
  6937. STDMETHOD(NavigationComplete) (THIS_ void *pvCShellUrl) PURE;
  6938. STDMETHOD(Refresh) (THIS_ DWORD dwType) PURE;
  6939. STDMETHOD(Load) (THIS) PURE;
  6940. STDMETHOD(Save) (THIS) PURE;
  6941. STDMETHOD(SetToListIndex) (THIS_ int nIndex, void *pvShelLUrl) PURE;
  6942. STDMETHOD(FileSysChangeAL) (THIS_ DWORD dw, LPCITEMIDLIST *ppidl) PURE;
  6943. };
  6944. #endif
  6945. // DOC'ed for DOJ compliance
  6946. ;end_internal
  6947. //
  6948. // IDocViewSite
  6949. //
  6950. #undef INTERFACE
  6951. #define INTERFACE IDocViewSite
  6952. DECLARE_INTERFACE_(IDocViewSite, IUnknown)
  6953. {
  6954. // *** IUnknown methods ***
  6955. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  6956. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  6957. STDMETHOD_(ULONG,Release)(THIS) PURE;
  6958. // *** IDocViewSite methods ***
  6959. STDMETHOD(OnSetTitle) (THIS_ VARIANTARG *pvTitle) PURE;
  6960. } ;
  6961. ;begin_internal
  6962. #endif
  6963. //===========================================================================
  6964. // IDwnCodePage: This is a private interface to pass codepage info.
  6965. #undef INTERFACE
  6966. #define INTERFACE IDwnCodePage
  6967. DECLARE_INTERFACE_(IDwnCodePage, IUnknown)
  6968. {
  6969. // *** IUnknown methods ***
  6970. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  6971. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  6972. STDMETHOD_(ULONG,Release) (THIS) PURE;
  6973. // *** IDwnCodePage Methods ***
  6974. STDMETHOD_(UINT,GetCodePage) (THIS) PURE;
  6975. STDMETHOD(SetCodePage) (THIS_ UINT uiCP) PURE;
  6976. };
  6977. SHSTDAPI SHDllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv);
  6978. //===========================================================================
  6979. //----------------------------------------------------------------------------
  6980. #define IsLFNDriveORD 119
  6981. SHSTDAPI_(int) SHOutOfMemoryMessageBox(HWND hwndOwner, LPTSTR pszTitle, UINT fuStyle);
  6982. SHSTDAPI_(BOOL) SHWinHelp(HWND hwndMain, LPCTSTR pszHelp, UINT usCommand, ULONG_PTR ulData);
  6983. SHSTDAPI_(BOOL) RLBuildListOfPaths(void);
  6984. #ifdef WINNT
  6985. SHSTDAPI_(BOOL) RegenerateUserEnvironment(void **pPrevEnv, BOOL bSetCurrentEnv);
  6986. #endif
  6987. #define SHValidateUNCORD 173
  6988. // DOC'ed for DOJ compliance
  6989. ;end_internal
  6990. #define VALIDATEUNC_NOUI 0x0002 // don't bring up UI
  6991. #define VALIDATEUNC_CONNECT 0x0001 // connect a drive letter
  6992. #define VALIDATEUNC_PRINT 0x0004 // validate as print share instead of disk share
  6993. #define VALIDATEUNC_VALID 0x0007 // valid flags
  6994. SHSTDAPI_(BOOL) SHValidateUNC(HWND hwndOwner, LPWSTR pszFile, UINT fConnect);
  6995. ;begin_internal
  6996. //----------------------------------------------------------------------------
  6997. #define OleStrToStrNORD 78
  6998. #define SHCloneSpecialIDListORD 89
  6999. #define SHDllGetClassObjectORD 128
  7000. #define SHLogILFromFSILORD 95
  7001. #define SHMapPIDLToSystemImageListIndexORD 77
  7002. #define SHShellFolderView_MessageORD 73
  7003. #define Shell_GetImageListsORD 71
  7004. #define SHGetSpecialFolderPathORD 175
  7005. #define StrToOleStrNORD 79
  7006. #define ILCloneORD 18
  7007. #define ILCloneFirstORD 19
  7008. #define ILCombineORD 25
  7009. #define ILCreateFromPathORD 157
  7010. #define ILFindChildORD 24
  7011. #define ILFreeORD 155
  7012. #define ILGetNextORD 153
  7013. #define ILGetSizeORD 152
  7014. #define ILIsEqualORD 21
  7015. #define ILRemoveLastIDORD 17
  7016. #define PathAddBackslashORD 32
  7017. #define PathCombineORD 37
  7018. #define PathIsExeORD 43
  7019. #define PathMatchSpecORD 46
  7020. #define SHGetSetSettingsORD 68
  7021. #define SHILCreateFromPathORD 28
  7022. #define SHFreeORD 195
  7023. #define CheckWinIniForAssocsORD 711
  7024. // DOC'ed for DOJ Compliance
  7025. ;end_internal
  7026. #define OPENPROPS_NONE 0x0000
  7027. #define OPENPROPS_INHIBITPIF 0x8000
  7028. #define GETPROPS_NONE 0x0000
  7029. #define SETPROPS_NONE 0x0000
  7030. #define CLOSEPROPS_NONE 0x0000
  7031. #define CLOSEPROPS_DISCARD 0x0001
  7032. #define PIFNAMESIZE 30
  7033. #define PIFSTARTLOCSIZE 63
  7034. #define PIFDEFPATHSIZE 64
  7035. #define PIFPARAMSSIZE 64
  7036. #define PIFSHPROGSIZE 64
  7037. #define PIFSHDATASIZE 64
  7038. #define PIFDEFFILESIZE 80
  7039. #define PIFMAXFILEPATH 260
  7040. typedef struct PROPPRG { /* prg */
  7041. WORD flPrg; // see PRG_ flags
  7042. WORD flPrgInit; // see PRGINIT_ flags
  7043. CHAR achTitle[PIFNAMESIZE]; // name[30]
  7044. CHAR achCmdLine[PIFSTARTLOCSIZE+PIFPARAMSSIZE+1];// startfile[63] + params[64]
  7045. CHAR achWorkDir[PIFDEFPATHSIZE]; // defpath[64]
  7046. WORD wHotKey; // PfHotKeyScan thru PfHotKeyVal
  7047. CHAR achIconFile[PIFDEFFILESIZE]; // name of file containing icon
  7048. WORD wIconIndex; // index of icon within file
  7049. DWORD dwEnhModeFlags; // reserved enh-mode flags
  7050. DWORD dwRealModeFlags; // real-mode flags (see RMOPT_*)
  7051. CHAR achOtherFile[PIFDEFFILESIZE]; // name of "other" file in directory
  7052. CHAR achPIFFile[PIFMAXFILEPATH]; // name of PIF file
  7053. } PROPPRG;
  7054. typedef UNALIGNED PROPPRG *PPROPPRG;
  7055. typedef UNALIGNED PROPPRG FAR *LPPROPPRG;
  7056. typedef const UNALIGNED PROPPRG FAR *LPCPROPPRG;
  7057. SHSTDAPI_(HANDLE) PifMgr_OpenProperties(LPCWSTR pszApp, LPCWSTR pszPIF, UINT hInf, UINT flOpt);
  7058. SHSTDAPI_(int) PifMgr_GetProperties(HANDLE hProps, LPCSTR pszGroup, void *lpProps, int cbProps, UINT flOpt);
  7059. SHSTDAPI_(int) PifMgr_SetProperties(HANDLE hProps, LPCSTR pszGroup, const VOID *lpProps, int cbProps, UINT flOpt);
  7060. SHSTDAPI_(HANDLE) PifMgr_CloseProperties(HANDLE hProps, UINT flOpt);
  7061. SHSTDAPI_(void) SHSetInstanceExplorer(IUnknown *punk);
  7062. ;begin_internal
  7063. #ifndef WINNT
  7064. // Always usr TerminateThreadEx.
  7065. BOOL APIENTRY TerminateThreadEx(HANDLE hThread, DWORD dwExitCode, BOOL bCleanupFlag);
  7066. #define TerminateThread(hThread, dwExitCode) TerminateThreadEx(hThread, dwExitCode, TRUE)
  7067. #endif
  7068. // DOC'ed for DOJ Compliance
  7069. ;end_internal
  7070. SHSTDAPI_(BOOL) IsUserAnAdmin(void);
  7071. ;begin_internal
  7072. SHSTDAPI SHCreateSessionKey(REGSAM sam, HKEY *phkOut);
  7073. // Sortof Gross but if we pass this flag in with STGM_CREATE we will fail if file already exists
  7074. // with ERROR_ALREADY_EXISTS
  7075. #define CSOF_FAILIFTHERE 0x80000000L
  7076. //===========================================================================
  7077. // Structure for covert communication
  7078. // between shdocvw's CShellBrowser::Exec()
  7079. // and shell32's DefView WM_COMMAND handler
  7080. // NOTE: this structure is revealed in the KB
  7081. // (articles Q252610 and Q216954). So even though
  7082. // it's in a private section, treat it as public.
  7083. struct _DFVCMDDATA
  7084. {
  7085. HWND hwnd; // Browser hwnd
  7086. VARIANTARG *pva; // Args passed to Exec()
  7087. DWORD nCmdIDTranslated; // Replacement OLECMDID_* value
  7088. };
  7089. typedef struct _DFVCMDDATA DFVCMDDATA;
  7090. typedef struct _DFVCMDDATA *LPDFVCMDDATA;
  7091. typedef const struct _DFVCMDDATA *LPCDFVCMDDATA;
  7092. SHSTDAPI_(DWORD) SHGetProcessDword(DWORD idProcess, LONG iIndex);
  7093. SHSTDAPI_(BOOL) SHSetShellWindowEx(HWND hwnd, HWND hwndChild);
  7094. #define CCH_MENUMAX 80 // DOC: max size of a menu string
  7095. // WinEventHandler message ranges
  7096. #define MBHM_FIRST (0x00000001) // MenuBandHandler
  7097. #define MBHM_LAST (0x000000ff)
  7098. #define MSFM_FIRST (0x00000100) // MenuShellFolder
  7099. #define MSFM_LAST (0x000001ff)
  7100. #define FSFM_FIRST (0x00000200) // FileShellFolder
  7101. #define FSFM_LAST (0x000002ff)
  7102. //-------------------------------------------------------------------------
  7103. //
  7104. // SID_SMenuBandHandler
  7105. //
  7106. // The menuband calls QueryService(SID_SMenuBandHandler, IID_IWinEventHandler)
  7107. // on its shellfolder. If the shellfolder supports this service, the
  7108. // menuband will call the event handler on certain menu events. These
  7109. // events and messages are as follows:
  7110. //
  7111. // MBHM_INITMENUPOPUP sent when a drop-down menu or submenu is
  7112. // about to become active.
  7113. //
  7114. //
  7115. // File-system ShellFolder events:
  7116. //
  7117. // FSFM_COMMAND sent when a file-system item is executed
  7118. //
  7119. //-------------------------------------------------------------------------
  7120. typedef struct tagMBINITMENUPOPUP
  7121. {
  7122. DWORD dwMask; // MBIMP_*
  7123. IShellFolder * psf;
  7124. LPCITEMIDLIST pidl;
  7125. HMENU hmenu;
  7126. int iPos;
  7127. } MBINITMENUPOPUP;
  7128. #define MBIMP_HMENU 0x00000001 // hmenu and iPos are set
  7129. // Messages sent to the WinEventHandler wParam lParam *plRet
  7130. // ------ ------ ---
  7131. #define MBHM_INITMENUPOPUP (MBHM_FIRST+0) // 0 MBINITMENUPOPUP *
  7132. // Messages sent to the WinEventHandler wParam lParam *plRet
  7133. // ------ ------ ------
  7134. #define FSFM_COMMAND (FSFM_FIRST+0) // cmd ID pidl
  7135. //-------------------------------------------------------------------------
  7136. //
  7137. // IAugmentedShellFolder interface
  7138. //
  7139. // This provides methods to add multiple Shell Folder objects to a
  7140. // single augmented object (CLSID_AugmentedShellFolder), which will
  7141. // enumerate them as if they were in a single namespace.
  7142. //
  7143. //
  7144. // [Member functions]
  7145. //
  7146. // IAugmentedShellFolder::AddNameSpace(rguidObject, psf, pidl)
  7147. // Add the object represented by the IShellFolder interface to
  7148. // the augmented list. The rguidObject is used to identify the
  7149. // given object. It may be NULL. The optional pidl refers to
  7150. // the location of the psf.
  7151. //
  7152. // IAugmentedShellFolder::GetNameSpaceID(pidl, rguidOut)
  7153. // This method returns the rguidObject associated with the given
  7154. // pidl. This is how a caller can identify which namespace the
  7155. // pidl resides, given the list of IShellFolder objects that were
  7156. // added to this augmented object.
  7157. //
  7158. // IAugmentedShellFolder::QueryNameSpace(dwNameSpaceID, pguidOut, ppsf)
  7159. // Returns the shellfolder and guid associated with the given ID.
  7160. //
  7161. // IAugmentedShellFolder::EnumNameSpace(uNameSpace, pdwNameSpaceID)
  7162. // Enumerates the namespace shellfolders. If uNameSpace is -1,
  7163. // pdwNameSpaceID is ignored and this method returns the count of
  7164. // shellfolders in the augmented namespace. Call this method with
  7165. // uNameSpace starting at 0 to begin enumerating. Returns S_OK and
  7166. // and namespace ID in *pdwNameSpaceID.
  7167. //
  7168. //-------------------------------------------------------------------------
  7169. // IAugmentedShellFolder::AddNameSpace flags
  7170. enum
  7171. {
  7172. ASFF_DEFAULT = 0x00000000, // There are no applicable Flags
  7173. ASFF_SORTDOWN = 0x00000001, // Sort the items in this ISF to the bottom.
  7174. ASFF_MERGESAMEGUID = 0x00000002, // Merge only namespaces with the same pguidObjects
  7175. ASFF_COMMON = 0x00000004, // this is a "Common" or "All Users" folder
  7176. // the following should all be collapsed to one ASFF_DEFNAMESPACE
  7177. ASFF_DEFNAMESPACE_BINDSTG = 0x00000100, // The namespace is the default handler for BindToStorage() for merged child items.
  7178. ASFF_DEFNAMESPACE_COMPARE = 0x00000200, // The namespace is the default handler for CompareIDs() for merged child items.
  7179. ASFF_DEFNAMESPACE_VIEWOBJ = 0x00000400, // The namespace is the default handler for CreateViewObject() for merged child items.
  7180. ASFF_DEFNAMESPACE_ATTRIB = 0x00001800, // The namespace is the default handler for GetAttributesOf() for merged child items.
  7181. ASFF_DEFNAMESPACE_DISPLAYNAME = 0x00001000, // The namespace is the default handler for GetDisplayNameOf(), SetNameOf() and ParseDisplayName() for merged child items.
  7182. ASFF_DEFNAMESPACE_UIOBJ = 0x00002000, // The namespace is the default handler for GetUIObjectOf() for merged child items.
  7183. ASFF_DEFNAMESPACE_ITEMDATA = 0x00004000, // The namespace is the default handler for GetItemData() for merged child items.
  7184. ASFF_DEFNAMESPACE_ALL = 0x0000FF00 // The namespace is the primary handler for all IShellFolder operations on merged child items.
  7185. };
  7186. enum QUERYNAMESPACEINFO_MASK
  7187. {
  7188. ASFQNSI_FLAGS = 0x00000001,
  7189. ASFQNSI_FOLDER = 0x00000002,
  7190. ASFQNSI_GUID = 0x00000004,
  7191. ASFQNSI_PIDL = 0x00000008,
  7192. };
  7193. #include <pshpack8.h>
  7194. typedef struct QUERYNAMESPACEINFO
  7195. {
  7196. DWORD cbSize;
  7197. DWORD dwMask;
  7198. DWORD dwFlags; // ASFF_*
  7199. IShellFolder *psf;
  7200. GUID guidObject;
  7201. LPITEMIDLIST pidl;
  7202. } QUERYNAMESPACEINFO;
  7203. #include <poppack.h> /* Return to byte packing */
  7204. #undef INTERFACE
  7205. #define INTERFACE IAugmentedShellFolder
  7206. DECLARE_INTERFACE_(IAugmentedShellFolder, IShellFolder)
  7207. {
  7208. // *** IUnknown methods ***
  7209. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7210. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7211. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7212. // *** IShellFolder methods ***
  7213. STDMETHOD(ParseDisplayName) (THIS_ HWND hwndOwner,LPBC pbc, LPOLESTR pszDisplayName,
  7214. ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
  7215. STDMETHOD(EnumObjects) (THIS_ HWND hwndOwner, DWORD grfFlags, IEnumIDList ** ppenumIDList) PURE;
  7216. STDMETHOD(BindToObject) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  7217. STDMETHOD(BindToStorage) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  7218. STDMETHOD(CompareIDs) (THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  7219. STDMETHOD(CreateViewObject) (THIS_ HWND hwndOwner, REFIID riid, void **ppv) PURE;
  7220. STDMETHOD(GetAttributesOf) (THIS_ UINT cidl, LPCITEMIDLIST * apidl, ULONG * rgfInOut) PURE;
  7221. STDMETHOD(GetUIObjectOf) (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  7222. REFIID riid, UINT * prgfInOut, void **ppv) PURE;
  7223. STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
  7224. STDMETHOD(SetNameOf) (THIS_ HWND hwndOwner, LPCITEMIDLIST pidl,
  7225. LPCOLESTR pszName, DWORD uFlags,
  7226. LPITEMIDLIST * ppidlOut) PURE;
  7227. // *** IAugmentedShellFolder methods ***
  7228. STDMETHOD(AddNameSpace) (THIS_ const GUID * pguidObject, IShellFolder * psf,
  7229. LPCITEMIDLIST pidl, DWORD dwFlags) PURE;
  7230. STDMETHOD(GetNameSpaceID) (THIS_ LPCITEMIDLIST pidl, GUID * pguidOut) PURE;
  7231. STDMETHOD(QueryNameSpace) (THIS_ DWORD dwID, GUID * pguidOut, IShellFolder ** ppsf) PURE;
  7232. STDMETHOD(EnumNameSpace) (THIS_ DWORD uNameSpace, DWORD * pdwID) PURE;
  7233. };
  7234. #undef INTERFACE
  7235. #define INTERFACE IAugmentedShellFolder2
  7236. DECLARE_INTERFACE_(IAugmentedShellFolder2, IAugmentedShellFolder)
  7237. {
  7238. // *** IUnknown methods ***
  7239. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7240. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7241. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7242. // *** IShellFolder methods ***
  7243. STDMETHOD(ParseDisplayName) (THIS_ HWND hwndOwner, LPBC pbc, LPOLESTR pszDisplayName,
  7244. ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
  7245. STDMETHOD(EnumObjects) (THIS_ HWND hwndOwner, DWORD grfFlags, IEnumIDList ** ppenumIDList) PURE;
  7246. STDMETHOD(BindToObject) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  7247. STDMETHOD(BindToStorage) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  7248. STDMETHOD(CompareIDs) (THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  7249. STDMETHOD(CreateViewObject) (THIS_ HWND hwndOwner, REFIID riid, void **ppv) PURE;
  7250. STDMETHOD(GetAttributesOf) (THIS_ UINT cidl, LPCITEMIDLIST * apidl,
  7251. ULONG * rgfInOut) PURE;
  7252. STDMETHOD(GetUIObjectOf) (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  7253. REFIID riid, UINT * prgfInOut, void **ppv) PURE;
  7254. STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
  7255. STDMETHOD(SetNameOf) (THIS_ HWND hwndOwner, LPCITEMIDLIST pidl,
  7256. LPCOLESTR pszName, DWORD uFlags,
  7257. LPITEMIDLIST * ppidlOut) PURE;
  7258. // *** IAugmentedShellFolder methods ***
  7259. STDMETHOD(AddNameSpace) (THIS_ const GUID * pguidObject, IShellFolder * psf,
  7260. LPCITEMIDLIST pidl, DWORD dwFlags) PURE;
  7261. STDMETHOD(GetNameSpaceID) (THIS_ LPCITEMIDLIST pidl, GUID * pguidOut) PURE;
  7262. STDMETHOD(QueryNameSpace) (THIS_ DWORD dwID, GUID * pguidOut, IShellFolder ** ppsf) PURE;
  7263. STDMETHOD(EnumNameSpace) (THIS_ DWORD uNameSpace, DWORD * pdwID) PURE;
  7264. // *** IAugmentedShellFolder2 methods ***
  7265. STDMETHOD(UnWrapIDList) (THIS_ LPCITEMIDLIST pidlWrap, LONG cPidls, IShellFolder ** apsf, LPITEMIDLIST * apidlFolder, LPITEMIDLIST * apidlItems, LONG * pcFetched ) PURE ;
  7266. };
  7267. #undef INTERFACE
  7268. #define INTERFACE IAugmentedShellFolder3
  7269. DECLARE_INTERFACE_(IAugmentedShellFolder3, IAugmentedShellFolder2)
  7270. {
  7271. // *** IUnknown methods ***
  7272. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7273. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7274. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7275. // *** IShellFolder methods ***
  7276. STDMETHOD(ParseDisplayName) (THIS_ HWND hwndOwner, LPBC pbc, LPOLESTR pszDisplayName,
  7277. ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
  7278. STDMETHOD(EnumObjects) (THIS_ HWND hwndOwner, DWORD grfFlags, IEnumIDList ** ppenumIDList) PURE;
  7279. STDMETHOD(BindToObject) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  7280. STDMETHOD(BindToStorage) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  7281. STDMETHOD(CompareIDs) (THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  7282. STDMETHOD(CreateViewObject) (THIS_ HWND hwndOwner, REFIID riid, void **ppv) PURE;
  7283. STDMETHOD(GetAttributesOf) (THIS_ UINT cidl, LPCITEMIDLIST * apidl,
  7284. ULONG * rgfInOut) PURE;
  7285. STDMETHOD(GetUIObjectOf) (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  7286. REFIID riid, UINT * prgfInOut, void **ppv) PURE;
  7287. STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
  7288. STDMETHOD(SetNameOf) (THIS_ HWND hwndOwner, LPCITEMIDLIST pidl,
  7289. LPCOLESTR pszName, DWORD uFlags,
  7290. LPITEMIDLIST * ppidlOut) PURE;
  7291. // *** IAugmentedShellFolder methods ***
  7292. STDMETHOD(AddNameSpace) (THIS_ const GUID * pguidObject, IShellFolder * psf,
  7293. LPCITEMIDLIST pidl, DWORD dwFlags) PURE;
  7294. STDMETHOD(GetNameSpaceID) (THIS_ LPCITEMIDLIST pidl, GUID * pguidOut) PURE;
  7295. STDMETHOD(QueryNameSpace) (THIS_ DWORD dwID, GUID * pguidOut, IShellFolder ** ppsf) PURE;
  7296. STDMETHOD(EnumNameSpace) (THIS_ DWORD uNameSpace, DWORD * pdwID) PURE;
  7297. // *** IAugmentedShellFolder2 methods ***
  7298. STDMETHOD(UnWrapIDList) (THIS_ LPCITEMIDLIST pidlWrap, LONG cPidls, IShellFolder ** apsf, LPITEMIDLIST * apidlFolder, LPITEMIDLIST * apidlItems, LONG * pcFetched ) PURE ;
  7299. // *** IAugmentedShellFolder3 methods ***
  7300. STDMETHOD(QueryNameSpace2) (THIS_ DWORD dwID, QUERYNAMESPACEINFO *pqnsi) PURE;
  7301. };
  7302. //-------------------------------------------------------------------------
  7303. //
  7304. // IProxyShellFolder interface
  7305. //
  7306. // This provides methods to set a proxy object which can respond
  7307. // to GetUIObjectOf instead of or in addition to the hosted object
  7308. // the supports IShellFolder. All other methods are forwarded onto
  7309. // the hosted object. The CLSID_HostProxyShellFolder object implements
  7310. // this interface.
  7311. //
  7312. // The Win95 shell does not support aggregation, so this object
  7313. // must be extra careful that it follows the rules of COM.
  7314. //
  7315. // This interface is implemented by an object that wishes to provide
  7316. // more support for GetUIObjectOf on behalf of another object that
  7317. // implements an original IShellFolder.
  7318. //
  7319. // [Member functions]
  7320. //
  7321. // IProxyShellFolder::InitHostProxy(psf, pidl, punk, dwFlags)
  7322. // Set the object that implements IProxyShellFolder. Depending
  7323. // on dwFlags, this object will be called instead of or in addition
  7324. // to the host's method.
  7325. //
  7326. // SPF_PRIORITY - call the proxy's method instead of
  7327. // the host's method.
  7328. // SPF_SECONDARY - call the proxy's method only if the
  7329. // host's method doesn't support it.
  7330. // SPF_INHERIT - create a new object of this class and
  7331. // hand it back for BindToObject.
  7332. // SPF_FOLDERPRECEDENCE - have the proxy give folders priority
  7333. // over files in a call to CompareIDs.
  7334. // SPF_HAVECALLBACK - have the proxy call the owner's
  7335. // IOleCommandTarget on each enumerated
  7336. // object, for filtering.
  7337. //
  7338. // Also sets as the host the given object which fully implements
  7339. // IShellFolder. pidl refers to the shell folder.
  7340. //
  7341. // IProxyShellFolder::CloneProxyPSF(riid, ppv)
  7342. // Tells the object to clone itself. The host proxy will call this
  7343. // whenever IShellFolder::BindToObject is called.
  7344. //
  7345. // IProxyShellFolder::GetUIObjectOfPSF(hwndOwner, cidl, apidl, riid, prgfInOut, ppv)
  7346. // Called by CLSID_HostProxyShellFolder to allow the proxy object
  7347. // an opportunity to respond.
  7348. //
  7349. // IProxyShellFolder::CreateViewObjectPSF(hwndOwner, riid, ppv)
  7350. // Called by CLSID_HostProxyShellFolder to allow the proxy object
  7351. // an opportunity to respond.
  7352. //
  7353. //-------------------------------------------------------------------------
  7354. // SetProxyObject flags
  7355. #define SPF_PRIORITY 0x00000001 // This is mutually exclusive w/ SPF_SECONDARY
  7356. #define SPF_SECONDARY 0x00000002
  7357. #define SPF_INHERIT 0x00000004
  7358. #define SPF_FOLDERPRECEDENCE 0x00000008
  7359. #define SPF_HAVECALLBACK 0x00000010
  7360. //For filtering of Pidls
  7361. #define PHID_FilterOutPidl 0
  7362. #undef INTERFACE
  7363. #define INTERFACE IProxyShellFolder
  7364. DECLARE_INTERFACE_(IProxyShellFolder, IShellFolder)
  7365. {
  7366. // *** IUnknown methods ***
  7367. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7368. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7369. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7370. // *** IShellFolder methods ***
  7371. STDMETHOD(ParseDisplayName) (THIS_ HWND hwndOwner, LPBC pbc, LPOLESTR pszDisplayName,
  7372. ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
  7373. STDMETHOD(EnumObjects) (THIS_ HWND hwndOwner, DWORD grfFlags, IEnumIDList ** ppenumIDList) PURE;
  7374. STDMETHOD(BindToObject) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  7375. STDMETHOD(BindToStorage) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  7376. STDMETHOD(CompareIDs) (THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  7377. STDMETHOD(CreateViewObject) (THIS_ HWND hwndOwner, REFIID riid, void **ppv) PURE;
  7378. STDMETHOD(GetAttributesOf) (THIS_ UINT cidl, LPCITEMIDLIST * apidl,
  7379. ULONG * rgfInOut) PURE;
  7380. STDMETHOD(GetUIObjectOf) (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  7381. REFIID riid, UINT * prgfInOut, void **ppv) PURE;
  7382. STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
  7383. STDMETHOD(SetNameOf) (THIS_ HWND hwndOwner, LPCITEMIDLIST pidl,
  7384. LPCOLESTR pszName, DWORD uFlags,
  7385. LPITEMIDLIST * ppidlOut) PURE;
  7386. // *** IProxyShellFolder methods ***
  7387. STDMETHOD(InitHostProxy) (THIS_ IShellFolder * psf, LPCITEMIDLIST pidl, DWORD dwFlags) PURE;
  7388. STDMETHOD(CloneProxyPSF) (THIS_ REFIID riid, void **ppv) PURE;
  7389. STDMETHOD(GetUIObjectOfPSF) (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  7390. REFIID riid, UINT * prgfInOut, void **ppv) PURE;
  7391. STDMETHOD(CreateViewObjectPSF) (THIS_ HWND hwndOwner, REFIID riid, void **ppv) PURE;
  7392. };
  7393. //-------------------------------------------------------------------------
  7394. //
  7395. // IMenuShellFolder interface
  7396. //
  7397. // This wraps a static HMENU with an IShellFolder interface.
  7398. //
  7399. //
  7400. // [Member functions]
  7401. //
  7402. // IMenuShellFolder::SetMenu(hmenu)
  7403. // Specifies the hmenu to wrap. This may be NULL.
  7404. //
  7405. // IMenuShellFolder::GetMenu(phmenu)
  7406. // Returns the current menu in *phmenu. Returns S_FALSE if no menu is
  7407. // set (*phmenu will be NULL).
  7408. //
  7409. // IMenuShellFolder::SetWindow(hwndOwner)
  7410. // Specifies the window owner. This may be NULL.
  7411. //
  7412. //-------------------------------------------------------------------------
  7413. // Messages sent to the WinEventHandler wParam lParam *plRet
  7414. // ------ ------ ---
  7415. #define MSFM_COMMAND (MSFM_FIRST+0) // cmd ID 0
  7416. #define MSFM_ISDROPTARGET (MSFM_FIRST+1) // id 0 1 if yes
  7417. #undef INTERFACE
  7418. #define INTERFACE IMenuShellFolder
  7419. DECLARE_INTERFACE_(IMenuShellFolder, IShellFolder)
  7420. {
  7421. // *** IUnknown methods ***
  7422. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7423. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7424. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7425. // *** IShellFolder methods ***
  7426. STDMETHOD(ParseDisplayName) (THIS_ HWND hwndOwner, LPBC pbc, LPOLESTR pszDisplayName,
  7427. ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
  7428. STDMETHOD(EnumObjects) (THIS_ HWND hwndOwner, DWORD grfFlags, IEnumIDList ** ppenumIDList) PURE;
  7429. STDMETHOD(BindToObject) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  7430. STDMETHOD(BindToStorage) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  7431. STDMETHOD(CompareIDs) (THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  7432. STDMETHOD(CreateViewObject) (THIS_ HWND hwndOwner, REFIID riid, void **ppv) PURE;
  7433. STDMETHOD(GetAttributesOf) (THIS_ UINT cidl, LPCITEMIDLIST * apidl,
  7434. ULONG * rgfInOut) PURE;
  7435. STDMETHOD(GetUIObjectOf) (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  7436. REFIID riid, UINT * prgfInOut, void **ppv) PURE;
  7437. STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
  7438. STDMETHOD(SetNameOf) (THIS_ HWND hwndOwner, LPCITEMIDLIST pidl,
  7439. LPCOLESTR pszName, DWORD uFlags,
  7440. LPITEMIDLIST * ppidlOut) PURE;
  7441. // *** IMenuShellFolder methods ***
  7442. STDMETHOD(SetMenu) (THIS_ HMENU hmenu) PURE;
  7443. STDMETHOD(GetMenu) (THIS_ HMENU * phmenu) PURE;
  7444. STDMETHOD(SetWindow) (THIS_ HWND hwndOwner) PURE;
  7445. STDMETHOD(GetWindow) (THIS_ HWND *phwndOwner) PURE;
  7446. STDMETHOD(GetIDPosition) (THIS_ LPCITEMIDLIST pidl, int * pnPos) PURE;
  7447. };
  7448. //-------------------------------------------------------------------------
  7449. //
  7450. // ITranslateShellChangeNotify interface
  7451. //
  7452. // This interface allows an object to translate the pidls that are
  7453. // passed to it.
  7454. //
  7455. // Note: IE4 had an interface of the same name but with a different IID,
  7456. // so there is no conflict.
  7457. //
  7458. // [Member functions]
  7459. //
  7460. // ITranslateShellChangeNotify::TranslateIDs(&lEvent, pidl1, pidl2, ppidlOut1, ppidlOut2)
  7461. // Return converted pidls given the event. it also can change the event if appropriate
  7462. //
  7463. //-------------------------------------------------------------------------
  7464. #undef INTERFACE
  7465. #define INTERFACE ITranslateShellChangeNotify
  7466. DECLARE_INTERFACE_(ITranslateShellChangeNotify, IUnknown)
  7467. {
  7468. // *** IUnknown methods ***
  7469. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7470. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7471. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7472. // *** ITranslateShellChangeNotify methods ***
  7473. STDMETHOD(TranslateIDs) (THIS_ LONG *plEvent , LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, LPITEMIDLIST * ppidlOut1, LPITEMIDLIST * ppidlOut2,
  7474. LONG *plEvent2, LPITEMIDLIST * ppidlOut1Event2, LPITEMIDLIST * ppidlOut2Event2) PURE;
  7475. STDMETHOD(IsChildID)(THIS_ LPCITEMIDLIST pidlKid, BOOL fImmediate) PURE;
  7476. STDMETHOD(IsEqualID)(THIS_ LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  7477. STDMETHOD(Register)(THIS_ HWND hwnd, UINT uMsg, long lEvents) PURE;
  7478. STDMETHOD(Unregister)(THIS) PURE;
  7479. };
  7480. ////////////////////////////////////////////////////
  7481. //
  7482. // IRegTreeOptions
  7483. //
  7484. typedef enum tagBUTTON_STATES
  7485. {
  7486. IDCHECKED,
  7487. IDUNCHECKED,
  7488. IDRADIOON,
  7489. IDRADIOOFF,
  7490. IDUNKNOWN
  7491. } BUTTON_STATES;
  7492. //
  7493. // Avoid conflicts in the windows\shell project
  7494. //
  7495. #ifndef NO_SHELL_TREE_TYPE
  7496. typedef enum tagTREE_TYPE
  7497. {
  7498. TREE_CHECKBOX,
  7499. TREE_RADIO,
  7500. TREE_GROUP,
  7501. TREE_UNKNOWN
  7502. } TREE_TYPE;
  7503. #endif // NO_SHELL_TREE_TYPE
  7504. typedef enum tagWALK_TREE_CMD
  7505. {
  7506. WALK_TREE_SAVE,
  7507. WALK_TREE_DELETE,
  7508. WALK_TREE_RESTORE,
  7509. WALK_TREE_REFRESH
  7510. } WALK_TREE_CMD;
  7511. enum REG_CMD
  7512. {
  7513. REG_SET,
  7514. REG_GET,
  7515. REG_GETDEFAULT
  7516. };
  7517. #undef INTERFACE
  7518. #define INTERFACE IRegTreeOptions
  7519. DECLARE_INTERFACE_(IRegTreeOptions, IUnknown)
  7520. {
  7521. // *** IUnknown methods ***
  7522. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7523. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7524. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7525. // *** IRegTreeOptions specific methods ***
  7526. STDMETHOD(InitTree)(THIS_ HWND hwndTree, HKEY hkeyRoot, LPCSTR pszRegKey, LPCSTR pszParam) PURE;
  7527. STDMETHOD(WalkTree)(THIS_ WALK_TREE_CMD cmd ) PURE;
  7528. STDMETHOD(ToggleItem)(THIS_ HTREEITEM hti ) PURE;
  7529. STDMETHOD(ShowHelp)(THIS_ HTREEITEM hti , DWORD dwFlags ) PURE;
  7530. };
  7531. //
  7532. // Interface: IShellHotKey
  7533. //
  7534. #undef INTERFACE
  7535. #define INTERFACE IShellHotKey
  7536. DECLARE_INTERFACE_(IShellHotKey, IUnknown)
  7537. {
  7538. // *** IUnknown methods ***
  7539. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7540. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7541. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7542. // *** IShellHotKey methods ***
  7543. STDMETHOD(RegisterHotKey)(THIS_ IShellFolder * psf, LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidl) PURE;
  7544. };
  7545. //
  7546. // Interface: ITrayPriv
  7547. //
  7548. // Purpose: Talks to the new Start Menu code in Shdocvw from explorer.exe
  7549. //
  7550. // For flags on ShowFolder see inc\IETHREAD.H
  7551. //
  7552. #undef INTERFACE
  7553. #define INTERFACE ITrayPriv
  7554. DECLARE_INTERFACE_(ITrayPriv, IOleWindow)
  7555. {
  7556. // *** IUnknown methods ***
  7557. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7558. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7559. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7560. // *** IOleWindow methods ***
  7561. STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  7562. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  7563. // *** ITrayPriv methods ***
  7564. STDMETHOD(ExecItem)(THIS_ IShellFolder* psf, LPCITEMIDLIST pidl) PURE;
  7565. STDMETHOD(GetFindCM)(THIS_ HMENU hmenu, UINT idFirst, UINT idLast, IContextMenu** ppcmFind) PURE;
  7566. STDMETHOD(GetStaticStartMenu)(THIS_ HMENU* phmenu) PURE;
  7567. };
  7568. // ITrayPriv2 - new for Whistler
  7569. //
  7570. // Purpose: Allows Explorer Start Menu object to participate in customdraw.
  7571. //
  7572. #undef INTERFACE
  7573. #define INTERFACE ITrayPriv2
  7574. DECLARE_INTERFACE_(ITrayPriv2, ITrayPriv)
  7575. {
  7576. // *** IUnknown methods ***
  7577. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7578. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7579. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7580. // *** IOleWindow methods ***
  7581. STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  7582. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  7583. // *** ITrayPriv methods ***
  7584. STDMETHOD(ExecItem)(THIS_ IShellFolder* psf, LPCITEMIDLIST pidl) PURE;
  7585. STDMETHOD(GetFindCM)(THIS_ HMENU hmenu, UINT idFirst, UINT idLast, IContextMenu** ppcmFind) PURE;
  7586. STDMETHOD(GetStaticStartMenu)(THIS_ HMENU* phmenu) PURE;
  7587. // *** ITrayPriv2 methods ***
  7588. STDMETHOD(ModifySMInfo)(THIS_ IN LPSMDATA psmd, IN OUT SMINFO *psminfo) PURE;
  7589. };
  7590. ;end_internal
  7591. #undef INTERFACE
  7592. #define INTERFACE IInitializeObject
  7593. DECLARE_INTERFACE_(IInitializeObject, IUnknown)
  7594. {
  7595. // *** IUnknown methods ***
  7596. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7597. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7598. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7599. // *** IInitializeObject methods
  7600. STDMETHOD(Initialize)(THIS) PURE;
  7601. };
  7602. enum
  7603. {
  7604. BMICON_LARGE = 0,
  7605. BMICON_SMALL
  7606. };
  7607. #undef INTERFACE
  7608. #define INTERFACE IBanneredBar
  7609. DECLARE_INTERFACE_(IBanneredBar, IUnknown)
  7610. {
  7611. // *** IUnknown methods ***
  7612. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7613. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7614. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7615. // *** IBanneredBar methods ***
  7616. STDMETHOD(SetIconSize)(THIS_ DWORD iIcon) PURE;
  7617. STDMETHOD(GetIconSize)(THIS_ DWORD* piIcon) PURE;
  7618. STDMETHOD(SetBitmap)(THIS_ HBITMAP hBitmap) PURE;
  7619. STDMETHOD(GetBitmap)(THIS_ HBITMAP* phBitmap) PURE;
  7620. };
  7621. ;begin_internal
  7622. //
  7623. // Interface: IFolderShortcutConvert
  7624. //
  7625. // Purpose: Converts between FolderShortcuts and links
  7626. //
  7627. #undef INTERFACE
  7628. #define INTERFACE IFolderShortcutConvert
  7629. DECLARE_INTERFACE_(IFolderShortcutConvert, IUnknown)
  7630. {
  7631. // *** IUnknown methods ***
  7632. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  7633. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  7634. STDMETHOD_(ULONG,Release)(THIS) PURE;
  7635. //*** IFolderShortcutConvert methods ***
  7636. STDMETHOD(ConvertToLink)(THIS_ LPCOLESTR pszFSPath, DWORD fFlags) PURE;
  7637. STDMETHOD(ConvertToFolderShortcut)(THIS_ LPCOLESTR pszLinkPath, DWORD fFlags) PURE;
  7638. };
  7639. //
  7640. // Interface: IShellFolderTask
  7641. //
  7642. // Purpose: Initializes a task that does something by enumerating a shellfolder
  7643. //
  7644. #undef INTERFACE
  7645. #define INTERFACE IShellFolderTask
  7646. DECLARE_INTERFACE_(IShellFolderTask, IUnknown)
  7647. {
  7648. // *** IUnknown methods ***
  7649. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  7650. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  7651. STDMETHOD_(ULONG,Release)(THIS) PURE;
  7652. // *** IShellFolderTask methods ***
  7653. STDMETHOD(InitTaskSFT)(THIS_ IShellFolder *psfParent, LPITEMIDLIST pidlFull,
  7654. LONG nMaxRecursionLevel, DWORD dwFlags, DWORD dwTaskPriority) PURE;
  7655. };
  7656. // Flags for InitTaskSFT
  7657. #define ITSFT_RECURSE 0x00000001 // recurse into subfolders
  7658. //
  7659. // Interface: IStartMenuTask
  7660. //
  7661. // Purpose: Initializes a task that does something for the start menu
  7662. //
  7663. #undef INTERFACE
  7664. #define INTERFACE IStartMenuTask
  7665. DECLARE_INTERFACE_(IStartMenuTask, IShellFolderTask)
  7666. {
  7667. // *** IUnknown methods ***
  7668. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  7669. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  7670. STDMETHOD_(ULONG,Release)(THIS) PURE;
  7671. // *** IShellFolderTask methods ***
  7672. STDMETHOD(InitTaskSFT)(THIS_ IShellFolder *psfParent, LPITEMIDLIST pidlFull,
  7673. LONG nMaxRecursionLevel, DWORD dwFlags, DWORD dwTaskPriority) PURE;
  7674. // *** IStartMenuTask methods ***
  7675. STDMETHOD(InitTaskSMT)(THIS_ IShellHotKey * photkey, int iThreadPriority) PURE;
  7676. };
  7677. //
  7678. // Interface: IContextMenuCB
  7679. //
  7680. // Purpose: A call defview context menu callback object
  7681. //
  7682. #undef INTERFACE
  7683. #define INTERFACE IContextMenuCB
  7684. DECLARE_INTERFACE_(IContextMenuCB, IUnknown)
  7685. {
  7686. // *** IUnknown methods ***
  7687. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7688. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7689. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7690. // *** IContextMenuCB methods ***
  7691. STDMETHOD(CallBack) (THIS_ IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg,
  7692. WPARAM wParam, LPARAM lParam) PURE;
  7693. };
  7694. //
  7695. // Possible underline settings for shell icons.
  7696. //
  7697. enum
  7698. {
  7699. ICON_YES,
  7700. ICON_NO,
  7701. ICON_HOVER,
  7702. ICON_IE // Use IE hyperlink settings
  7703. };
  7704. //-----------------------------------------------
  7705. // IOleCommand Target Command IDs
  7706. // CGID_BandHandler
  7707. // Get the order stream from parent.
  7708. #define BHCMDID_GetOrderStream 0x00000001
  7709. // CGID_Persist
  7710. // Set the storage key.
  7711. #define MCBID_SetKey 0x00000001
  7712. // CGID_MenuBandItem
  7713. #define MBICMDID_IsVisible 0x00000001
  7714. // CGID_MenuBand
  7715. #define MBANDCID_REFRESH 0x10000000
  7716. //
  7717. // Interface: IShellMallocSpy
  7718. //
  7719. // Purpose: Facilitate IMallocSpy in the shell
  7720. //
  7721. #undef INTERFACE
  7722. #define INTERFACE IShellMallocSpy
  7723. DECLARE_INTERFACE_(IShellMallocSpy, IUnknown)
  7724. {
  7725. // *** IUnknown methods ***
  7726. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7727. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7728. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7729. // *** IShellMallocSpy methods ***
  7730. STDMETHOD(RegisterSpy) (THIS) PURE;
  7731. STDMETHOD(RevokeSpy) (THIS) PURE;
  7732. STDMETHOD(SetTracking) (THIS_ BOOL bTrack) PURE;
  7733. STDMETHOD(AddToList) (THIS_ void *pv, SIZE_T cb) PURE;
  7734. STDMETHOD(RemoveFromList) (THIS_ void *pv) PURE;
  7735. };
  7736. #undef INTERFACE
  7737. #define INTERFACE ISearchProvider
  7738. DECLARE_INTERFACE_(ISearchProvider, IUnknown)
  7739. {
  7740. // *** IUnknown methods ***
  7741. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7742. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7743. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7744. // *** ISearchObject methods ***
  7745. STDMETHOD(GetSearchGUID)(THIS_ LPGUID lpGuid) PURE;
  7746. };
  7747. #undef INTERFACE
  7748. #define INTERFACE ISearchItems
  7749. DECLARE_INTERFACE_(ISearchItems, IUnknown)
  7750. {
  7751. // *** IUnknown methods ***
  7752. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7753. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7754. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7755. // *** ISearchItems methods ***
  7756. //used by CSearchBand
  7757. STDMETHOD(GetDefaultSearchUrl) (THIS_ LPWSTR pwzUrl, UINT cch) PURE;
  7758. };
  7759. #undef INTERFACE
  7760. #define INTERFACE ISearchBandTBHelper50
  7761. DECLARE_INTERFACE_(ISearchBandTBHelper50, IUnknown)
  7762. {
  7763. // *** IUnknown methods ***
  7764. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7765. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7766. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7767. // *** ISearchBandTBHelper50 methods ***
  7768. // implemented by CSearchBand
  7769. STDMETHOD(AddNextMenuItem) (THIS_ LPCWSTR pwszText, int idItem) PURE;
  7770. STDMETHOD(SetOCCallback) (THIS_ IOleCommandTarget *pOleCmdTarget) PURE;
  7771. STDMETHOD(ResetNextMenu) (THIS) PURE;
  7772. };
  7773. #undef INTERFACE
  7774. #define INTERFACE ISearchBandTBHelper
  7775. DECLARE_INTERFACE_(ISearchBandTBHelper, IUnknown)
  7776. {
  7777. // *** IUnknown methods ***
  7778. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7779. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7780. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7781. // *** ISearchBandTBHelper methods ***
  7782. // implemented by CSearchBand
  7783. STDMETHOD(AddNextMenuItem) (THIS_ LPCWSTR pwszText, int idItem) PURE;
  7784. STDMETHOD(SetOCCallback) (THIS_ IOleCommandTarget *pOleCmdTarget) PURE;
  7785. STDMETHOD(ResetNextMenu) (THIS) PURE;
  7786. STDMETHOD(NavigateToPidl) (THIS_ LPCITEMIDLIST pidl) PURE;
  7787. };
  7788. #undef INTERFACE
  7789. #define INTERFACE IEnumUrlSearch
  7790. #include <pshpack8.h>
  7791. typedef struct
  7792. {
  7793. GUID guid;
  7794. WCHAR wszName[80];
  7795. WCHAR wszUrl[2048];
  7796. } URLSEARCH, *LPURLSEARCH;
  7797. #include <poppack.h> /* Return to byte packing */
  7798. DECLARE_INTERFACE_(IEnumUrlSearch, IUnknown)
  7799. {
  7800. // *** IUnknown methods ***
  7801. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE;
  7802. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7803. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7804. // *** IEnumUrlSearch methods ***
  7805. STDMETHOD(Next)(THIS_ ULONG celt, LPURLSEARCH rgelt, ULONG *pceltFetched) PURE;
  7806. STDMETHOD(Skip)(THIS_ ULONG celt) PURE;
  7807. STDMETHOD(Reset)(THIS) PURE;
  7808. STDMETHOD(Clone)(THIS_ IEnumUrlSearch **ppenum) PURE;
  7809. };
  7810. #undef INTERFACE
  7811. #define INTERFACE IFolderSearches
  7812. DECLARE_INTERFACE_(IFolderSearches, IUnknown)
  7813. {
  7814. // *** IUnknown methods ***
  7815. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE;
  7816. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7817. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7818. // *** IFolderSearches methods ***
  7819. STDMETHOD(EnumSearches) (THIS_ IEnumUrlSearch **ppenum) PURE;
  7820. STDMETHOD(DefaultSearch) (THIS_ GUID *pguid) PURE;
  7821. };
  7822. #undef INTERFACE
  7823. #define INTERFACE IUserAssist
  7824. typedef struct
  7825. {
  7826. DWORD cbSize; // SIZEOF
  7827. DWORD dwMask; // INOUT requested/given (UEIM_*)
  7828. int cHit; // profile count
  7829. DWORD dwAttrs; // attributes (UEIA_*)
  7830. FILETIME ftExecute; // Last execute filetime
  7831. } UEMINFO, *LPUEMINFO;
  7832. #define UEIM_HIT 0x01
  7833. #define UEIM_FILETIME 0x02
  7834. DECLARE_INTERFACE_(IUserAssist, IUnknown)
  7835. {
  7836. // *** IUnknown methods ***
  7837. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7838. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7839. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7840. // *** IUserAssist methods ***
  7841. STDMETHOD(FireEvent)(THIS_ const GUID *pguidGrp, int eCmd, DWORD dwFlags, WPARAM wParam, LPARAM lParam) PURE;
  7842. STDMETHOD(QueryEvent)(THIS_ const GUID *pguidGrp, int eCmd, WPARAM wParam, LPARAM lParam, LPUEMINFO pui) PURE;
  7843. STDMETHOD(SetEvent)(THIS_ const GUID *pguidGrp, int eCmd, WPARAM wParam, LPARAM lParam, LPUEMINFO pui) PURE;
  7844. };
  7845. // This exists for the Internet Control Panel to be able to toggle who is the
  7846. // currently installed handler for FTP for the browser.
  7847. DECLARE_INTERFACE_(IFtpInstaller, IUnknown)
  7848. {
  7849. // *** IUnknown methods ***
  7850. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7851. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7852. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7853. // *** IFtpInstaller methods ***
  7854. STDMETHOD(IsIEDefautlFTPClient)(THIS) PURE;
  7855. STDMETHOD(RestoreFTPClient)(THIS) PURE;
  7856. STDMETHOD(MakeIEDefautlFTPClient)(THIS) PURE;
  7857. };
  7858. // DOC'ed for DOJ compliance
  7859. ;end_internal
  7860. SHSTDAPI_(LRESULT) SHShellFolderView_Message(HWND hwndMain, UINT uMsg, LPARAM lParam);
  7861. //
  7862. // Callback interface for the IShellFolderView
  7863. //
  7864. #undef INTERFACE
  7865. #define INTERFACE IShellFolderViewCB
  7866. DECLARE_INTERFACE_(IShellFolderViewCB, IUnknown)
  7867. {
  7868. // *** IUnknown methods ***
  7869. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7870. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7871. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7872. // *** IShellFolderViewCB methods ***
  7873. STDMETHOD(MessageSFVCB)(THIS_ UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  7874. };
  7875. ;begin_internal
  7876. #define CLR_MYINVALID 0x8fffffff // I need to use a special value since CLR_INVALID == CLR_NONE!!!!
  7877. #define ISVALIDCOLOR(a) ((a) != CLR_MYINVALID)
  7878. // The following are used as indexes into the crCustomColors array.
  7879. #define CRID_CUSTOMTEXTBACKGROUND 0
  7880. #define CRID_CUSTOMTEXT 1
  7881. #define CRID_COLORCOUNT 2
  7882. typedef struct _CUSTOMVIEWSDATA
  7883. {
  7884. DWORD cchSizeOfBlock; // size of lpDataBlock in WCHARs
  7885. LPWSTR lpDataBlock; // Pointer to the Strings data block, allocated by the task allocator (SHAlloc)
  7886. // The following are offsets (in WCHARs) to be added to lpDataBlock.
  7887. // If the offset is -1 => That data is not present for this view.
  7888. int acchOffExtViewUIstr[6]; // ID_EXTVIEWSTRCOUNT was 6, but is no longer used
  7889. COLORREF crCustomColors[CRID_COLORCOUNT];
  7890. // Once IE4 ships, we can extend this structure by adding new SFVF_ flags
  7891. // in the main structure that say "customviewsdata contains xxx info".
  7892. } CUSTOMVIEWSDATA;
  7893. //
  7894. // Interface for enumerating "external" views for the ShellFolderView
  7895. //
  7896. typedef struct _SFVVIEWSDATA
  7897. {
  7898. // idView specifies the view. Unless specified in pCustomData, look up
  7899. // HKLM\CLSID\Software\Microsoft\Windows\CurrentVersion\ExtShellFolderViews\idView
  7900. // to find the menu name, help text, tt text.
  7901. //
  7902. // the shell's IShellFolderView implementations get these as
  7903. // subkeys of the shellex\ExtShellFolderViews key under the folder's
  7904. // clsid type (or progid type, depending on the IShellFolderView impl).
  7905. //
  7906. // In desktop.ini, these are keys read from the [ExtShellFolderViews]
  7907. // section, in the form of "{idView}" or "{idView}={idExtShellView}"
  7908. //
  7909. GUID idView; // This is the GUID that specifies the View.
  7910. // idExtShellView specifies the IDefViewExtInit IShellView extension
  7911. // to use for this view.
  7912. //
  7913. // the shell's IShellFolderView implementations get this from
  7914. // the "ISV" value under the shellex\ExtShellFolderViews\{idView}
  7915. // key in the registry.
  7916. //
  7917. // In desktop.ini, this is read from the [ExtShellFolderViews]
  7918. // section, in the form of "{idView}={idExtShellView}"
  7919. //
  7920. GUID idExtShellView; // [optional] This is the GUID for the extended IShellView
  7921. // dwFlags - see the SFVF_ flags below.
  7922. //
  7923. // the shell's IShellFolderView implementations get this from
  7924. // the "Attributes" value under the shellex\ExtShellFolderViews\{idView}
  7925. // key in the registry.
  7926. //
  7927. // In desktop.ini, this is read from the [{idView}] section,
  7928. // from the "Attributes=" line.
  7929. //
  7930. DWORD dwFlags;
  7931. // lParam is passed to IShellView view extensions
  7932. //
  7933. // the shell's IShellFolderView implementations get this from
  7934. // the "lparam" value under the shellex\ExtShellFolderViews\{idView}
  7935. // key in the registry.
  7936. //
  7937. // In desktop.ini, this is read from the [{idView}] section,
  7938. // from the "LParam=" line.
  7939. //
  7940. DWORD lParam;
  7941. // wszMoniker is used to either bind to a docobject extended view,
  7942. // or as the data for an idExtShellView view.
  7943. //
  7944. // the shell's IShellFolderView implementations get this from
  7945. // the "PersistMoniker" value under the shellex\ExtShellFolderViews\{idView}
  7946. // key in the registry.
  7947. //
  7948. // In desktop.ini, this is read from the [{idView}] section,
  7949. // from the "PersistMoniker=" line.
  7950. //
  7951. WCHAR wszMoniker[MAX_PATH];
  7952. // pCustomData overrides/provides menu and other ui options
  7953. // for this view. If a WebViewFolderContents OC appears in the
  7954. // docobject extended view, it pays attention to color and
  7955. // background bitmaps.
  7956. //
  7957. // the shell's IShellFolderView implementations do not fill out this structure.
  7958. //
  7959. // In desktop.ini, this is read from the [{idView}] section,
  7960. // from the "IconArea_Image", "IconArea_TextBackground", and "IconArea_Text".
  7961. //
  7962. CUSTOMVIEWSDATA *pCustomData; //This is valid only if SFVF_CUSTOMIZEDVIEW is set.
  7963. } SFVVIEWSDATA;
  7964. //
  7965. // SFVF_CUSTOMIZEDVIEW - This flag is set only for those views whose
  7966. // data are picked up from the Desktop.ini.
  7967. //
  7968. #define SFVF_CUSTOMIZEDVIEW 0x80000000
  7969. //
  7970. // SFVF_TREATASNORMAL - This flag is set for those views that wish to
  7971. // be treated as normal views, this means they will show up in the file-open/SaveAs
  7972. // Dialogs.
  7973. //
  7974. #define SFVF_TREATASNORMAL 0x40000000
  7975. //
  7976. // SFVF_NOWEBVIEWFOLDERCONTENTS - This is used to detect those views that
  7977. // never host the WebViewFolderContents OC and so cannot toggle on and off,
  7978. // ie, they are exclusive views such as Thumbnail View.
  7979. //
  7980. #define SFVF_NOWEBVIEWFOLDERCONTENTS 0x20000000
  7981. #undef INTERFACE
  7982. #define INTERFACE IEnumSFVViews
  7983. DECLARE_INTERFACE_(IEnumSFVViews, IUnknown)
  7984. {
  7985. // *** IUnknown methods ***
  7986. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  7987. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  7988. STDMETHOD_(ULONG,Release) (THIS) PURE;
  7989. // *** IEnumSFVViews methods ***
  7990. STDMETHOD(Next) (THIS_ ULONG celt,
  7991. SFVVIEWSDATA **ppData,
  7992. ULONG *pceltFetched) PURE;
  7993. STDMETHOD(Skip) (THIS_ ULONG celt) PURE;
  7994. STDMETHOD(Reset) (THIS) PURE;
  7995. STDMETHOD(Clone) (THIS_ IEnumSFVViews **ppenum) PURE;
  7996. };
  7997. #undef INTERFACE
  7998. #define INTERFACE IPersistString
  7999. DECLARE_INTERFACE_(IPersistString, IUnknown)
  8000. {
  8001. // *** IUnknown methods ***
  8002. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  8003. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  8004. STDMETHOD_(ULONG,Release) (THIS) PURE;
  8005. // *** IPersist methods ***
  8006. STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  8007. // *** IPersistString methods ***
  8008. STDMETHOD(Initialize) (THIS_ LPCWSTR pwszInit) PURE;
  8009. };
  8010. #pragma warning (disable: 4200)
  8011. #pragma warning (disable: 4510)
  8012. #pragma warning (disable: 4512)
  8013. #pragma warning (disable: 4610)
  8014. // From sdkinc\platform.h
  8015. // We can't simply include that file because it breaks other projects
  8016. // that include platform.h.
  8017. // DOC'ed for DOJ compliance:
  8018. ;end_internal
  8019. ;begin_both
  8020. #include <pshpack8.h>
  8021. ;end_both
  8022. #undef UNSIZED_ARRAY2
  8023. #undef EMPTY_SIZE2
  8024. #define UNSIZED_ARRAY2
  8025. #define EMPTY_SIZE2 UNSIZED_ARRAY2
  8026. #define QCMINFO_PLACE_BEFORE 0
  8027. #define QCMINFO_PLACE_AFTER 1
  8028. typedef struct _QCMINFO_IDMAP_PLACEMENT
  8029. {
  8030. UINT id;
  8031. UINT fFlags;
  8032. } QCMINFO_IDMAP_PLACEMENT;
  8033. typedef struct _QCMINFO_IDMAP
  8034. {
  8035. UINT nMaxIds;
  8036. QCMINFO_IDMAP_PLACEMENT pIdList[1];
  8037. } QCMINFO_IDMAP;
  8038. typedef struct _QCMINFO
  8039. {
  8040. HMENU hmenu; // in
  8041. UINT indexMenu; // in
  8042. UINT idCmdFirst; // in/out
  8043. UINT idCmdLast; // in
  8044. QCMINFO_IDMAP const* pIdMap; // in / unused
  8045. } QCMINFO;
  8046. typedef QCMINFO * LPQCMINFO;
  8047. // TBINFO flags
  8048. #define TBIF_APPEND 0
  8049. #define TBIF_PREPEND 1
  8050. #define TBIF_REPLACE 2
  8051. #define TBIF_DEFAULT 0x00000000
  8052. #define TBIF_INTERNETBAR 0x00010000
  8053. #define TBIF_STANDARDTOOLBAR 0x00020000
  8054. #define TBIF_NOTOOLBAR 0x00030000
  8055. typedef struct _TBINFO
  8056. {
  8057. UINT cbuttons; // out
  8058. UINT uFlags; // out (one of TBIF_ flags)
  8059. } TBINFO;
  8060. ;begin_internal
  8061. typedef struct _SFVM_SELCHANGE_DATA
  8062. {
  8063. UINT uOldState;
  8064. UINT uNewState;
  8065. LPARAM lParamItem;
  8066. } SFVM_SELCHANGE_DATA;
  8067. typedef struct _COPYHOOKINFO
  8068. {
  8069. HWND hwnd;
  8070. DWORD wFunc;
  8071. DWORD wFlags;
  8072. LPCTSTR pszSrcFile;
  8073. DWORD dwSrcAttribs;
  8074. LPCTSTR pszDestFile;
  8075. DWORD dwDestAttribs;
  8076. } COPYHOOKINFO;
  8077. ;end_internal
  8078. typedef struct _DETAILSINFO
  8079. {
  8080. LPCITEMIDLIST pidl;
  8081. int fmt;
  8082. int cxChar;
  8083. STRRET str;
  8084. int iImage;
  8085. } DETAILSINFO;
  8086. typedef struct _SFVM_PROPPAGE_DATA
  8087. {
  8088. DWORD dwReserved;
  8089. LPFNADDPROPSHEETPAGE pfn;
  8090. LPARAM lParam;
  8091. } SFVM_PROPPAGE_DATA;
  8092. typedef struct _SFVM_HELPTOPIC_DATA
  8093. {
  8094. WCHAR wszHelpFile[MAX_PATH];
  8095. WCHAR wszHelpTopic[MAX_PATH];
  8096. } SFVM_HELPTOPIC_DATA;
  8097. ;begin_internal
  8098. typedef struct
  8099. {
  8100. DWORD bWantWebview; // in: caller should return template
  8101. DWORD dwOptions; // out: SFVMQVI_ flags
  8102. WCHAR szWebView[MAX_PATH]; // out: webview template path
  8103. } SFVM_VIEWINFO_DATA;
  8104. typedef struct
  8105. {
  8106. DWORD dwOptions; // out: SFVMQVI_ flags for the [in,wParam]uViewMode
  8107. } SFVM_VIEW_DATA;
  8108. // dwOptions control the state of corresponding [in,wParam]uViewMode:
  8109. #define SFVMQVI_NORMAL 0x0 // out: let defview decide what to do
  8110. #define SFVMQVI_INCLUDE 0x1 // out: force include
  8111. #define SFVMQVI_EXCLUDE 0x2 // out: force exclude
  8112. typedef struct
  8113. {
  8114. FOLDERVIEWMODE fvm; // out: view mode
  8115. BOOL fGroupView; // out: group view on/off
  8116. UINT uSortCol; // out: sort by scid
  8117. int iSortDirection; // out: ascending or descending sort
  8118. FOLDERFLAGS fFlags; // out: folder flags to set (supports FWF_AUTOARRANGE)
  8119. } SFVM_DEFERRED_VIEW_SETTINGS;
  8120. typedef struct
  8121. {
  8122. WCHAR szWebView[MAX_PATH]; // out: webview template path for [in,wParam]uViewMode
  8123. } SFVM_WEBVIEW_TEMPLATE_DATA;
  8124. typedef struct _SFVM_CUSTOMVIEWINFO_DATA
  8125. {
  8126. COLORREF crCustomColors[CRID_COLORCOUNT];
  8127. WCHAR szIconAreaImage[MAX_PATH]; // Note: the old struct used INTERNET_MAX_URL_LENGTH, but we only use local cases so this isn't needed
  8128. } SFVM_CUSTOMVIEWINFO_DATA;
  8129. typedef struct
  8130. {
  8131. DWORD dwLayout; // out: SFVMWLV_ for [in,wParam]uViewMode
  8132. IUnknown* punkPreview; // out: IUnknown of preview control, if SFVMWVL_PREVIEW specified
  8133. } SFVM_WEBVIEW_LAYOUT_DATA;
  8134. // dwLayout:
  8135. #define SFVMWVL_NORMAL 0 // standard Web View format
  8136. #define SFVMWVL_PREVIEW 1 // "preview" Web View format
  8137. #define SFVMWVL_DETAILS 2 // standard Web View format with details expanded by default
  8138. #define SFVMWVL_ITEMS 0x00000000 // HACK (added for Whistler, remove in BlackComb): item Web View format
  8139. #define SFVMWVL_FILES 0x00010000 // HACK (added for Whistler, remove in BlackComb): file Web View format
  8140. #define SFVMWVL_NOPRINT 0x00020000 // HACK (added for Whistler, remove in BlackComb): unconditionally hide "Print this file" folder task
  8141. #define SFVMWVL_NOPUBLISH 0x00040000 // HACK (added for Whistler, remove in BlackComb): unconditionally hide "Publish this file" folder task
  8142. #define SFVMWVL_ORDINAL_MASK 0x0000ffff // HACK (added for Whistler, remove in BlackComb): overload dwLayout for ordinals and flags
  8143. #define SFVMWVL_FLAGS_MASK 0xffff0000 // HACK (added for Whistler, remove in BlackComb): overload dwLayout for ordinals and flags
  8144. typedef struct
  8145. {
  8146. DWORD dwFlags;
  8147. IUIElement* pIntroText; // can be NULL for no explanatory text
  8148. IUIElement* pSpecialTaskHeader; // can be NULL for no special task section
  8149. IUIElement* pFolderTaskHeader; // if NULL, defview will provide a default folder task section
  8150. IEnumIDList* penumOtherPlaces; // if NULL, defview will provide a default Other Places list
  8151. } SFVM_WEBVIEW_CONTENT_DATA;
  8152. // dwFlags:
  8153. #define SFVMWVF_BARRICADE 0x00000001 // this is a barricaded folder
  8154. #define SFVMWVF_ENUMTASKS 0x00000002 // Folder uses non-standard tasks. Will enumerate.
  8155. #define SFVMWVF_NOMORETASKS 0x00000004 // No more tasks in enumeration.
  8156. #define SFVMWVF_SPECIALTASK 0x00000008 // Used in ENUMTASKSECTION_DATA.dwFlags.
  8157. #define SFVMWVF_CONTENTSCHANGE 0x00000010 // Refresh WV content when folder contents change.
  8158. typedef struct
  8159. {
  8160. IEnumUICommand* penumSpecialTasks; // can be NULL for no special task section
  8161. IEnumUICommand* penumFolderTasks; // if NULL, defview will provide a default folder task section
  8162. DWORD dwUpdateFlags; // bitmask of the extra special events that we should listen to
  8163. } SFVM_WEBVIEW_TASKSECTION_DATA;
  8164. // dwUpdateFlags:
  8165. #define SFVMWVTSDF_CONTENTSCHANGE 0x00000001
  8166. typedef struct
  8167. {
  8168. LPCWSTR pszThemeID; // [out] fill with a pointer a string who's lifetime is at least as long as your IShellFolderViewCB object.
  8169. } SFVM_WEBVIEW_THEME_DATA;
  8170. //
  8171. // To replace the standard webview tasks with a set enumerated by the view
  8172. // callback, the callback sets the SFVMWVF_ENUMTASKS flag in the dwFlags
  8173. // member of SFVM_WEBVIEWCONTENT_DATA. This causes the shell to send
  8174. // SFVM_ENUMWEBVIEWTASKS repeatedly in place of SFVM_GETWEBVIEWCONTENT and
  8175. // SFVM_GETWEBVIEWTASKS. Each time SFVM_ENUMWEBVIEWTASKS is sent,
  8176. // the view callback provides a header and task enumerator via a
  8177. // SFVM_WEBVIEW_ENUMTASKSECTION_DATA structure. The message is sent to the
  8178. // view repeatedly until the handler sets the SFVMWVF_NOMORETASKS flag
  8179. // in SFVM_WEBVIEW_ENUMTASKSECTION_DATA.dwFlags. The top-down display order
  8180. // of task sections is the same as the order in which they are provided by
  8181. // the view callback.
  8182. //
  8183. // The dwFlags member of SFVM_WEBVIEW_ENUMTASKSECTION_DATA supports
  8184. // the following values:
  8185. // SFVMWVF_SPECIALTASK - Use the 'special' task section style.
  8186. // If not set, use the 'normal' style.
  8187. // SFVMWVF_NOMORETASKS - Terminate the enumeration.
  8188. //
  8189. typedef struct
  8190. {
  8191. DWORD dwFlags; // SFVMWVF_XXXX flags. See above.
  8192. IUIElement *pHeader;
  8193. IEnumUICommand *penumTasks;
  8194. int idBitmap; // Valid only for SPECIALTASK sections.
  8195. int idWatermark; // Valid only for SPECIALTASK sections.
  8196. } SFVM_WEBVIEW_ENUMTASKSECTION_DATA;
  8197. // WebView Task helper functions provided by shell32
  8198. // to help answer SFVM_GETWEBVIEWCONTENT and SFVM_GETWEBVIEWTASKS messages.
  8199. //
  8200. // The idea here being that you provide task implementations in the static
  8201. // functions with a pv parameter that gets passed through to your static functions
  8202. // so they can get back to your IShellFolderViewCB object. These helper
  8203. // functions assume that all strings are resources to be loaded out of your DLL.
  8204. //
  8205. typedef HRESULT (*PFN_get_State)(IUnknown* pv,IShellItemArray *psiItemArray, BOOL fOkToBeSlow, UISTATE* puisState);
  8206. typedef HRESULT (*PFN_Invoke)(IUnknown* pv,IShellItemArray *psiItemArray, IBindCtx *pbc);
  8207. typedef struct {
  8208. const GUID* pguidCanonicalName;
  8209. LPCWSTR pszDllName;
  8210. DWORD dwTitleIndexNoSelection;
  8211. DWORD dwTitleIndexFileSelected;
  8212. DWORD dwTitleIndexFolderSelected;
  8213. DWORD dwTitleIndexMultiSelected;
  8214. DWORD dwTooltipIndex;
  8215. DWORD dwIconIndex;
  8216. PFN_get_State pfn_get_State;
  8217. PFN_Invoke pfn_Invoke;
  8218. } WVTASKITEM;
  8219. // Use for tasks that want to be displayed when something is selected, where the UI is independent of the selection
  8220. #define WVTI_ENTRY(g, d, t, p, i, s, k) {&(g), (d), (0), (t), (t), (t), (p), (i), (s), (k)}
  8221. // Use for tasks that want to be displayed when nothing is selected
  8222. #define WVTI_ENTRY_NOSELECTION(g, d, t, p, i, s, k) {&(g), (d), (t), 0, 0, 0, (p), (i), (s), (k)}
  8223. // Use for tasks that want to be displayed when a file is selected
  8224. #define WVTI_ENTRY_FILE(g, d, t, p, i, s, k) {&(g), (d), (0), (t), (0), (0), (p), (i), (s), (k)}
  8225. // Use for tasks that want to be displayed when something is selected, and you want different UI depending on the selection
  8226. // Use this one if you want to control the title, but the tooltip is constant:
  8227. #define WVTI_ENTRY_TITLE(g, d, t2, t3, t4, p, i, s, k) {&(g), (d), (0), (t2), (t3), (t4), (p), (i), (s), (k)}
  8228. // Use this one if you want the same text everywhere:
  8229. #define WVTI_ENTRY_ALL(g, d, t, p, i, s, k) {&(g), (d), (t), (t), (t), (t), (p), (i), (s), (k)}
  8230. // Use this one if you want to control everything:
  8231. #define WVTI_ENTRY_ALL_TITLE(g, d, t1, t2, t3, t4, p, i, s, k) {&(g), (d), (t1), (t2), (t3), (t4), (p), (i), (s), (k)}
  8232. // Use this one for a header:
  8233. #define WVTI_HEADER(d, t, p) {&(CLSID_NULL), (d), (t), (t), (t), (t), (p), 0, NULL, NULL}
  8234. // Use this one for a header that changes with the selection:
  8235. #define WVTI_HEADER_ENTRY(d, t1, t2, t3, t4, p) {&(CLSID_NULL), (d), (t1), (t2), (t3), (t4), (p), 0, NULL, NULL}
  8236. // Creates an IEnumUICommand over an array of WVTASKITEM structures.
  8237. // The enumerator/objects hold a ref on the pv param for the lifetime of the enumerator/objects.
  8238. // The pv param gets passed through to the static WVTASKITEM.pfn functions.
  8239. //
  8240. HRESULT Create_IEnumUICommand(IUnknown *pv, const WVTASKITEM* rgwvti, UINT cwvti, IEnumUICommand**ppenum);
  8241. // Creates an IUICommand out of a single WVTASKITEM, never calling the pfn functions
  8242. HRESULT Create_IUIElement(const WVTASKITEM* pwvti, IUIElement**ppuie);
  8243. // SFVM_GETNOTIFY: The shell will use the pidl returned from this message to synch
  8244. // change notifies. Folders in Folder Shortcuts should return pidlTarget
  8245. // because that is where the change notifies are sent.
  8246. //
  8247. // DOC'ed for DOJ compliance:
  8248. ;end_internal
  8249. // uMsg wParam lParam
  8250. #define SFVM_MERGEMENU 1 // - LPQCMINFO
  8251. #define SFVM_INVOKECOMMAND 2 // idCmd -
  8252. #define SFVM_GETHELPTEXT 3 // idCmd,cchMax pszText
  8253. #define SFVM_GETTOOLTIPTEXT 4 // idCmd,cchMax pszText
  8254. #define SFVM_GETBUTTONINFO 5 // - LPTBINFO
  8255. #define SFVM_GETBUTTONS 6 // idCmdFirst,cbtnMax LPTBBUTTON
  8256. #define SFVM_INITMENUPOPUP 7 // idCmdFirst,nIndex hmenu
  8257. ;begin_internal
  8258. #define SFVM_SELCHANGE 8 // idCmdFirst,nItem SFVM_SELCHANGE_DATA*
  8259. #define SFVM_DRAWITEM 9 // idCmdFirst DRAWITEMSTRUCT*
  8260. #define SFVM_MEASUREITEM 10 // idCmdFirst MEASUREITEMSTRUCT*
  8261. #define SFVM_EXITMENULOOP 11 // - -
  8262. #define SFVM_PRERELEASE 12 // - -
  8263. #define SFVM_GETCCHMAX 13 // LPCITEMIDLIST pcchMax
  8264. // DOC'ed for DOJ compliance:
  8265. ;end_internal
  8266. #define SFVM_FSNOTIFY 14 // LPCITEMIDLIST* lEvent
  8267. #define SFVM_WINDOWCREATED 15 // hwnd -
  8268. ;begin_internal
  8269. #define SFVM_WINDOWDESTROY 16 // hwnd -
  8270. #define SFVM_REFRESH 17 // BOOL fPreOrPost - NB: this may be called multiple times in a row
  8271. #define SFVM_SETFOCUS 18 // - -
  8272. #define SFVM_QUERYCOPYHOOK 20 // - -
  8273. #define SFVM_NOTIFYCOPYHOOK 21 // - COPYHOOKINFO*
  8274. // DOC'ed for DOJ compliance:
  8275. ;end_internal
  8276. #define SFVM_GETDETAILSOF 23 // iColumn DETAILSINFO*
  8277. #define SFVM_COLUMNCLICK 24 // iColumn -
  8278. #define SFVM_QUERYFSNOTIFY 25 // - SHChangeNotifyEntry *
  8279. #define SFVM_DEFITEMCOUNT 26 // - UINT*
  8280. #define SFVM_DEFVIEWMODE 27 // - FOLDERVIEWMODE*
  8281. #define SFVM_UNMERGEMENU 28 // - hmenu
  8282. ;begin_internal
  8283. #define SFVM_INSERTITEM 29 // pidl -
  8284. #define SFVM_DELETEITEM 30 // pidl -
  8285. // DOC'ed for DOJ compliance:
  8286. ;end_internal
  8287. #define SFVM_UPDATESTATUSBAR 31 // fInitialize -
  8288. #define SFVM_BACKGROUNDENUM 32 // - -
  8289. ;begin_internal
  8290. #define SFVM_GETWORKINGDIR 33 // uMax pszDir
  8291. #define SFVM_GETCOLSAVESTREAM 34 // flags IStream **
  8292. #define SFVM_SELECTALL 35 // - -
  8293. // DOC'ed for DOJ compliance:
  8294. ;end_internal
  8295. #define SFVM_DIDDRAGDROP 36 // dwEffect IDataObject *
  8296. ;begin_internal
  8297. #define SFVM_SUPPORTSIDENTITY 37 // - - // NOT USED: must support IShellFolder2
  8298. #define SFVM_FOLDERISPARENT 38 // - pidlChild
  8299. // DOC'ed for DOJ compliance:
  8300. ;end_internal
  8301. #define SFVM_SETISFV 39 // - IShellFolderView*
  8302. ;begin_internal
  8303. #define SFVM_GETVIEWS 40 // SHELLVIEWID* IEnumSFVViews **
  8304. // DOC'ed for DOJ compliance:
  8305. ;end_internal
  8306. #define SFVM_THISIDLIST 41 // - LPITMIDLIST*
  8307. ;begin_internal
  8308. #define SFVM_GETITEMIDLIST 42 // iItem LPITMIDLIST*
  8309. #define SFVM_SETITEMIDLIST 43 // iItem LPITEMIDLIST
  8310. #define SFVM_INDEXOFITEMIDLIST 44 // *iItem LPITEMIDLIST
  8311. #define SFVM_ODFINDITEM 45 // *iItem NM_FINDITEM*
  8312. #define SFVM_HWNDMAIN 46 // hwndMain
  8313. // DOC'ed for DOJ compliance:
  8314. ;end_internal
  8315. #define SFVM_ADDPROPERTYPAGES 47 // - SFVM_PROPPAGE_DATA *
  8316. #define SFVM_BACKGROUNDENUMDONE 48 // - -
  8317. #define SFVM_GETNOTIFY 49 // LPITEMIDLIST* LONG*
  8318. ;begin_internal
  8319. #define SFVM_ARRANGE 50 // - lParamSort
  8320. #define SFVM_QUERYSTANDARDVIEWS 51 // - BOOL * // NOT USED: must use SFVM_GETVIEWDATA instead
  8321. #define SFVM_QUERYREUSEEXTVIEW 52 // - BOOL * // NOT USED
  8322. // DOC'ed for DOJ compliance:
  8323. ;end_internal
  8324. #define SFVM_GETSORTDEFAULTS 53 // iDirection iParamSort
  8325. ;begin_internal
  8326. #define SFVM_GETEMPTYTEXT 54 // cchMax pszText
  8327. #define SFVM_GETITEMICONINDEX 55 // iItem int *piIcon
  8328. #define SFVM_DONTCUSTOMIZE 56 // - BOOL *pbDontCustomize // NOT USED
  8329. // DOC'ed for DOJ compliance:
  8330. ;end_internal
  8331. #define SFVM_SIZE 57 // - -
  8332. #define SFVM_GETZONE 58 // - DWORD*
  8333. #define SFVM_GETPANE 59 // Pane ID DWORD*
  8334. ;begin_internal
  8335. #define SFVM_ISOWNERDATA 60 // ISOWNERDATA BOOL *
  8336. #define SFVM_GETODRANGEOBJECT 61 // iWhich ILVRange **
  8337. #define SFVM_ODCACHEHINT 62 // - NMLVCACHEHINT *
  8338. // DOC'ed for DOJ compliance:
  8339. ;end_internal
  8340. #define SFVM_GETHELPTOPIC 63 // - SFVM_HELPTOPIC_DATA *
  8341. ;begin_internal
  8342. #define SFVM_OVERRIDEITEMCOUNT 64 // - UINT* // NOT USED: allowed override of actual item count for sizing calculations
  8343. #define SFVM_GETHELPTEXTW 65 // idCmd,cchMax pszText - unicode
  8344. #define SFVM_GETTOOLTIPTEXTW 66 // idCmd,cchMax pszText - unicode
  8345. #define SFVM_GETIPERSISTHISTORY 67 // IPersistHistory **
  8346. ;end_internal
  8347. #define SFVM_GETANIMATION 68 // HINSTANCE * WCHAR *
  8348. ;begin_internal
  8349. #define SFVM_GETHELPTEXTA 69 // idCmd,cchMax pszText - ansi
  8350. #define SFVM_GETTOOLTIPTEXTA 70 // idCmd,cchMax pszText - ansi
  8351. // The below two messages are only used in ownder data case, i.e. when SFVM_ISOWNERDATA returns TRUE
  8352. #define SFVM_GETICONOVERLAY 71 // iItem int iOverlayIndex
  8353. #define SFVM_SETICONOVERLAY 72 // iItem int * piOverlayIndex
  8354. #define SFVM_ALTERDROPEFFECT 73 // DWORD* IDataObject*
  8355. #define SFVM_DELAYWINDOWCREATE 74 // HWND - posted version of SFVM_WINDOWCREATED, no params
  8356. #define SFVM_FORCEWEBVIEW 75 // BOOL* -
  8357. #define SFVM_GETVIEWINFO 76 // fvm.uViewMode SFVM_VIEWINFO_DATA* // NOT USED: shipped in Whistler Beta 1 only, remove soon
  8358. #define SFVM_GETCUSTOMVIEWINFO 77 // - SFVM_CUSTOMVIEWINFO_DATA*
  8359. #define SFVM_FOLDERSETTINGSFLAGS 78 // - DWORD * (FWF_ flags)
  8360. #define SFVM_ENUMERATEDITEMS 79 // UINT celt LPCITEMIDLIST* rgpidl // fired once at view creation, before first SFVM_GETVIEWDATA SFVM_GETDEFERREDVIEWSETTINGS
  8361. #define SFVM_GETVIEWDATA 80 // fvm.uViewMode SFVM_VIEW_DATA*
  8362. #define SFVM_GETWEBVIEW_TEMPLATE 81 // fvm.uViewMode SFVM_WEBVIEW_TEMPLATE_DATA* // NOTE: going away soon
  8363. #define SFVM_GETWEBVIEWLAYOUT 82 // fvm.uViewMode SFVM_WEBVIEW_LAYOUT_DATA*
  8364. #define SFVM_GETWEBVIEWCONTENT 83 // - SFVM_WEBVIEW_CONTENT_DATA*
  8365. #define SFVM_GETWEBVIEWTASKS 84 // - SFVM_WEBVIEW_TASKSECTION_DATA*
  8366. #define SFVM_GETWEBVIEWTHEME 86 // - SFVM_WEBVIEW_THEME_DATA* // HACK for Whistler, will remove when DirectUI goes DLL
  8367. #define SFVM_SORTLISTDATA 87 // PFNLVCOMPARE lParamSort
  8368. #define SFVM_GETWEBVIEWBARRICADE 88 // - Element* // HACK for Whistler, will remove when DirectUI goes DLL
  8369. #define SFVM_ENUMWEBVIEWTASKS 90 // - SFVM_WEBVIEW_ENUMTASKSECTION_DATA*
  8370. #define SFVM_SETEMPTYTEXT 91 // - pszText
  8371. #define SFVM_GETDEFERREDVIEWSETTINGS 92 // - SFVM_DEFERRED_VIEW_SETTINGS* // set the default view settings
  8372. // All of these macros are compatible with HANDLE_MSG in WINDOWSX.H
  8373. #define HANDLE_SFVM_MERGEMENU(pv, wP, lP, fn) \
  8374. ((fn)((pv), (QCMINFO*)(lP)))
  8375. #define HANDLE_SFVM_INVOKECOMMAND(pv, wP, lP, fn) \
  8376. ((fn)((pv), (UINT)(wP)))
  8377. #define HANDLE_SFVM_GETHELPTEXT(pv, wP, lP, fn) \
  8378. ((fn)((pv), LOWORD(wP), HIWORD(wP), (LPTSTR)(lP)))
  8379. #define HANDLE_SFVM_GETTOOLTIPTEXT(pv, wP, lP, fn) \
  8380. ((fn)((pv), LOWORD(wP), HIWORD(wP), (LPTSTR)(lP)))
  8381. #define HANDLE_SFVM_GETBUTTONINFO(pv, wP, lP, fn) \
  8382. ((fn)((pv), (TBINFO*)(lP)))
  8383. #define HANDLE_SFVM_GETBUTTONS(pv, wP, lP, fn) \
  8384. ((fn)((pv), LOWORD(wP), HIWORD(wP), (TBBUTTON*)(lP)))
  8385. #define HANDLE_SFVM_INITMENUPOPUP(pv, wP, lP, fn) \
  8386. ((fn)((pv), LOWORD(wP), HIWORD(wP), (HMENU)(lP)))
  8387. #define HANDLE_SFVM_SELCHANGE(pv, wP, lP, fn) \
  8388. ((fn)((pv), LOWORD(wP), HIWORD(wP), (SFVM_SELCHANGE_DATA*)(lP)))
  8389. #define HANDLE_SFVM_DRAWITEM(pv, wP, lP, fn) \
  8390. ((fn)((pv), (UINT)(wP), (DRAWITEMSTRUCT*)(lP)))
  8391. #define HANDLE_SFVM_MEASUREITEM(pv, wP, lP, fn) \
  8392. ((fn)((pv), (UINT)(wP), (MEASUREITEMSTRUCT*)(lP)))
  8393. #define HANDLE_SFVM_EXITMENULOOP(pv, wP, lP, fn) \
  8394. ((fn)(pv))
  8395. #define HANDLE_SFVM_PRERELEASE(pv, wP, lP, fn) \
  8396. ((fn)(pv))
  8397. #define HANDLE_SFVM_GETCCHMAX(pv, wP, lP, fn) \
  8398. ((fn)((pv), (LPCITEMIDLIST)(wP), (UINT*)(lP)))
  8399. #define HANDLE_SFVM_FSNOTIFY(pv, wP, lP, fn) \
  8400. ((fn)((pv), (LPCITEMIDLIST*)(wP), (lP)))
  8401. #define HANDLE_SFVM_WINDOWCREATED(pv, wP, lP, fn) \
  8402. ((fn)((pv), (HWND)(wP)))
  8403. #define HANDLE_SFVM_WINDOWDESTROY(pv, wP, lP, fn) \
  8404. ((fn)((pv), (HWND)(wP)))
  8405. #define HANDLE_SFVM_REFRESH(pv, wP, lP, fn) \
  8406. ((fn)((pv), (BOOL) wP))
  8407. #define HANDLE_SFVM_SETFOCUS(pv, wP, lP, fn) \
  8408. ((fn)(pv))
  8409. #define HANDLE_SFVM_QUERYCOPYHOOK(pv, wP, lP, fn) \
  8410. ((fn)(pv))
  8411. #define HANDLE_SFVM_NOTIFYCOPYHOOK(pv, wP, lP, fn) \
  8412. ((fn)((pv), (COPYHOOKINFO*)(lP)))
  8413. #define HANDLE_SFVM_GETDETAILSOF(pv, wP, lP, fn) \
  8414. ((fn)((pv), (UINT)(wP), (DETAILSINFO*)(lP)))
  8415. #define HANDLE_SFVM_COLUMNCLICK(pv, wP, lP, fn) \
  8416. ((fn)((pv), (UINT)(wP)))
  8417. #define HANDLE_SFVM_QUERYFSNOTIFY(pv, wP, lP, fn) \
  8418. ((fn)((pv), (SHChangeNotifyEntry*)(lP)))
  8419. #define HANDLE_SFVM_DEFITEMCOUNT(pv, wP, lP, fn) \
  8420. ((fn)((pv), (UINT*)(lP)))
  8421. #define HANDLE_SFVM_OVERRIDEITEMCOUNT(pv, wP, lP, fn) \
  8422. ((fn)((pv), (UINT*)(lP)))
  8423. #define HANDLE_SFVM_DEFVIEWMODE(pv, wP, lP, fn) \
  8424. ((fn)((pv), (FOLDERVIEWMODE*)(lP)))
  8425. #define HANDLE_SFVM_UNMERGEMENU(pv, wP, lP, fn) \
  8426. ((fn)((pv), (HMENU)(lP)))
  8427. #define HANDLE_SFVM_INSERTITEM(pv, wP, lP, fn) \
  8428. ((fn)((pv), (LPCITEMIDLIST)(lP)))
  8429. #define HANDLE_SFVM_DELETEITEM(pv, wP, lP, fn) \
  8430. ((fn)((pv), (LPCITEMIDLIST)(lP)))
  8431. #define HANDLE_SFVM_UPDATESTATUSBAR(pv, wP, lP, fn) \
  8432. ((fn)((pv), (BOOL)(wP)))
  8433. #define HANDLE_SFVM_BACKGROUNDENUM(pv, wP, lP, fn) \
  8434. ((fn)(pv))
  8435. #define HANDLE_SFVM_GETWORKINGDIR(pv, wP, lP, fn) \
  8436. ((fn)((pv), (UINT)(wP), (LPTSTR)(lP)))
  8437. #define HANDLE_SFVM_GETCOLSAVESTREAM(pv, wP, lP, fn) \
  8438. ((fn)((pv), (wP), (IStream**)(lP)))
  8439. #define HANDLE_SFVM_SELECTALL(pv, wP, lP, fn) \
  8440. ((fn)(pv))
  8441. #define HANDLE_SFVM_DIDDRAGDROP(pv, wP, lP, fn) \
  8442. ((fn)((pv), (DWORD)(wP), (IDataObject*)(lP)))
  8443. #define HANDLE_SFVM_SUPPORTSIDENTITY(pv, wp, lP, fn) \
  8444. ((fn)(pv)) /* Only 1 parameter */
  8445. #define HANDLE_SFVM_HWNDMAIN(pv, wP, lP, fn) \
  8446. ((fn)((pv), (HWND)(lP)))
  8447. #define HANDLE_SFVM_GETNOTIFY(pv, wP, lP, fn) \
  8448. ((fn)((pv), (LPITEMIDLIST*)(wP), (LONG*)(lP)))
  8449. #define HANDLE_SFVM_SETISFV(pv, wP, lP, fn) \
  8450. ((fn)((pv), (IShellFolderView*)(lP)))
  8451. #define HANDLE_SFVM_GETVIEWS(pv, wP, lP, fn) \
  8452. ((fn)((pv), (SHELLVIEWID*)(wP), (IEnumSFVViews**)(lP)))
  8453. #define HANDLE_SFVM_THISIDLIST(pv, wP, lP, fn) \
  8454. ((fn)((pv), (LPITEMIDLIST*)(lP)))
  8455. #define HANDLE_SFVM_GETITEMIDLIST(pv, wP, lP, fn) \
  8456. ((fn)((pv), (wP), (LPITEMIDLIST*)(lP)))
  8457. #define HANDLE_SFVM_SETITEMIDLIST(pv, wP, lP, fn) \
  8458. ((fn)((pv), (wP), (LPITEMIDLIST)(lP)))
  8459. #define HANDLE_SFVM_INDEXOFITEMIDLIST(pv, wP, lP, fn) \
  8460. ((fn)((pv), (int*)(wP), (LPITEMIDLIST)(lP)))
  8461. #define HANDLE_SFVM_ODFINDITEM(pv, wP, lP, fn) \
  8462. ((fn)((pv), (int*)(wP), (NM_FINDITEM*)(lP)))
  8463. #define HANDLE_SFVM_ADDPROPERTYPAGES(pv, wP, lP, fn) \
  8464. ((fn)((pv), (SFVM_PROPPAGE_DATA *)(lP)))
  8465. #define HANDLE_SFVM_FOLDERISPARENT(pv, wP, lP, fn) \
  8466. ((fn)((pv), (LPITEMIDLIST)(lP)))
  8467. #define HANDLE_SFVM_ARRANGE(pv, wP, lP, fn) \
  8468. ((fn)((pv), (LPARAM)(lP)))
  8469. #define HANDLE_SFVM_QUERYSTANDARDVIEWS(pv, wP, lP, fn) \
  8470. ((fn)((pv), (BOOL*)(lP)))
  8471. #define HANDLE_SFVM_QUERYREUSEEXTVIEW(pv, wP, lP, fn) \
  8472. ((fn)((pv), (BOOL*)(lP)))
  8473. #define HANDLE_SFVM_GETEMPTYTEXT(pv, wP, lP, fn) \
  8474. ((fn)((pv), (UINT)(wP), (LPTSTR)(lP)))
  8475. #define HANDLE_SFVM_GETITEMICONINDEX(pv, wP, lP, fn) \
  8476. ((fn)((pv), (wP), (int*)(lP)))
  8477. #define HANDLE_SFVM_SIZE(pv, wP, lP, fn) \
  8478. ((fn)((pv), LOWORD(lP), HIWORD(lP)))
  8479. #define HANDLE_SFVM_GETZONE(pv, wP, lP, fn) \
  8480. ((fn)((pv), (DWORD *)(lP)))
  8481. #define HANDLE_SFVM_GETPANE(pv, wP, lP, fn) \
  8482. ((fn)((pv), (wP), (DWORD *)(lP)))
  8483. #define HANDLE_SFVM_ISOWNERDATA(pv, wP, lP, fn) \
  8484. ((fn)((pv), (BOOL*)(lP)))
  8485. #define HANDLE_SFVM_GETODRANGEOBJECT(pv, wP, lP, fn) \
  8486. ((fn)((pv), (wP), (ILVRange **)(lP)))
  8487. #define HANDLE_SFVM_ODCACHEHINT(pv, wP, lP, fn) \
  8488. ((fn)((pv), (NMLVCACHEHINT*)(lP)))
  8489. #define HANDLE_SFVM_GETHELPTOPIC(pv, wP, lP, fn) \
  8490. ((fn)((pv), (SFVM_HELPTOPIC_DATA *)(lP)))
  8491. #define HANDLE_SFVM_GETIPERSISTHISTORY(pv, wP, lP, fn) \
  8492. ((fn)((pv), (IPersistHistory **)(lP)))
  8493. #define HANDLE_SFVM_SETICONOVERLAY(pv, wP, lP, fn) \
  8494. ((fn)((pv), (wP), (int)(lP)))
  8495. #define HANDLE_SFVM_GETICONOVERLAY(pv, wP, lP, fn) \
  8496. ((fn)((pv), (wP), (int *)(lP)))
  8497. #define HANDLE_SFVM_ALTERDROPEFFECT(pv, wP, lP, fn) \
  8498. ((fn)((pv), (DWORD *)(wP), (IDataObject *)(lP)))
  8499. #define HANDLE_SFVM_DELAYWINDOWCREATE(pv, wP, lP, fn) \
  8500. ((fn)((pv), (HWND)(wP)))
  8501. #define HANDLE_SFVM_FORCEWEBVIEW(pv, wP, lP, fn) \
  8502. ((fn)((pv), (BOOL*)(wP)))
  8503. #define HANDLE_SFVM_GETVIEWINFO(pv, wP, lP, fn) \
  8504. ((fn)((pv), (UINT)(wP), (SFVM_VIEWINFO_DATA*)lP))
  8505. #define HANDLE_SFVM_GETCUSTOMVIEWINFO(pv, wP, lP, fn) \
  8506. ((fn)((pv), (SFVM_CUSTOMVIEWINFO_DATA*)(lP)))
  8507. #define HANDLE_SFVM_FOLDERSETTINGSFLAGS(pv, wP, lP, fn) \
  8508. ((fn)((pv), (DWORD*)(lP)))
  8509. #define HANDLE_SFVM_ENUMERATEDITEMS(pv, wP, lP, fn) \
  8510. ((fn)((pv), (UINT)(wP), (LPCITEMIDLIST*)(lP)))
  8511. #define HANDLE_SFVM_GETVIEWDATA(pv, wP, lP, fn) \
  8512. ((fn)((pv), (UINT)(wP), (SFVM_VIEW_DATA*)lP))
  8513. #define HANDLE_SFVM_GETWEBVIEW_TEMPLATE(pv, wP, lP, fn) \
  8514. ((fn)((pv), (UINT)(wP), (SFVM_WEBVIEW_TEMPLATE_DATA*)(lP)))
  8515. #define HANDLE_SFVM_GETWEBVIEWLAYOUT(pv, wP, lP, fn) \
  8516. ((fn)((pv), (UINT)(wP), (SFVM_WEBVIEW_LAYOUT_DATA*)(lP)))
  8517. #define HANDLE_SFVM_GETWEBVIEWCONTENT(pv, wP, lP, fn) \
  8518. ((fn)((pv), (SFVM_WEBVIEW_CONTENT_DATA*)(lP)))
  8519. #define HANDLE_SFVM_GETWEBVIEWTASKS(pv, wP, lP, fn) \
  8520. ((fn)((pv), (SFVM_WEBVIEW_TASKSECTION_DATA*)(lP)))
  8521. #define HANDLE_SFVM_ENUMWEBVIEWTASKS(pv, wP, lP, fn) \
  8522. ((fn)((pv), (SFVM_WEBVIEW_ENUMTASKSECTION_DATA*)(lP)))
  8523. #define HANDLE_SFVM_GETWEBVIEWTHEME(pv, wP, lP, fn) \
  8524. ((fn)((pv), (SFVM_WEBVIEW_THEME_DATA*)(lP)))
  8525. #define HANDLE_SFVM_SORTLISTDATA(pv, wP, lP, fn) \
  8526. ((fn)((pv), (PFNLVCOMPARE)(wP), (lP)))
  8527. #define HANDLE_SFVM_GETDEFERREDVIEWSETTINGS(pv, wP, lP, fn) \
  8528. ((fn)((pv), (SFVM_DEFERRED_VIEW_SETTINGS*)(lP)))
  8529. #define HANDLE_SFVM_SETEMPTYTEXT(pv, wP, lP, fn) \
  8530. ((fn)((pv), (UINT)(wP), (LPCTSTR)(lP)))
  8531. //
  8532. // Return values for SFVM_GETICONOVERLAY:
  8533. // If the icon overlay is not set and you want the shell to set it for you.
  8534. // return SFVOVERLAY_UNSET. This will cause the shell to retrieve the overlay and
  8535. // send SFVM_SETICONOVERLAY.
  8536. // If there is no overlay for this item at all, the correct return value is
  8537. // SFVOVERLAY_DEFAULT
  8538. // If you return SFVOVERLAY_UNSET every time for SFVM_GETICONOVERLAY, the
  8539. // shell will keep setting it indefinitely, so there is a danger of infinite loop
  8540. //
  8541. #define SFV_ICONOVERLAY_DEFAULT 0
  8542. #define SFV_ICONOVERLAY_UNSET 0xFFFFFFFF
  8543. //
  8544. // What you can return from SFVM_UPDATESTATUSBAR:
  8545. //
  8546. // E_NOTIMPL - Message not handled; DefView should manage status bar
  8547. //
  8548. // Otherwise, update the status bar yourself and return a bitmask of the
  8549. // following codes indicating what you want DefView to do for you.
  8550. //
  8551. #define SFVUSB_HANDLED 0x0000 // Client handled completely - DefView does nothing
  8552. #define SFVUSB_INITED 0x0001 // Client initialized parts - DefView will set text
  8553. #define SFVUSB_ALL 0x0001;internal
  8554. // IShellFolderView interface for getting the SFV to do things
  8555. //
  8556. typedef struct _ITEMSPACING
  8557. {
  8558. int cxSmall;
  8559. int cySmall;
  8560. int cxLarge;
  8561. int cyLarge;
  8562. } ITEMSPACING;
  8563. // Define OPtions for SetObjectCount
  8564. #define SFVSOC_INVALIDATE_ALL 0x00000001 // Assumed to reset only what is neccessary...
  8565. #define SFVSOC_NOSCROLL LVSICF_NOSCROLL
  8566. // defines for IShellFolderView::SelectItems()
  8567. #define SFVS_SELECT_NONE 0x0 // unselect all
  8568. #define SFVS_SELECT_ALLITEMS 0x1 // select all
  8569. #define SFVS_SELECT_INVERT 0x2 // Inver the selection
  8570. // defines for IShellFolderView::QuerySupport()
  8571. // allows a view to be queried to see if it supports various operations (useful for
  8572. // enabling menu items)
  8573. #define SFVQS_AUTO_ARRANGE 0x0001
  8574. #define SFVQS_ARRANGE_GRID 0x0002
  8575. #define SFVQS_SELECT_ALL 0x0004
  8576. #define SFVQS_SELECT_NONE 0x0008
  8577. #define SFVQS_SELECT_INVERT 0x0010
  8578. #undef INTERFACE
  8579. #define INTERFACE IShellFolderView
  8580. DECLARE_INTERFACE_(IShellFolderView, IUnknown)
  8581. {
  8582. // *** IUnknown methods ***
  8583. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  8584. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  8585. STDMETHOD_(ULONG,Release) (THIS) PURE;
  8586. // *** IShellFolderView methods ***
  8587. STDMETHOD(Rearrange) (THIS_ LPARAM lParamSort) PURE;
  8588. STDMETHOD(GetArrangeParam) (THIS_ LPARAM *plParamSort) PURE;
  8589. STDMETHOD(ArrangeGrid) (THIS) PURE;
  8590. STDMETHOD(AutoArrange) (THIS) PURE;
  8591. STDMETHOD(GetAutoArrange) (THIS) PURE;
  8592. STDMETHOD(AddObject) (THIS_ LPITEMIDLIST pidl, UINT *puItem) PURE;
  8593. STDMETHOD(GetObject) (THIS_ LPITEMIDLIST *ppidl, UINT uItem) PURE;
  8594. STDMETHOD(RemoveObject) (THIS_ LPITEMIDLIST pidl, UINT *puItem) PURE;
  8595. STDMETHOD(GetObjectCount) (THIS_ UINT *puCount) PURE;
  8596. STDMETHOD(SetObjectCount) (THIS_ UINT uCount, UINT dwFlags) PURE;
  8597. STDMETHOD(UpdateObject) (THIS_ LPITEMIDLIST pidlOld, LPITEMIDLIST pidlNew, UINT *puItem) PURE;
  8598. STDMETHOD(RefreshObject) (THIS_ LPITEMIDLIST pidl, UINT *puItem) PURE;
  8599. STDMETHOD(SetRedraw) (THIS_ BOOL bRedraw) PURE;
  8600. STDMETHOD(GetSelectedCount) (THIS_ UINT *puSelected) PURE;
  8601. STDMETHOD(GetSelectedObjects) (THIS_ LPCITEMIDLIST **pppidl, UINT *puItems) PURE;
  8602. STDMETHOD(IsDropOnSource) (THIS_ IDropTarget *pDropTarget) PURE;
  8603. STDMETHOD(GetDragPoint) (THIS_ POINT *ppt) PURE;
  8604. STDMETHOD(GetDropPoint) (THIS_ POINT *ppt) PURE;
  8605. STDMETHOD(MoveIcons) (THIS_ IDataObject *pDataObject) PURE;
  8606. STDMETHOD(SetItemPos) (THIS_ LPCITEMIDLIST pidl, POINT *ppt) PURE;
  8607. STDMETHOD(IsBkDropTarget) (THIS_ IDropTarget *pDropTarget) PURE;
  8608. STDMETHOD(SetClipboard) (THIS_ BOOL bMove) PURE;
  8609. STDMETHOD(SetPoints) (THIS_ IDataObject *pDataObject) PURE;
  8610. STDMETHOD(GetItemSpacing) (THIS_ ITEMSPACING *pSpacing) PURE;
  8611. STDMETHOD(SetCallback) (THIS_ IShellFolderViewCB* pNewCB, IShellFolderViewCB** ppOldCB) PURE;
  8612. STDMETHOD(Select) ( THIS_ UINT dwFlags ) PURE;
  8613. STDMETHOD(QuerySupport) (THIS_ UINT * pdwSupport ) PURE;
  8614. STDMETHOD(SetAutomationObject)(THIS_ IDispatch* pdisp) PURE;
  8615. } ;
  8616. // DOC'ed for DOJ compliance:
  8617. ;end_internal
  8618. // SHCreateShellFolderView struct
  8619. typedef struct _SFV_CREATE
  8620. {
  8621. UINT cbSize;
  8622. IShellFolder* pshf;
  8623. IShellView* psvOuter;
  8624. IShellFolderViewCB* psfvcb; // No callback if NULL
  8625. } SFV_CREATE;
  8626. SHSTDAPI SHCreateShellFolderView(const SFV_CREATE* pcsfv, IShellView **ppsv);
  8627. ;begin_internal
  8628. #define SHCreateShellFolderViewORD 256
  8629. SHSTDAPI_(IShellFolderViewCB*) SHGetShellFolderViewCB(HWND hwndMain);
  8630. #define SHGetShellFolderViewCBORD 257
  8631. //===========================================================================
  8632. // Defview APIs to make name space author lives somewhat easier
  8633. // DOC'ed for DOJ compliance
  8634. ;end_internal
  8635. typedef HRESULT (CALLBACK * LPFNDFMCALLBACK)(IShellFolder *psf, HWND hwnd,
  8636. IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam);
  8637. SHSTDAPI CDefFolderMenu_Create2(LPCITEMIDLIST pidlFolder, HWND hwnd,
  8638. UINT cidl, LPCITEMIDLIST *apidl,
  8639. IShellFolder *psf, LPFNDFMCALLBACK lpfn,
  8640. UINT nKeys, const HKEY *ahkeyClsKeys,
  8641. IContextMenu **ppcm);
  8642. SHSTDAPI_(BOOL) SHOpenPropSheet%(LPCTSTR% pszCaption, HKEY ahkeys[], UINT cikeys,
  8643. const CLSID * pclsidDefault, IDataObject *pdtobj,
  8644. IShellBrowser *psb, LPCTSTR% pStartPage);
  8645. ;begin_internal
  8646. // structure for lParam of DFM_INFOKECOMMANDEX
  8647. typedef struct
  8648. {
  8649. DWORD cbSize;
  8650. DWORD fMask; // CMIC_MASK_ values for the invoke
  8651. LPARAM lParam; // same as lParam of DFM_INFOKECOMMAND
  8652. UINT idCmdFirst;
  8653. UINT idDefMax;
  8654. LPCMINVOKECOMMANDINFO pici; // the whole thing so you can re-invoke on a child
  8655. } DFMICS, *PDFMICS;
  8656. // Note on context menus ranges:
  8657. // Standard Items // DFM_MERGECONTEXTMENU, context menu extensions, DFM_MERGECONTEXTMENU_TOP
  8658. // Separator
  8659. // View Items // context menu extensions can get here
  8660. // Separator
  8661. // (defcm S_FALSE "default" items, if applicable)
  8662. // Separator
  8663. // Folder Items // context menu extensions can get here
  8664. // Separator
  8665. // Bottom Items // DFM_MERGECONTEXTMENU_BOTTOM
  8666. // DOC'ed for DOJ compliance
  8667. ;end_internal
  8668. // uMsg wParam lParam
  8669. #define DFM_MERGECONTEXTMENU 1 // uFlags LPQCMINFO
  8670. #define DFM_INVOKECOMMAND 2 // idCmd pszArgs
  8671. ;begin_internal
  8672. #define DFM_ADDREF 3 // 0 0
  8673. #define DFM_RELEASE 4 // 0 0
  8674. #define DFM_GETHELPTEXT 5 // idCmd,cchMax pszText -Ansi
  8675. #define DFM_WM_MEASUREITEM 6 // ---from the message---
  8676. #define DFM_WM_DRAWITEM 7 // ---from the message---
  8677. #define DFM_WM_INITMENUPOPUP 8 // ---from the message---
  8678. #define DFM_VALIDATECMD 9 // idCmd 0
  8679. #define DFM_MERGECONTEXTMENU_TOP 10 // uFlags LPQCMINFO
  8680. #define DFM_GETHELPTEXTW 11 // idCmd,cchMax pszText -Unicode
  8681. #define DFM_INVOKECOMMANDEX 12 // idCmd PDFMICS
  8682. #define DFM_MAPCOMMANDNAME 13 // idCmd * pszCommandName
  8683. ;end_internal
  8684. #define DFM_GETDEFSTATICID 14 // idCmd * 0
  8685. ;begin_internal
  8686. #define DFM_GETVERBW 15 // idCmd,cchMax pszText -Unicode
  8687. #define DFM_GETVERBA 16 // idCmd,cchMax pszText -Ansi
  8688. #define DFM_MERGECONTEXTMENU_BOTTOM 17 // uFlags LPQCMINFO
  8689. ;end_internal
  8690. // Commands from DFM_INVOKECOMMAND when strings are passed in
  8691. ;begin_internal
  8692. #define DFM_CMD_DELETE ((UINT)-1)
  8693. #define DFM_CMD_MOVE ((UINT)-2)
  8694. #define DFM_CMD_COPY ((UINT)-3)
  8695. #define DFM_CMD_LINK ((UINT)-4)
  8696. ;end_internal
  8697. #define DFM_CMD_PROPERTIES ((UINT)-5)
  8698. ;begin_internal
  8699. #define DFM_CMD_NEWFOLDER ((UINT)-6)
  8700. #define DFM_CMD_PASTE ((UINT)-7)
  8701. #define DFM_CMD_VIEWLIST ((UINT)-8)
  8702. #define DFM_CMD_VIEWDETAILS ((UINT)-9)
  8703. #define DFM_CMD_PASTELINK ((UINT)-10)
  8704. #define DFM_CMD_PASTESPECIAL ((UINT)-11)
  8705. #define DFM_CMD_MODALPROP ((UINT)-12)
  8706. #define DFM_CMD_RENAME ((UINT)-13)
  8707. SHSTDAPI CDefFolderMenu_Create(LPCITEMIDLIST pidlFolder,
  8708. HWND hwndOwner,
  8709. UINT cidl, LPCITEMIDLIST * apidl,
  8710. IShellFolder *psf,
  8711. LPFNDFMCALLBACK lpfn,
  8712. HKEY hkeyProgID, HKEY hkeyBaseProgID,
  8713. IContextMenu ** ppcm);
  8714. SHSTDAPI_(void) CDefFolderMenu_MergeMenu(HINSTANCE hinst, UINT idMainMerge, UINT idPopupMerge,
  8715. LPQCMINFO pqcm);
  8716. STDAPI_(void) Def_InitFileCommands(ULONG dwAttr, HMENU hmInit, UINT idCmdFirst,
  8717. BOOL bContext);
  8718. STDAPI_(void) Def_InitEditCommands(ULONG dwAttr, HMENU hmInit, UINT idCmdFirst,
  8719. IDropTarget *pdtgt, UINT fContext);
  8720. // indeces in bitmap strip
  8721. #define VIEW_MOVETO 24
  8722. #define VIEW_COPYTO 25
  8723. #define VIEW_OPTIONS 26
  8724. //===========================================================================
  8725. // Default IShellView for IShellFolder
  8726. //===========================================================================
  8727. // Menu ID's
  8728. #define SFVIDM_FIRST (FCIDM_SHVIEWLAST-0x0fff)
  8729. #define SFVIDM_LAST (FCIDM_SHVIEWLAST)
  8730. // Hardcoded message values => This range can be used for messages that we
  8731. // pass from shdoc401 to shell32
  8732. #define SFVIDM_HARDCODED_FIRST (SFVIDM_LAST-0x0010)
  8733. #define SFVIDM_HARDCODED_LAST (SFVIDM_LAST)
  8734. #define SFVIDM_MISC_SETWEBVIEW (SFVIDM_HARDCODED_FIRST)
  8735. // Popup menu ID's used in merging menus
  8736. #define SFVIDM_MENU_ARRANGE (SFVIDM_FIRST + 0x0001)
  8737. #define SFVIDM_MENU_VIEW (SFVIDM_FIRST + 0x0002)
  8738. #define SFVIDM_MENU_SELECT (SFVIDM_FIRST + 0x0003)
  8739. #define SHARED_FILE_FIRST 0x0010
  8740. #define SHARED_FILE_LINK (SHARED_FILE_FIRST + 0x0000)
  8741. #define SHARED_FILE_DELETE (SHARED_FILE_FIRST + 0x0001)
  8742. #define SHARED_FILE_RENAME (SHARED_FILE_FIRST + 0x0002)
  8743. #define SHARED_FILE_PROPERTIES (SHARED_FILE_FIRST + 0x0003)
  8744. #define SHARED_EDIT_FIRST 0x0018
  8745. #define SHARED_EDIT_CUT (SHARED_EDIT_FIRST + 0x0000)
  8746. #define SHARED_EDIT_COPY (SHARED_EDIT_FIRST + 0x0001)
  8747. #define SHARED_EDIT_PASTE (SHARED_EDIT_FIRST + 0x0002)
  8748. #define SHARED_EDIT_UNDO (SHARED_EDIT_FIRST + 0x0003)
  8749. #define SHARED_EDIT_PASTELINK (SHARED_EDIT_FIRST + 0x0004)
  8750. #define SHARED_EDIT_PASTESPECIAL (SHARED_EDIT_FIRST + 0x0005)
  8751. #define SHARED_EDIT_COPYTO (SHARED_EDIT_FIRST + 0x0006)
  8752. #define SHARED_EDIT_MOVETO (SHARED_EDIT_FIRST + 0x0007)
  8753. #define SFVIDM_FILE_FIRST (SFVIDM_FIRST + SHARED_FILE_FIRST)
  8754. #define SFVIDM_FILE_LINK (SFVIDM_FIRST + SHARED_FILE_LINK)
  8755. #define SFVIDM_FILE_DELETE (SFVIDM_FIRST + SHARED_FILE_DELETE)
  8756. #define SFVIDM_FILE_RENAME (SFVIDM_FIRST + SHARED_FILE_RENAME)
  8757. #define SFVIDM_FILE_PROPERTIES (SFVIDM_FIRST + SHARED_FILE_PROPERTIES)
  8758. #define SFVIDM_EDIT_FIRST (SFVIDM_FIRST + SHARED_EDIT_FIRST)
  8759. #define SFVIDM_EDIT_CUT (SFVIDM_FIRST + SHARED_EDIT_CUT)
  8760. #define SFVIDM_EDIT_COPY (SFVIDM_FIRST + SHARED_EDIT_COPY)
  8761. #define SFVIDM_EDIT_PASTE (SFVIDM_FIRST + SHARED_EDIT_PASTE)
  8762. #define SFVIDM_EDIT_UNDO (SFVIDM_FIRST + SHARED_EDIT_UNDO)
  8763. #define SFVIDM_EDIT_PASTELINK (SFVIDM_FIRST + SHARED_EDIT_PASTELINK)
  8764. #define SFVIDM_EDIT_PASTESPECIAL (SFVIDM_FIRST + SHARED_EDIT_PASTESPECIAL)
  8765. #define SFVIDM_EDIT_COPYTO (SFVIDM_FIRST + SHARED_EDIT_COPYTO)
  8766. #define SFVIDM_EDIT_MOVETO (SFVIDM_FIRST + SHARED_EDIT_MOVETO)
  8767. #define SFVIDM_SELECT_FIRST (SFVIDM_FIRST + 0x0020)
  8768. #define SFVIDM_SELECT_ALL (SFVIDM_SELECT_FIRST + 0x0001)
  8769. #define SFVIDM_SELECT_INVERT (SFVIDM_SELECT_FIRST + 0x0002)
  8770. #define SFVIDM_DESELECT_ALL (SFVIDM_SELECT_FIRST + 0x0003)
  8771. #define SFVIDM_VIEW_FIRST (SFVIDM_FIRST + 0x0028)
  8772. #define SFVIDM_VIEW_FIRSTVIEW (SFVIDM_VIEW_FIRST + 1)
  8773. #define SFVIDM_VIEW_ICON (SFVIDM_VIEW_FIRST + 1)
  8774. #define SFVIDM_VIEW_SMALLICON (SFVIDM_VIEW_FIRST + 2)
  8775. #define SFVIDM_VIEW_LIST (SFVIDM_VIEW_FIRST + 3)
  8776. #define SFVIDM_VIEW_DETAILS (SFVIDM_VIEW_FIRST + 4)
  8777. #define SFVIDM_VIEW_THUMBNAIL (SFVIDM_VIEW_FIRST + 5)
  8778. #define SFVIDM_VIEW_TILE (SFVIDM_VIEW_FIRST + 6)
  8779. #define SFVIDM_VIEW_THUMBSTRIP (SFVIDM_VIEW_FIRST + 7)
  8780. #define SFVIDM_VIEW_LASTVIEW (SFVIDM_VIEW_FIRST + 7)
  8781. // TileView
  8782. // One more for safe keeping
  8783. #define SFVIDM_VIEW_OPTIONS (SFVIDM_VIEW_FIRST + 0x0008)
  8784. #define SFVIDM_VIEW_VIEWMENU (SFVIDM_VIEW_FIRST + 0x0009)
  8785. #define SFVIDM_VIEW_CUSTOMWIZARD (SFVIDM_VIEW_FIRST + 0x000A)
  8786. #define SFVIDM_VIEW_COLSETTINGS (SFVIDM_VIEW_FIRST + 0x000B)
  8787. #define SFVIDM_VIEW_EXTFIRST (SFVIDM_VIEW_FIRST + 0x000C)
  8788. #define SFVIDM_VIEW_EXTLAST (SFVIDM_VIEW_EXTFIRST + 0x0017)
  8789. #define SFVIDM_VIEW_SVEXTFIRST (SFVIDM_VIEW_EXTFIRST)
  8790. #define SFVIDM_VIEW_SVEXTLAST (SFVIDM_VIEW_EXTFIRST + 0x000F)
  8791. #define SFVIDM_VIEW_EXTENDEDFIRST (SFVIDM_VIEW_EXTFIRST + 0x0010)
  8792. #define SFVIDM_VIEW_EXTENDEDLAST (SFVIDM_VIEW_EXTLAST)
  8793. // #define SFVIDM_VIEW_THUMBNAIL (SFVIDM_VIEW_FIRST + 0x0021) defined above
  8794. #define SFVIDM_ARRANGE_FIRST (SFVIDM_FIRST + 0x0050)
  8795. #define SFVIDM_ARRANGE_AUTO (SFVIDM_ARRANGE_FIRST + 0x0001)
  8796. #define SFVIDM_ARRANGE_GRID (SFVIDM_ARRANGE_FIRST + 0x0002)
  8797. #define SFVIDM_ARRANGE_DISPLAYICONS (SFVIDM_ARRANGE_FIRST + 0x0003)
  8798. #define SFVIDM_ARRANGE_AUTOGRID (SFVIDM_ARRANGE_FIRST + 0x0004)
  8799. #define SFVIDM_TOOL_FIRST (SFVIDM_FIRST + 0x0060)
  8800. #define SFVIDM_TOOL_CONNECT (SFVIDM_TOOL_FIRST + 0x0001)
  8801. #define SFVIDM_TOOL_DISCONNECT (SFVIDM_TOOL_FIRST + 0x0002)
  8802. #define SFVIDM_TOOL_OPTIONS (SFVIDM_TOOL_FIRST + 0x0003)
  8803. #define SFVIDM_DEBUG_WEBVIEW (SFVIDM_TOOL_FIRST + 0x0004)
  8804. #define SFVIDM_HELP_FIRST (SFVIDM_FIRST + 0x0070)
  8805. #define SFVIDM_HELP_TOPIC (SFVIDM_HELP_FIRST + 0x0001)
  8806. #define SFVIDM_MISC_FIRST (SFVIDM_FIRST + 0x0100)
  8807. #define SFVIDM_MISC_REFRESH (SFVIDM_MISC_FIRST + 0x0003)
  8808. #define SFVIDM_MISC_HARDREFRESH (SFVIDM_MISC_FIRST + 0x0004)
  8809. // Range for the client's additional menus
  8810. #define SFVIDM_CLIENT_FIRST (SFVIDM_FIRST + 0x0200)
  8811. #define SFVIDM_CLIENT_LAST (SFVIDM_FIRST + 0x02ff)
  8812. // ---- SFVIDM_UNUSED_FIRST (SFVIDM_FIRST + 0x0300)
  8813. #define SFVIDM_DESKTOP_FIRST (SFVIDM_FIRST + 0x0400)
  8814. #define SFVIDM_DESKTOPHTML_WEBCONTENT (SFVIDM_DESKTOP_FIRST + 0x0001)
  8815. #define SFVIDM_DESKTOPHTML_ICONS (SFVIDM_DESKTOP_FIRST + 0x0002)
  8816. #define SFVIDM_DESKTOPHTML_LOCK (SFVIDM_DESKTOP_FIRST + 0x0003)
  8817. #define SFVIDM_DESKTOPHTML_WIZARD (SFVIDM_DESKTOP_FIRST + 0x0004)
  8818. #define SFVIDM_DESKTOP_LAST (SFVIDM_FIRST + 0x04ff)
  8819. #define SFVIDM_COLUMN_FIRST (SFVIDM_FIRST + 0x0500)
  8820. #define SFVIDM_COLUMN_LAST (SFVIDM_FIRST + 0x05ff)
  8821. #define SFVIDM_GROUPSEP (SFVIDM_FIRST + 0x0600)
  8822. #define SFVIDM_GROUPBY (SFVIDM_FIRST + 0x0601)
  8823. #define SFVIDM_GROUPSFIRST (SFVIDM_FIRST + 0x0602)
  8824. #define SFVIDM_GROUPSLAST (SFVIDM_FIRST + 0x067f)
  8825. #define SFVIDM_GROUPSEXTENDEDFIRST (SFVIDM_FIRST + 0x0680)
  8826. #define SFVIDM_GROUPSEXTENDEDLAST (SFVIDM_FIRST + 0x06ff)
  8827. // Range for context menu id's
  8828. #define SFVIDM_CONTEXT_FIRST (SFVIDM_FIRST + 0x0800)
  8829. #define SFVIDM_CONTEXT_LAST (SFVIDM_FIRST + 0x0900)
  8830. #define SFVIDM_BACK_CONTEXT_FIRST (SFVIDM_FIRST + 0x0901)
  8831. #define SFVIDM_BACK_CONTEXT_LAST (SFVIDM_FIRST + 0x09ff)
  8832. // DOC'ed for DOJ compliance:
  8833. ;end_internal
  8834. typedef TBINFO * LPTBINFO;
  8835. typedef DETAILSINFO *PDETAILSINFO;
  8836. ;begin_internal
  8837. typedef COPYHOOKINFO *LPCOPYHOOKINFO;
  8838. // uMsg wParam lParam
  8839. #define DVM_MERGEMENU SFVM_MERGEMENU // uFlags LPQCMINFO
  8840. #define DVM_INVOKECOMMAND SFVM_INVOKECOMMAND // idCmd 0
  8841. #define DVM_GETHELPTEXT SFVM_GETHELPTEXT // idCmd,cchMax pszText - Ansi
  8842. #define DVM_GETTOOLTIPTEXT SFVM_GETTOOLTIPTEXT // idCmd,cchMax pszText
  8843. #define DVM_GETBUTTONINFO SFVM_GETBUTTONINFO // 0 LPTBINFO
  8844. #define DVM_GETBUTTONS SFVM_GETBUTTONS // idCmdFirst,cbtnMax LPTBBUTTON
  8845. #define DVM_INITMENUPOPUP SFVM_INITMENUPOPUP // idCmdFirst,nIndex hmenu
  8846. #define DVM_SELCHANGE SFVM_SELCHANGE // idCmdFirst,nItem PDVSELCHANGEINFO
  8847. #define DVM_DRAWITEM SFVM_DRAWITEM // idCmdFirst pdis
  8848. #define DVM_MEASUREITEM SFVM_MEASUREITEM // idCmdFirst pmis
  8849. #define DVM_EXITMENULOOP SFVM_EXITMENULOOP // - -
  8850. #define DVM_RELEASE SFVM_PRERELEASE // - lSelChangeInfo (ShellFolder private)
  8851. #define DVM_GETCCHMAX SFVM_GETCCHMAX // pidlItem pcchMax
  8852. #define DVM_FSNOTIFY SFVM_FSNOTIFY // LPITEMIDLIST* lEvent
  8853. #define DVM_WINDOWCREATED SFVM_WINDOWCREATED // hwnd PDVSELCHANGEINFO
  8854. #define DVM_WINDOWDESTROY SFVM_WINDOWDESTROY // hwnd PDVSELCHANGEINFO
  8855. #define DVM_REFRESH SFVM_REFRESH // - lSelChangeInfo
  8856. #define DVM_SETFOCUS SFVM_SETFOCUS // - lSelChangeInfo
  8857. #define DVM_KILLFOCUS 19 // unused
  8858. #define DVM_QUERYCOPYHOOK SFVM_QUERYCOPYHOOK // - -
  8859. #define DVM_NOTIFYCOPYHOOK SFVM_NOTIFYCOPYHOOK // - LPCOPYHOOKINFO
  8860. #define DVM_NOTIFY SFVM_NOTIFY // idFrom LPNOTIFY
  8861. #define DVM_GETDETAILSOF SFVM_GETDETAILSOF // iColumn PDETAILSINFO
  8862. #define DVM_COLUMNCLICK SFVM_COLUMNCLICK // iColumn -
  8863. #define DVM_QUERYFSNOTIFY SFVM_QUERYFSNOTIFY // - FSNotifyEntry *
  8864. #define DVM_DEFITEMCOUNT SFVM_DEFITEMCOUNT // - PINT
  8865. #define DVM_DEFVIEWMODE SFVM_DEFVIEWMODE // - PFOLDERVIEWMODE
  8866. #define DVM_UNMERGEMENU SFVM_UNMERGEMENU // uFlags
  8867. #define DVM_INSERTITEM SFVM_INSERTITEM // pidl PDVSELCHANGEINFO
  8868. #define DVM_DELETEITEM SFVM_DELETEITEM // pidl PDVSELCHANGEINFO
  8869. #define DVM_UPDATESTATUSBAR SFVM_UPDATESTATUSBAR // - lSelChangeInfo
  8870. #define DVM_BACKGROUNDENUM SFVM_BACKGROUNDENUM //
  8871. #define DVM_GETWORKINGDIR SFVM_GETWORKINGDIR //
  8872. #define DVM_GETCOLSAVESTREAM SFVM_GETCOLSAVESTREAM // flags IStream **
  8873. #define DVM_SELECTALL SFVM_SELECTALL // lSelChangeInfo
  8874. #define DVM_DIDDRAGDROP SFVM_DIDDRAGDROP // dwEffect IDataObject *
  8875. #define DVM_SUPPORTSIDENTIFY SFVM_SUPPORTSIDENTITY // - -
  8876. #define DVM_FOLDERISPARENT SFVM_FOLDERISPARENT // - pidlChild
  8877. // max length for guid strings
  8878. #define GUIDSTR_MAX (1+ 8 + 1 + 4 + 1 + 4 + 1 + 4 + 1 + 12 + 1 + 1)
  8879. typedef struct _DVSELCHANGEINFO {
  8880. UINT uOldState;
  8881. UINT uNewState;
  8882. LPARAM lParamItem;
  8883. LPARAM* plParam;
  8884. } DVSELCHANGEINFO, *PDVSELCHANGEINFO;
  8885. // DOC'ed for DOJ compliance:
  8886. ;end_internal
  8887. typedef HRESULT (CALLBACK * LPFNVIEWCALLBACK)(IShellView *psvOuter,
  8888. IShellFolder *psf,
  8889. HWND hwndMain,
  8890. UINT uMsg,
  8891. WPARAM wParam,
  8892. LPARAM lParam);
  8893. // SHCreateShellFolderViewEx struct
  8894. typedef struct _CSFV
  8895. {
  8896. UINT cbSize;
  8897. IShellFolder * pshf;
  8898. IShellView * psvOuter;
  8899. LPCITEMIDLIST pidl;
  8900. LONG lEvents;
  8901. LPFNVIEWCALLBACK pfnCallback; // No callback if NULL
  8902. FOLDERVIEWMODE fvm;
  8903. } CSFV, * LPCSFV;
  8904. ;begin_internal
  8905. // DOC'ed for DOJ Compliance
  8906. ;end_internal
  8907. // Tell the FolderView to rearrange. The lParam will be passed to
  8908. // IShellFolder::CompareIDs
  8909. #define SFVM_REARRANGE 0x00000001
  8910. #define ShellFolderView_ReArrange(_hwnd, _lparam) \
  8911. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_REARRANGE, _lparam)
  8912. ;begin_internal
  8913. // Get the last sorting parameter given to FolderView
  8914. #define SFVM_GETARRANGEPARAM 0x00000002
  8915. #define ShellFolderView_GetArrangeParam(_hwnd) \
  8916. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETARRANGEPARAM, 0L)
  8917. // DOC'ed for DOJ Compliance
  8918. ;end_internal
  8919. // Add an OBJECT into the view
  8920. #define SFVM_ADDOBJECT 0x00000003
  8921. #define ShellFolderView_AddObject(_hwnd, _pidl) \
  8922. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_ADDOBJECT, (LPARAM)_pidl)
  8923. ;begin_internal
  8924. // Gets the count of objects in the view
  8925. #define SFVM_GETOBJECTCOUNT 0x00000004
  8926. #define ShellFolderView_GetObjectCount(_hwnd) \
  8927. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETOBJECTCOUNT, (LPARAM)0)
  8928. // Returns a pointer to the Idlist associated with the specified index
  8929. // Returns NULL if at end of list.
  8930. #define SFVM_GETOBJECT 0x00000005
  8931. #define ShellFolderView_GetObject(_hwnd, _iObject) \
  8932. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETOBJECT, _iObject)
  8933. // DOC'ed for DOJ Compliance
  8934. ;end_internal
  8935. // Remove an OBJECT into the view
  8936. #define SFVM_REMOVEOBJECT 0x00000006
  8937. #define ShellFolderView_RemoveObject(_hwnd, _pidl) \
  8938. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_REMOVEOBJECT, (LPARAM)_pidl)
  8939. // updates an object by passing in pointer to two PIDLS, the first
  8940. // is the old pidl, the second one is the one with update information.
  8941. //
  8942. // _ppidl[1] must be a *copy* of a pidl, as control over the lifetime
  8943. // of the pidl belongs to the view after successful completion of
  8944. // this call. (Unsuccessful completion (a -1 return) implies failure
  8945. // and the caller must free the memory.) Win95 waits a while before
  8946. // freeing the pidl, IE4 frees the pidl immediately.
  8947. // IShellFolderView::UpdateObject does not suffer from this problem.
  8948. //
  8949. #define SFVM_UPDATEOBJECT 0x00000007
  8950. #define ShellFolderView_UpdateObject(_hwnd, _ppidl) \
  8951. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_UPDATEOBJECT, (LPARAM)_ppidl)
  8952. ;begin_internal
  8953. // Sets the redraw mode for the window that is displaying the information
  8954. #define SFVM_SETREDRAW 0x00000008
  8955. #define ShellFolderView_SetRedraw(_hwnd, fRedraw) \
  8956. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_SETREDRAW, (LPARAM)fRedraw)
  8957. // DOC'ed for DOJ Compliance
  8958. ;end_internal
  8959. // Returns an array of the selected IDS to the caller.
  8960. // lparam is a pointer to receive the idlists into
  8961. // return value is the count of items in the array.
  8962. #define SFVM_GETSELECTEDOBJECTS 0x00000009
  8963. #define ShellFolderView_GetSelectedObjects(_hwnd, ppidl) \
  8964. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETSELECTEDOBJECTS, (LPARAM)ppidl)
  8965. ;begin_internal
  8966. // Checks if the current drop is on the view window
  8967. // lparam is unused
  8968. // return value is TRUE if the current drop is upon the background of the
  8969. // view window, FALSE otherwise
  8970. #define SFVM_ISDROPONSOURCE 0x0000000a
  8971. #define ShellFolderView_IsDropOnSource(_hwnd, _pdtgt) \
  8972. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_ISDROPONSOURCE, (LPARAM)_pdtgt)
  8973. // Moves the selected icons in the listview
  8974. // lparam is a pointer to a drop target
  8975. // return value is unused
  8976. #define SFVM_MOVEICONS 0x0000000b
  8977. #define ShellFolderView_MoveIcons(_hwnd, _pdt) \
  8978. (void)SHShellFolderView_Message(_hwnd, SFVM_MOVEICONS, (LPARAM)(LPDROPTARGET)_pdt)
  8979. // Gets the start point of a drag-drop
  8980. // lparam is a pointer to a point
  8981. // return value is unused
  8982. #define SFVM_GETDRAGPOINT 0x0000000c
  8983. #define ShellFolderView_GetDragPoint(_hwnd, _ppt) \
  8984. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_GETDRAGPOINT, (LPARAM)(LPPOINT)_ppt)
  8985. // Gets the end point of a drag-drop
  8986. // lparam is a pointer to a point
  8987. // return value is unused
  8988. #define SFVM_GETDROPPOINT 0x0000000d
  8989. #define ShellFolderView_GetDropPoint(_hwnd, _ppt) \
  8990. SHShellFolderView_Message(_hwnd, SFVM_GETDROPPOINT, (LPARAM)(LPPOINT)_ppt)
  8991. #define ShellFolderView_GetAnchorPoint(_hwnd, _fStart, _ppt) \
  8992. (BOOL)((_fStart) ? ShellFolderView_GetDragPoint(_hwnd, _ppt) : ShellFolderView_GetDropPoint(_hwnd, _ppt))
  8993. // DOC'ed for DOJ Compliance
  8994. ;end_internal
  8995. typedef struct _SFV_SETITEMPOS
  8996. {
  8997. LPCITEMIDLIST pidl;
  8998. POINT pt;
  8999. } SFV_SETITEMPOS, *LPSFV_SETITEMPOS;
  9000. // Sets the position of an item in the viewer
  9001. // lparam is a pointer to a SVF_SETITEMPOS
  9002. // return value is unused
  9003. #define SFVM_SETITEMPOS 0x0000000e
  9004. #define ShellFolderView_SetItemPos(_hwnd, _pidl, _x, _y) \
  9005. { SFV_SETITEMPOS _sip = {_pidl, {_x, _y}}; \
  9006. SHShellFolderView_Message(_hwnd, SFVM_SETITEMPOS, (LPARAM)(LPSFV_SETITEMPOS)&_sip);}
  9007. ;begin_internal
  9008. // Determines if a given drop target interface is the one being used for
  9009. // the background of the ShellFolderView (as opposed to an object in the
  9010. // view)
  9011. // lparam is a pointer to a drop target interface
  9012. // return value is TRUE if it is the background drop target, FALSE otherwise
  9013. #define SFVM_ISBKDROPTARGET 0x0000000f
  9014. #define ShellFolderView_IsBkDropTarget(_hwnd, _pdptgt) \
  9015. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_ISBKDROPTARGET, (LPARAM)(LPDROPTARGET)_pdptgt)
  9016. // DOC'ed for DOJ Compliance
  9017. ;end_internal
  9018. // Notifies a ShellView when one of its objects get put on the clipboard
  9019. // as a result of a menu command.
  9020. //
  9021. // called by defcm.c when it does a copy/cut ;internal
  9022. //
  9023. // lparam is the dwEffect (DROPEFFECT_MOVE, DROPEFFECT_COPY)
  9024. // return value is void.
  9025. #define SFVM_SETCLIPBOARD 0x00000010
  9026. #define ShellFolderView_SetClipboard(_hwnd, _dwEffect) \
  9027. (void)SHShellFolderView_Message(_hwnd, SFVM_SETCLIPBOARD, (LPARAM)(DWORD)(_dwEffect))
  9028. ;begin_internal
  9029. // sets auto arrange
  9030. #define SFVM_AUTOARRANGE 0x00000011
  9031. #define ShellFolderView_AutoArrange(_hwnd) \
  9032. (void)SHShellFolderView_Message(_hwnd, SFVM_AUTOARRANGE, 0)
  9033. // sets snap to grid
  9034. #define SFVM_ARRANGEGRID 0x00000012
  9035. #define ShellFolderView_ArrangeGrid(_hwnd) \
  9036. (void)SHShellFolderView_Message(_hwnd, SFVM_ARRANGEGRID, 0)
  9037. #define SFVM_GETAUTOARRANGE 0x00000013
  9038. #define ShellFolderView_GetAutoArrange(_hwnd) \
  9039. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_GETAUTOARRANGE, 0)
  9040. #define SFVM_GETSELECTEDCOUNT 0x00000014
  9041. #define ShellFolderView_GetSelectedCount(_hwnd) \
  9042. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_GETSELECTEDCOUNT, 0)
  9043. typedef ITEMSPACING *LPITEMSPACING;
  9044. #define SFVM_GETITEMSPACING 0x00000015
  9045. #define ShellFolderView_GetItemSpacing(_hwnd, lpis) \
  9046. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_GETITEMSPACING, (LPARAM)lpis)
  9047. // Causes an object to be repainted
  9048. #define SFVM_REFRESHOBJECT 0x00000016
  9049. #define ShellFolderView_RefreshObject(_hwnd, _ppidl) \
  9050. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_REFRESHOBJECT, (LPARAM)_ppidl)
  9051. // Causes the the whole view to be refreshed
  9052. #define ShellFolderView_RefreshAll(_hwnd) \
  9053. (LPARAM)PostMessage(_hwnd, WM_KEYDOWN, (WPARAM)VK_F5, (LPARAM)0);
  9054. // DOC'ed for DOJ Compliance
  9055. ;end_internal
  9056. #define SFVM_SETPOINTS 0x00000017
  9057. #define ShellFolderView_SetPoints(_hwnd, _pdtobj) \
  9058. (void)SHShellFolderView_Message(_hwnd, SFVM_SETPOINTS, (LPARAM)_pdtobj)
  9059. ;begin_internal
  9060. // SVM_SELECTANDPOSITIONITEM lParam
  9061. typedef struct
  9062. {
  9063. LPCITEMIDLIST pidl; // relative pidl to the view
  9064. UINT uSelectFlags; // select flags
  9065. BOOL fMove; // if true, we should also move it to point pt
  9066. POINT pt;
  9067. } SFM_SAP;
  9068. // shell view messages
  9069. #define SVM_SELECTITEM (WM_USER + 1)
  9070. #define SVM_SELECTANDPOSITIONITEM (WM_USER + 5)
  9071. ;end_internal
  9072. ;begin_both
  9073. #include <poppack.h> /* Return to byte packing */
  9074. ;end_both
  9075. ;begin_internal
  9076. //===========================================================================
  9077. // CDefShellFolder members (for easy subclassing)
  9078. //===========================================================================
  9079. // Default implementation (no dependencies to the instance data)
  9080. STDMETHODIMP CDefShellFolder_QueryInterface(IShellFolder *psf, REFIID riid, void **ppv);
  9081. STDMETHODIMP CDefShellFolder_BindToStorage(IShellFolder *psf, LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv);
  9082. STDMETHODIMP CDefShellFolder_BindToObject(IShellFolder *psf, LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv);
  9083. STDMETHODIMP CDefShellFolder_GetAttributesOf(IShellFolder *psf, UINT cidl, LPCITEMIDLIST * apidl, ULONG * rgfOut);
  9084. STDMETHODIMP CDefShellFolder_SetNameOf(IShellFolder *psf, HWND hwndOwner, LPCITEMIDLIST pidl, LPCOLESTR pszName, DWORD dwReserved, LPITEMIDLIST * ppidlOut);
  9085. // File Search APIS
  9086. // DOC'ed for DOJ compliance
  9087. ;end_internal
  9088. SHSTDAPI_(IContextMenu *) SHFind_InitMenuPopup(HMENU hmenu, HWND hwndOwner, UINT idCmdFirst, UINT idCmdLast);
  9089. ;begin_internal
  9090. SHSTDAPI_(void) Control_RunDLL(HWND hwndStub, HINSTANCE hAppInstance, LPSTR pszCmdLine, int nCmdShow);
  9091. SHSTDAPI_(void) Control_RunDLLW(HWND hwndStub, HINSTANCE hAppInstance, LPWSTR pszCmdLine, int nCmdShow);
  9092. SHSTDAPI_(void) Control_RunDLLAsUserW(HWND hwndStub, HINSTANCE hAppInstance, LPWSTR lpwszCmdLine, int nCmdShow);
  9093. // to add 16 bit pages to 32bit things. hGlobal can be NULL
  9094. SHSTDAPI_(UINT) SHAddPages16(HGLOBAL hGlobal, LPCTSTR pszDllEntry, LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam);
  9095. // DOC'ed for DOJ compliance
  9096. ;end_internal
  9097. SHSTDAPI SHCreateShellFolderViewEx(LPCSFV pcsfv, IShellView ** ppsv);
  9098. ;begin_internal
  9099. // Access to MSHMTL's ditherer
  9100. /* Definition of interface: IIntDitherer */
  9101. #undef INTERFACE
  9102. #define INTERFACE IIntDitherer
  9103. DECLARE_INTERFACE_(IIntDitherer, IUnknown)
  9104. {
  9105. #ifndef NO_BASEINTERFACE_FUNCS
  9106. // *** IUnknown methods ***
  9107. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  9108. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  9109. STDMETHOD_(ULONG, Release)(THIS) PURE;
  9110. #endif
  9111. // *** IIntDitherer methods ***
  9112. STDMETHOD(DitherTo8bpp)(THIS_ BYTE * pDestBits, LONG nDestPitch,
  9113. BYTE * pSrcBits, LONG nSrcPitch, REFGUID bfidSrc,
  9114. RGBQUAD * prgbDestColors, RGBQUAD * prgbSrcColors,
  9115. BYTE * pbDestInvMap,
  9116. LONG x, LONG y, LONG cx, LONG cy,
  9117. LONG lDestTrans, LONG lSrcTrans) PURE;
  9118. };
  9119. #ifdef COBJMACROS
  9120. #define IntDitherer_QueryInterface(This,riid,ppvObject) \
  9121. (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
  9122. #define IntDitherer_AddRef(This) \
  9123. (This)->lpVtbl -> AddRef(This)
  9124. #define IntDitherer_Release(This) \
  9125. (This)->lpVtbl -> Release(This)
  9126. #define IntDitherer_DitherTo8bpp(This, pDestBits, nDestPitch, \
  9127. pSrcBits, nSrcPitch, bfidSrc, \
  9128. prgbDestColors, prgbSrcColors, \
  9129. pbDestInvMap, x, y, cx, cy, \
  9130. lDestTrans, lSrcTrans) \
  9131. (This)->lpVtbl -> DitherTo8bpp(This, pDestBits, nDestPitch, pSrcBits, nSrcPitch, bfidSrc, \
  9132. prgbDestColors, prgbSrcColors, pbDestInvMap, x, y, cx, cy, lDestTrans, lSrcTrans)
  9133. #endif
  9134. ;end_internal
  9135. //
  9136. // PROPIDs for Internet Shortcuts (FMTID_Intshcut) to be used with
  9137. // IPropertySetStorage/IPropertyStorage
  9138. //
  9139. // The known property ids and their variant types are:
  9140. // PID_IS_URL [VT_LPWSTR] URL
  9141. // PID_IS_SCHEME [VT_UI4] Scheme value ;Internal
  9142. // PID_IS_NAME [VT_LPWSTR] Name of the internet shortcut
  9143. // PID_IS_WORKINGDIR [VT_LPWSTR] Working directory for the shortcut
  9144. // PID_IS_HOTKEY [VT_UI2] Hotkey for the shortcut
  9145. // PID_IS_SHOWCMD [VT_I4] Show command for shortcut
  9146. // PID_IS_ICONINDEX [VT_I4] Index into file that has icon
  9147. // PID_IS_ICONFILE [VT_LPWSTR] File that has the icon
  9148. // PID_IS_WHATSNEW [VT_LPWSTR] What's New text
  9149. // PID_IS_AUTHOR [VT_LPWSTR] Author
  9150. // PID_IS_DESCRIPTION [VT_LPWSTR] Description text of site
  9151. // PID_IS_COMMENT [VT_LPWSTR] User annotated comment
  9152. //
  9153. #define PID_IS_FIRST 2 ;Internal
  9154. #define PID_IS_URL 2
  9155. #define PID_IS_SCHEME 3 ;Internal
  9156. #define PID_IS_NAME 4
  9157. #define PID_IS_WORKINGDIR 5
  9158. #define PID_IS_HOTKEY 6
  9159. #define PID_IS_SHOWCMD 7
  9160. #define PID_IS_ICONINDEX 8
  9161. #define PID_IS_ICONFILE 9
  9162. #define PID_IS_WHATSNEW 10
  9163. #define PID_IS_AUTHOR 11
  9164. #define PID_IS_DESCRIPTION 12
  9165. #define PID_IS_COMMENT 13
  9166. #define PID_IS_IDLIST 14 ;Internal
  9167. #define PID_IS_LAST 14 ;Internal
  9168. //
  9169. // PROPIDs for Internet Sites (FMTID_InternetSite) to be used with
  9170. // IPropertySetStorage/IPropertyStorage
  9171. //
  9172. // The known property ids and their variant types are:
  9173. // PID_INTSITE_WHATSNEW [VT_LPWSTR] What's New text
  9174. // PID_INTSITE_AUTHOR [VT_LPWSTR] Author
  9175. // PID_INTSITE_LASTVISIT [VT_FILETIME] Time site was last visited
  9176. // PID_INTSITE_LASTMOD [VT_FILETIME] Time site was last modified
  9177. // PID_INTSITE_VISITCOUNT [VT_UI4] Number of times user has visited
  9178. // PID_INTSITE_DESCRIPTION [VT_LPWSTR] Description text of site
  9179. // PID_INTSITE_COMMENT [VT_LPWSTR] User annotated comment
  9180. // PID_INTSITE_FLAGS [VT_UI4] PIDISF_ flags ;Internal
  9181. // PID_INTSITE_CONTENTLEN [VT_UI4] Content length ;Internal
  9182. // PID_INTSITE_CONTENTCODE [VT_UI8] Content code ;Internal
  9183. // PID_INTSITE_RECURSE [VT_UI4] Levels to recurse (0-3)
  9184. // PID_INTSITE_WATCH [VT_UI4] PIDISM_ flags
  9185. // PID_INTSITE_SUBSCRIPTION [VT_UI8] Subscription cookie
  9186. // PID_INTSITE_URL [VT_LPWSTR] URL
  9187. // PID_INTSITE_TITLE [VT_LPWSTR] Title
  9188. // PID_INTSITE_FRAGMENT [VT_NULL] Fragments ;Internal
  9189. // PID_INTSITE_CODEPAGE [VT_UI4] Codepage of the document
  9190. // PID_INTSITE_TRACKING [VT_UI4] Tracking
  9191. // PID_INTSITE_ICONINDEX [VT_I4] Retrieve the index to the icon
  9192. // PID_INTSITE_ICONFILE [VT_LPWSTR] Retrieve the file containing the icon index.
  9193. #define PID_INTSITE_FIRST 2 ;Internal
  9194. #define PID_INTSITE_WHATSNEW 2
  9195. #define PID_INTSITE_AUTHOR 3
  9196. #define PID_INTSITE_LASTVISIT 4
  9197. #define PID_INTSITE_LASTMOD 5
  9198. #define PID_INTSITE_VISITCOUNT 6
  9199. #define PID_INTSITE_DESCRIPTION 7
  9200. #define PID_INTSITE_COMMENT 8
  9201. #define PID_INTSITE_FLAGS 9
  9202. #define PID_INTSITE_CONTENTLEN 10
  9203. #define PID_INTSITE_CONTENTCODE 11
  9204. #define PID_INTSITE_RECURSE 12
  9205. #define PID_INTSITE_WATCH 13
  9206. #define PID_INTSITE_SUBSCRIPTION 14
  9207. #define PID_INTSITE_URL 15
  9208. #define PID_INTSITE_TITLE 16
  9209. #define PID_INTSITE_FRAGMENT 17 ;Internal
  9210. #define PID_INTSITE_CODEPAGE 18
  9211. #define PID_INTSITE_TRACKING 19
  9212. #define PID_INTSITE_ICONINDEX 20
  9213. #define PID_INTSITE_ICONFILE 21
  9214. #define PID_INTSITE_LAST 21 ;Internal
  9215. // Flags for PID_IS_FLAGS
  9216. #define PIDISF_RECENTLYCHANGED 0x00000001
  9217. #define PIDISF_CACHEDSTICKY 0x00000002
  9218. #define PIDISF_CACHEIMAGES 0x00000010
  9219. #define PIDISF_FOLLOWALLLINKS 0x00000020
  9220. //Is URL entered in IE history bucket? ; Internal
  9221. #define PIDISF_HISTORY 0x10000000 ; Internal
  9222. // Values for PID_INTSITE_WATCH
  9223. #define PIDISM_GLOBAL 0 // Monitor based on global setting
  9224. #define PIDISM_WATCH 1 // User says watch
  9225. #define PIDISM_DONTWATCH 2 // User says don't watch
  9226. ////////////////////////////////////////////////////////////////////
  9227. //
  9228. // The shell keeps track of some per-user state to handle display
  9229. // options that is of major interest to ISVs.
  9230. // The key one requested right now is "DoubleClickInWebView".
  9231. ;begin_internal
  9232. // Athena needs this to determine whether to double click or not.
  9233. //
  9234. // NOTE: if user uninstalls IE4, the Win95 code will
  9235. // realize that the size has changed (even though it's not
  9236. // in this struct, it is saved) and drop back to default state.
  9237. //
  9238. // Since we're exporting this so ISVs can get access to our flags,
  9239. // let's avoid the need for a thunk and export the beginning section
  9240. // of this structure ONLY. Here are the A and W versions for internal use:
  9241. //
  9242. // DOC'ed for DOJ compliance
  9243. ;end_internal
  9244. typedef struct {
  9245. // These were in Win95 //;Internal
  9246. BOOL fShowAllObjects : 1;
  9247. BOOL fShowExtensions : 1;
  9248. BOOL fNoConfirmRecycle : 1;
  9249. // The below were added for IE4 //;Internal
  9250. BOOL fShowSysFiles : 1;
  9251. BOOL fShowCompColor : 1;
  9252. BOOL fDoubleClickInWebView : 1;
  9253. BOOL fDesktopHTML : 1;
  9254. BOOL fWin95Classic : 1;
  9255. BOOL fDontPrettyPath : 1;
  9256. BOOL fShowAttribCol : 1; // No longer used, dead bit
  9257. BOOL fMapNetDrvBtn : 1;
  9258. BOOL fShowInfoTip : 1;
  9259. BOOL fHideIcons : 1;
  9260. BOOL fWebView : 1;
  9261. BOOL fFilter : 1;
  9262. BOOL fShowSuperHidden : 1;
  9263. BOOL fNoNetCrawling : 1;
  9264. DWORD dwWin95Unused; // Win95 only - no longer supported pszHiddenFileExts
  9265. UINT uWin95Unused; // Win95 only - no longer supported cbHiddenFileExts
  9266. ;begin_internal
  9267. // These must have been an OSR release, as they aren't on \\guilo\slmadd\src\dev\inc16\shsemip.h
  9268. ;end_internal
  9269. // Note: Not a typo! This is a persisted structure so we cannot use LPARAM
  9270. LONG lParamSort;
  9271. int iSortDirection;
  9272. ;begin_internal
  9273. // This was added for IE4
  9274. ;end_internal
  9275. UINT version;
  9276. // new for win2k. need notUsed var to calc the right size of ie4 struct
  9277. // FIELD_OFFSET does not work on bit fields
  9278. UINT uNotUsed; // feel free to rename and use
  9279. BOOL fSepProcess: 1;
  9280. // new for Whistler.
  9281. BOOL fStartPanelOn: 1; //Indicates if the Whistler StartPanel mode is ON or OFF.
  9282. BOOL fShowStartPage: 1; //Indicates if the Whistler StartPage on desktop is ON or OFF.
  9283. // If you need a new flag, steal a bit from from fSpareFlags.;internal
  9284. UINT fSpareFlags : 13;
  9285. // ;internal
  9286. // If you add any fields to this structure, you ;internal
  9287. // must also add upgrade code to shell32\util.cpp. ;internal
  9288. // ;internal
  9289. } SHELLSTATEA, *LPSHELLSTATEA;
  9290. typedef struct {
  9291. BOOL fShowAllObjects : 1;
  9292. BOOL fShowExtensions : 1;
  9293. BOOL fNoConfirmRecycle : 1;
  9294. BOOL fShowSysFiles : 1;
  9295. BOOL fShowCompColor : 1;
  9296. BOOL fDoubleClickInWebView : 1;
  9297. BOOL fDesktopHTML : 1;
  9298. BOOL fWin95Classic : 1;
  9299. BOOL fDontPrettyPath : 1;
  9300. BOOL fShowAttribCol : 1;
  9301. BOOL fMapNetDrvBtn : 1;
  9302. BOOL fShowInfoTip : 1;
  9303. BOOL fHideIcons : 1;
  9304. BOOL fWebView : 1;
  9305. BOOL fFilter : 1;
  9306. BOOL fShowSuperHidden : 1;
  9307. BOOL fNoNetCrawling : 1;
  9308. DWORD dwWin95Unused; // Win95 only - no longer supported pszHiddenFileExts
  9309. UINT uWin95Unused; // Win95 only - no longer supported cbHiddenFileExts
  9310. // Note: Not a typo! This is a persisted structure so we cannot use LPARAM
  9311. LONG lParamSort;
  9312. int iSortDirection;
  9313. UINT version;
  9314. // new for win2k. need notUsed var to calc the right size of ie4 struct
  9315. // FIELD_OFFSET does not work on bit fields
  9316. UINT uNotUsed; // feel free to rename and use
  9317. BOOL fSepProcess: 1;
  9318. // new for Whistler.
  9319. BOOL fStartPanelOn: 1; //Indicates if the Whistler StartPage mode is ON or OFF.
  9320. BOOL fShowStartPage: 1; //Indicates if the Whistler StartPage on desktop is ON or OFF.
  9321. // If you need a new flag, steal a bit from from fSpareFlags.
  9322. UINT fSpareFlags : 13;
  9323. // ;internal
  9324. // If you add any fields to this structure, you ;internal
  9325. // must also add upgrade code to shell32\util.cpp. ;internal
  9326. // ;internal
  9327. } SHELLSTATEW, *LPSHELLSTATEW;
  9328. #define SHELLSTATEVERSION_IE4 9
  9329. #define SHELLSTATEVERSION_WIN2K 10
  9330. #define SHELLSTATEVERSION 13 // rev if defaults change but size doesn't //;Internal
  9331. #ifdef UNICODE
  9332. #define SHELLSTATE SHELLSTATEW
  9333. #define LPSHELLSTATE LPSHELLSTATEW
  9334. #else
  9335. #define SHELLSTATE SHELLSTATEA
  9336. #define LPSHELLSTATE LPSHELLSTATEA
  9337. #endif
  9338. #define SHELLSTATE_SIZE_WIN95 FIELD_OFFSET(SHELLSTATE,lParamSort)
  9339. #define SHELLSTATE_SIZE_NT4 FIELD_OFFSET(SHELLSTATE,version)
  9340. #define SHELLSTATE_SIZE_IE4 FIELD_OFFSET(SHELLSTATE,uNotUsed)
  9341. #define SHELLSTATE_SIZE_WIN2K sizeof(SHELLSTATE)
  9342. SHSTDAPI_(void) SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet);
  9343. ;begin_internal
  9344. // And here's the beginning portion for public use:
  9345. ;end_internal
  9346. //
  9347. // SysFiles are these windows special files:
  9348. // "dll sys vxd 386 drv"
  9349. //
  9350. // hidden files are files with the FILE_ATTRIBUTE_HIDDEN attribute
  9351. //
  9352. // system files are files with the FILE_ATTRIBUTE_SYSTEM attribute
  9353. //
  9354. // fShowAllObjects fShowSysFiles Result
  9355. // --------------- ------------- ------
  9356. // 0 0 hide hidden + SysFiles + system files
  9357. // 0 1 hide hidden files.
  9358. // 1 0 show all files.
  9359. // 1 1 show all files.
  9360. //
  9361. typedef struct {
  9362. BOOL fShowAllObjects : 1;
  9363. BOOL fShowExtensions : 1;
  9364. BOOL fNoConfirmRecycle : 1;
  9365. BOOL fShowSysFiles : 1;
  9366. BOOL fShowCompColor : 1;
  9367. BOOL fDoubleClickInWebView : 1;
  9368. BOOL fDesktopHTML : 1;
  9369. BOOL fWin95Classic : 1;
  9370. BOOL fDontPrettyPath : 1;
  9371. BOOL fShowAttribCol : 1;
  9372. BOOL fMapNetDrvBtn : 1;
  9373. BOOL fShowInfoTip : 1;
  9374. BOOL fHideIcons : 1;
  9375. UINT fRestFlags : 3;
  9376. } SHELLFLAGSTATE, *LPSHELLFLAGSTATE;
  9377. #define SSF_SHOWALLOBJECTS 0x00000001
  9378. #define SSF_SHOWEXTENSIONS 0x00000002
  9379. #define SSF_HIDDENFILEEXTS 0x00000004
  9380. #define SSF_SERVERADMINUI 0x00000004
  9381. #define SSF_SHOWCOMPCOLOR 0x00000008
  9382. #define SSF_SORTCOLUMNS 0x00000010
  9383. #define SSF_SHOWSYSFILES 0x00000020
  9384. #define SSF_DOUBLECLICKINWEBVIEW 0x00000080
  9385. #define SSF_SHOWATTRIBCOL 0x00000100
  9386. #define SSF_DESKTOPHTML 0x00000200
  9387. #define SSF_WIN95CLASSIC 0x00000400
  9388. #define SSF_DONTPRETTYPATH 0x00000800
  9389. #define SSF_SHOWINFOTIP 0x00002000
  9390. #define SSF_MAPNETDRVBUTTON 0x00001000
  9391. #define SSF_NOCONFIRMRECYCLE 0x00008000
  9392. #define SSF_HIDEICONS 0x00004000
  9393. #define SSF_FILTER 0x00010000
  9394. #define SSF_WEBVIEW 0x00020000
  9395. #define SSF_SHOWSUPERHIDDEN 0x00040000
  9396. #define SSF_SEPPROCESS 0x00080000
  9397. #define SSF_NONETCRAWLING 0x00100000
  9398. #define SSF_STARTPANELON 0x00200000
  9399. #define SSF_SHOWSTARTPAGE 0x00400000
  9400. // SHGetSettings(LPSHELLFLAGSTATE lpss, DWORD dwMask)
  9401. //
  9402. // Specify the bits you are interested in in dwMask and they will be
  9403. // filled out in the lpss structure.
  9404. //
  9405. // When these settings change, a WM_SETTINGCHANGE message is sent
  9406. // with the string lParam value of "ShellState".
  9407. //
  9408. SHSTDAPI_(void) SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
  9409. // SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, void **ppv, LPCITEMIDLIST *ppidlLast)
  9410. //
  9411. // Given a pidl, you can get an interface pointer (as specified by riid) of the pidl's parent folder (in ppv)
  9412. // If ppidlLast is non-NULL, you can also get the pidl of the last item.
  9413. //
  9414. SHSTDAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, void **ppv, LPCITEMIDLIST *ppidlLast);
  9415. // SHSTDAPI SHParseDisplayName(PCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
  9416. //
  9417. // given a string it will call psfDesktop->ParseDisplayName() to try and create a pidl
  9418. // if no pbc specified, it uses the preferred options for parsing.
  9419. // this includes mapping file system paths to their appropriate aliased location (RegisterObjectParam(STR_PARSE_TRANSLATE_ALIASES))
  9420. // psfgaoOut is optional for SFGAO attributes
  9421. //
  9422. SHSTDAPI SHParseDisplayName(PCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut);
  9423. // SHPathPrepareForWrite(HWND hwnd, IUnknown *punkEnableModless, LPCTSTR pszPath, DWORD dwFlags)
  9424. //
  9425. // DESCRIPTION:
  9426. // This API will prepare the path for the caller. This includes:
  9427. // 1. Prompting for the ejectable media to be re-inserted. (Floppy, CD-ROM, ZIP drive, etc.)
  9428. // 2. Prompting for the media to be formatted. (Floppy, hard drive, etc.)
  9429. // 3. Remount mapped drives if the connection was lost. (\\unc\share mapped to N: becomes disconnected)
  9430. // 4. If the path doesn't exist, create it. (SHPPFW_DIRCREATE and SHPPFW_ASKDIRCREATE)
  9431. // 5. Display an error if the media is read only. (SHPPFW_NOWRITECHECK not set)
  9432. //
  9433. // PARAMETERS:
  9434. // hwnd: Parernt window for UI. NULL means don't display UI. OPTIONAL
  9435. // punkEnableModless: Parent that will be set to modal during UI using IOleInPlaceActiveObject::EnableModeless(). OPTIONAL
  9436. // pszPath: Path to verify is valid for writting. This can be a UNC or file drive path. The path
  9437. // should only contain directories. Pass SHPPFW_IGNOREFILENAME if the last path segment
  9438. // is always filename to ignore.
  9439. // dwFlags: SHPPFW_* Flags to modify behavior
  9440. //
  9441. //-------------------------------------------------------------------------
  9442. #define SHPPFW_NONE 0x00000000
  9443. #define SHPPFW_DEFAULT SHPPFW_DIRCREATE // May change
  9444. #define SHPPFW_DIRCREATE 0x00000001 // Create the directory if it doesn't exist without asking the user.
  9445. #define SHPPFW_ASKDIRCREATE 0x00000002 // Create the directory if it doesn't exist after asking the user.
  9446. #define SHPPFW_IGNOREFILENAME 0x00000004 // Ignore the last item in pszPath because it's a file. Example: pszPath="C:\DirA\DirB", only use "C:\DirA".
  9447. #define SHPPFW_NOWRITECHECK 0x00000008 // Caller only needs to read from the drive, so don't check if it's READ ONLY.
  9448. #define SHPPFW_MEDIACHECKONLY 0x00000010 // do the retrys on the media (or net path), return errors if the file can't be found
  9449. SHSTDAPI SHPathPrepareForWrite%(HWND hwnd, IUnknown *punkEnableModless, LPCTSTR% pszPath, DWORD dwFlags);
  9450. //--------------------------------------------------------------------------
  9451. //
  9452. // Interface used for exposing the INI file methods on a shortcut file
  9453. //
  9454. //
  9455. //--------------------------------------------------------------------------
  9456. #undef INTERFACE
  9457. #define INTERFACE INamedPropertyBag
  9458. DECLARE_INTERFACE_(INamedPropertyBag, IUnknown)
  9459. {
  9460. // *** IUnknown methods ***
  9461. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  9462. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  9463. STDMETHOD_(ULONG,Release) (THIS) PURE;
  9464. // *** INamedPropertyBag methods ***
  9465. STDMETHOD(ReadPropertyNPB) (THIS_ /* [in] */ LPCOLESTR pszBagname,
  9466. /* [in] */ LPCOLESTR pszPropName,
  9467. /* [out][in] */ PROPVARIANT *pVar) PURE;
  9468. STDMETHOD(WritePropertyNPB)(THIS_ /* [in] */ LPCOLESTR pszBagname,
  9469. /* [in] */ LPCOLESTR pszPropName,
  9470. /* [in] */ PROPVARIANT *pVar) PURE;
  9471. STDMETHOD(RemovePropertyNPB)(THIS_ /* [in] */ LPCOLESTR pszBagname,
  9472. /* [in] */ LPCOLESTR pszPropName) PURE;
  9473. };
  9474. #ifdef __urlmon_h__
  9475. // NOTE: urlmon.h must be included before shlobj.h to access this function.
  9476. //
  9477. // SoftwareUpdateMessageBox
  9478. //
  9479. // Provides a standard message box for the alerting the user that a software
  9480. // update is available or installed. No UI will be displayed if there is no
  9481. // update available or if the available update version is less than or equal
  9482. // to the Advertised update version.
  9483. //
  9484. // hWnd - [in] Handle of owner window
  9485. // szDistUnit - [in] Unique identifier string for a code distribution unit. For
  9486. // ActiveX controls and Active Setup installed components, this
  9487. // is typically a GUID string.
  9488. // dwFlags - [in] Must be 0.
  9489. // psdi - [in,out] Pointer to SOFTDISTINFO ( see URLMon.h ). May be NULL.
  9490. // cbSize should be initialized
  9491. // by the caller to sizeof(SOFTDISTINFO), dwReserved should be set to 0.
  9492. //
  9493. // RETURNS:
  9494. //
  9495. // IDNO - The user chose cancel. If *pbRemind is FALSE, the caller should save the
  9496. // update version from the SOFTDISTINFO and pass it in as the Advertised
  9497. // version in future calls.
  9498. //
  9499. // IDYES - The user has selected Update Now/About Update. The caller should navigate to
  9500. // the SOFTDISTINFO's pszHREF to initiate the install or learn about it.
  9501. // The caller should save the update version from the SOFTDISTINFO and pass
  9502. // it in as the Advertised version in future calls.
  9503. //
  9504. // IDIGNORE - There is no pending software update. Note: There is
  9505. // no Ignore button in the standard UI. This occurs if the available
  9506. // version is less than the installed version or is not present or if the
  9507. // Advertised version is greater than or equal to the update version.
  9508. //
  9509. // IDABORT - An error occured. Call GetSoftwareUpdateInfo() for a more specific HRESULT.
  9510. // Note: There is no Abort button in the standard UI.
  9511. SHDOCAPI_(DWORD) SoftwareUpdateMessageBox( HWND hWnd,
  9512. LPCWSTR szDistUnit,
  9513. DWORD dwFlags,
  9514. LPSOFTDISTINFO psdi );
  9515. #endif // if __urlmon_h__
  9516. ;begin_internal
  9517. // CmdID's for CGID_MENUDESKBAR
  9518. #define MBCID_GETSIDE 1
  9519. #define MBCID_RESIZE 2
  9520. #define MBCID_SETEXPAND 3
  9521. #define MBCID_SETFLAT 4
  9522. #define MBCID_NOBORDER 5
  9523. // menubar orientation
  9524. #define MENUBAR_LEFT ABE_LEFT
  9525. #define MENUBAR_TOP ABE_TOP
  9526. #define MENUBAR_RIGHT ABE_RIGHT
  9527. #define MENUBAR_BOTTOM ABE_BOTTOM
  9528. //
  9529. // Net Access Wizard - called from NetID and WinLogon.
  9530. //
  9531. #define NAW_NETID 0x00 // called from netid tab
  9532. #define NAW_PSDOMAINJOINED 0x02 // post setup (joined domain)
  9533. #define NAW_PSDOMAINJOINFAILED 0x03 // post setup (domain joined failed)
  9534. STDAPI NetAccessWizard(HWND hwnd, UINT uType, BOOL *pfReboot);
  9535. typedef HRESULT (CALLBACK *LPNETACCESSWIZARD)(HWND hwnd, UINT uType, BOOL *pfReboot);
  9536. STDAPI ClearAutoLogon(VOID);
  9537. //
  9538. // Net Places API's called from mpr.
  9539. //
  9540. typedef enum
  9541. {
  9542. NETPLACES_WIZARD_MAPDRIVE = 0,
  9543. NETPLACES_WIZARD_ADDPLACE,
  9544. } NETPLACESWIZARDTYPE;
  9545. STDAPI_(DWORD)
  9546. NetPlacesWizardDoModal(
  9547. LPCONNECTDLGSTRUCTW lpConnDlgStruct,
  9548. NETPLACESWIZARDTYPE npwt,
  9549. BOOL fIsRoPath
  9550. );
  9551. // Definition for the exported function types (for GetProcAddress)
  9552. typedef DWORD (STDAPICALLTYPE*NetPlacesWizardDoModal_t)(LPCONNECTDLGSTRUCTW lpConnDlgStruct, NETPLACESWIZARDTYPE npwt, BOOL fIsROPath);
  9553. //
  9554. // moved here from nettarg.h (shell\inc)
  9555. //
  9556. // nCmdID
  9557. #define CFCID_SETENUMTYPE 0
  9558. //nCmdExecOpt
  9559. #define CFCOPT_ENUMINCOMING 1
  9560. #define CFCOPT_ENUMOUTGOING 2
  9561. #define CFCOPT_ENUMALL 3
  9562. /****************************************************
  9563. Items to display in the shutdown dialog (dwItems)
  9564. -------------------------------------------------
  9565. These flags can be |'d when passed in. A single
  9566. value will be returned, with NONE indicating an
  9567. error or the user clicked cancel.
  9568. -dsheldon
  9569. ****************************************************/
  9570. #define SHTDN_NONE 0x000000000
  9571. #define SHTDN_LOGOFF 0x000000001
  9572. #define SHTDN_SHUTDOWN 0x000000002
  9573. #define SHTDN_RESTART 0x000000004
  9574. #define SHTDN_RESTART_DOS 0x000000008
  9575. #define SHTDN_SLEEP 0x000000010
  9576. #define SHTDN_SLEEP2 0x000000020
  9577. #define SHTDN_HIBERNATE 0x000000040
  9578. #define SHTDN_DISCONNECT 0x000000080
  9579. // Shutdown dialog function exported from MSGINA.dll
  9580. STDAPI_(DWORD) ShellShutdownDialog(HWND hwndParent, LPCTSTR szUsername, DWORD dwExcludeItems);
  9581. typedef DWORD (STDAPICALLTYPE*PFNSHELLSHUTDOWNDIALOG)(HWND hwndParent, LPCTSTR szUsername, DWORD dwExcludeItems);
  9582. // Define a clipboard format for a data object to pass a user's SID
  9583. // A data object supporting this format is passed to IShellExtInit::Initialize
  9584. // before calling IShellPropSheetExt::AddPages.
  9585. #define CFSTR_USERPROPPAGESSID TEXT("UserPropertyPagesSid")
  9586. // Registry paths where extra IShellPropSheetExt handlers can be put so that
  9587. // extended pages are added to the CPL or User Properties
  9588. #define REGSTR_USERSANDPASSWORDS_CPL \
  9589. /* HKLM\\ */ TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Users and Passwords")
  9590. // CLSIDs go in HKLM\Software\Microsoft\Windows\CurrentVersion\Control Panel\Users and Passwords\shellex\PropertySheetHandlers
  9591. #define REGSTR_USERPROPERTIES_SHEET \
  9592. /* HKLM\\ */ TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Users and Passwords\\User Properties")
  9593. // CLSIDs go in HKLM\Software\Microsoft\Windows\CurrentVersion\Control Panel\Users and Passwords\User Properties\shellex\PropertySheetHandlers
  9594. //
  9595. // SHFileSysBindToStorage()
  9596. // Wrap of file system IShellFolder::BindToStorage
  9597. //
  9598. // pszPath // storage path
  9599. // grfFileAttrib // optional Win32/64 file attribute bits. Use 0 to specify default behavior
  9600. // grfMode // STGM_ mode flags.
  9601. // grfFlags // BIND_xxx bind flags
  9602. // riid // storage interface ID
  9603. // **ppv // outbound storage interface pointer.
  9604. //
  9605. SHSTDAPI SHFileSysBindToStorage(LPCWSTR pszPath, DWORD grfFileAttrib, DWORD grfMode, DWORD grfFlags, REFIID riid, void **ppv);
  9606. // DOC'ed for DOJ compliance
  9607. ;end_internal
  9608. // SHPropStgCreate()
  9609. // Wrap of IPropertySetStorage::Open/Create
  9610. //
  9611. // This function ensures proper handling of code page retrieval/assignment
  9612. // for the requested property set operation.
  9613. //
  9614. // psstg, // Address of IPropertySetStorage vtable
  9615. // fmtid, // property set ID
  9616. // pclsid, // class ID associated with the set. This can be NULL
  9617. // grfFlags, // PROPSETFLAG_xxx. All sets containing ansi bytes should be created with
  9618. // PROPSETFLAG_ANSI, otherwise PROPSETFLAG_DEFAULT.
  9619. // grfMode, // STGM_ flags. Must contain STGM_DIRECT|STGM_EXCLUSIVE.
  9620. // dwDisposition, // OPEN_EXISTING. OPEN_ALWAYS, CREATE_NEW, or CREATE_ALWAYS
  9621. // IPropertyStorage** ppstg, // Address to receive requested vtable
  9622. // puCodePage // Optional address to receive the code page ID for the set.
  9623. //
  9624. SHSTDAPI SHPropStgCreate( IPropertySetStorage* psstg, REFFMTID fmtid, CLSID* pclsid, DWORD grfFlags, DWORD grfMode, DWORD dwDisposition, OUT IPropertyStorage** ppstg, OUT OPTIONAL UINT* puCodePage );
  9625. // SHPropStgReadMultiple()
  9626. // IPropertyStorage::ReadMultiple wrap
  9627. //
  9628. // The wrap ensures ANSI/UNICODE translations are handled properly for
  9629. // legacy property sets.
  9630. //
  9631. // pps, // address of IPropertyStorage vtable.
  9632. // uCodePage, //Code page value retrieved from SHCreatePropertySet
  9633. // cpspec, //Count of properties being read
  9634. // rgpspec, //Array of the properties to be read
  9635. // rgvar //Array of PROPVARIANTs containing the property values on return
  9636. //
  9637. SHSTDAPI SHPropStgReadMultiple( IPropertyStorage* pps, UINT uCodePage, ULONG cpspec, PROPSPEC const rgpspec[], PROPVARIANT rgvar[] );
  9638. // SHPropStgWriteMultiple()
  9639. // IPropertyStorage::WriteMultiple wrap
  9640. //
  9641. // The wrap ensures ANSI/UNICODE translations are handled properly for
  9642. // legacy property sets.
  9643. //
  9644. // pps, // address of IPropertyStorage vtable.
  9645. // uCodePage, // code page retrieved from SHCreatePropertySet.
  9646. // cpspec, // The number of properties being set
  9647. // rgpspec, // Property specifiers
  9648. // rgvar, // Array of PROPVARIANT values
  9649. // propidNameFirst // Minimum value for property identifiers. This value should be >= PID_FIRST_USABLE
  9650. //
  9651. SHSTDAPI SHPropStgWriteMultiple( IPropertyStorage* pps, UINT* puCodePage, ULONG cpspec, PROPSPEC const rgpspec[], PROPVARIANT rgvar[], PROPID propidNameFirst );
  9652. ;begin_internal
  9653. // SHIsLegacyAnsiProperty()
  9654. //
  9655. // Determine whether the property is a legacy ANSI property, and if so,
  9656. // compute a conversion type for the property.
  9657. //
  9658. // fmtid, // property set identifier
  9659. // propid, // property identifier
  9660. // pvt, // optional: if non-null, contains on input the VARTYPE for the property; on output,
  9661. // the converted type. (e.g., VT_LPSTR <--> VT_LPWSTR).
  9662. SHSTDAPI_(BOOL) SHIsLegacyAnsiProperty( REFFMTID fmtid, PROPID propid, IN OUT OPTIONAL VARTYPE* pvt );
  9663. //-------------------------------------------------------------------------//
  9664. // linkwnd.h - declaration of LinkWindow control
  9665. //
  9666. // LinkWindow supports HTML-like embedded links in the caption text.
  9667. // (e.g. "<a>Click Here</a> to see something cool"
  9668. //
  9669. // An unlimited number of embedded links are supported. When the user clicks
  9670. // on a link, an WM_NOTIFY - LWN_CLICK notification message is sent to the
  9671. // parent window. The message data includes the zero-based index
  9672. // (left to right orientation) of the link that was clicked.
  9673. //
  9674. // scotthan: author/owner
  9675. // dsheldon: moved this to shlobjp.h. Eventually destined for comctl32.
  9676. EXTERN_C BOOL WINAPI LinkWindow_RegisterClass() ;
  9677. EXTERN_C BOOL WINAPI LinkWindow_UnregisterClass( HINSTANCE ) ;
  9678. #define INVALID_LINK_INDEX (-1)
  9679. #define MAX_LINKID_TEXT 48
  9680. #define LINKWINDOW_CLASS TEXT("Link Window")
  9681. #define LWS_TRANSPARENT 0x0001
  9682. #define LWS_HOTTRACK 0x0002
  9683. #define LWIF_ITEMINDEX 0x00000001
  9684. #define LWIF_STATE 0x00000002
  9685. #define LWIF_ITEMID 0x00000004
  9686. #define LWIF_URL 0x00000008
  9687. #define LWIS_FOCUSED 0x0001
  9688. #define LWIS_ENABLED 0x0002
  9689. #define LWIS_VISITED 0x0004
  9690. #define LWIS_SHELLEXECURL 0x00000008 // If the caller didn't handle the msg (NM_CLICK), then ShellExecute the szURL
  9691. // wininet.h::INTERNET_MAX_URL_LENGTH.
  9692. // Currently, this breaks various dependents.
  9693. #define LW_MAX_URL_LENGTH (2048 + 32 + sizeof("://"))
  9694. // LWITEM
  9695. typedef struct tagLWITEMA {
  9696. UINT mask ;
  9697. int iLink ;
  9698. UINT state ;
  9699. UINT stateMask ;
  9700. CHAR szID[MAX_LINKID_TEXT] ;
  9701. CHAR szUrl[LW_MAX_URL_LENGTH] ;
  9702. } LWITEMA, *LPLWITEMA;
  9703. typedef struct tagLWITEMW {
  9704. UINT mask ;
  9705. int iLink ;
  9706. UINT state ;
  9707. UINT stateMask ;
  9708. WCHAR szID[MAX_LINKID_TEXT] ;
  9709. WCHAR szUrl[LW_MAX_URL_LENGTH] ;
  9710. } LWITEMW, *LPLWITEMW;
  9711. // LWHITTESTINFO
  9712. typedef struct tagLWHITTESTINFOA {
  9713. POINT pt ;
  9714. LWITEMA item ;
  9715. } LWHITTESTINFOA, *LPLWHITTESTINFOA;
  9716. // LWHITTESTINFO
  9717. typedef struct tagLWHITTESTINFOW {
  9718. POINT pt ;
  9719. LWITEMW item ;
  9720. } LWHITTESTINFOW, *LPLWHITTESTINFOW;
  9721. // NMLINKWND
  9722. typedef struct tagNMLINKWNDA {
  9723. NMHDR hdr;
  9724. LWITEMA item ;
  9725. } NMLINKWNDA, *LPNMLINKWNDA;
  9726. typedef struct tagNMLINKWNDW {
  9727. NMHDR hdr;
  9728. LWITEMW item ;
  9729. } NMLINKWNDW, *LPNMLINKWNDW;
  9730. #ifdef UNICODE
  9731. #define LWITEM LWITEMW
  9732. #define LPLWITEM LPLWITEMW
  9733. #define LWHITTESTINFO LWHITTESTINFOW
  9734. #define LPLWHITTESTINFO LPLWHITTESTINFOW
  9735. #define NMLINKWND NMLINKWNDW
  9736. #define LPNMLINKWND LPNMLINKWNDW
  9737. #else //UNICODE
  9738. #define LWITEM LWITEMA
  9739. #define LPLWITEM LPLWITEMA
  9740. #define LWHITTESTINFO LWHITTESTINFOA
  9741. #define LPLWHITTESTINFO LPLWHITTESTINFOA
  9742. #define NMLINKWND NMLINKWNDA
  9743. #define LPNMLINKWND LPNMLINKWNDA
  9744. #endif //UNICODE
  9745. // LinkWindow notifications
  9746. // NM_CLICK // wParam: n/a, lParam: LPLWITEM, ret: ignored.
  9747. // LinkWindow messages
  9748. #define LWM_HITTEST (WM_USER+0x300) // wParam: n/a, lparam: LPLWHITTESTINFO, ret: BOOL
  9749. #define LWM_GETIDEALHEIGHT (WM_USER+0x301) // wParam: n/a, lparam: n/a, ret: cy
  9750. #define LWM_SETITEM (WM_USER+0x302) // wParam: n/a, lparam: LWITEM*, ret: BOOL
  9751. #define LWM_GETITEM (WM_USER+0x303) // wParam: n/a, lparam: LWITEM*, ret: BOOL
  9752. //-------------------------------------------------------------------------//
  9753. // INTERNAL: Darwin link tracking for start menu
  9754. // lives in unicpp\startmnu.cpp
  9755. #if _WIN32_IE >= 0x0600
  9756. // Note: SHRegisterDarwinLink takes ownership of pidlFull. fUpdate means: update the Darwin state right away
  9757. SHSTDAPI_(BOOL) SHRegisterDarwinLink(LPITEMIDLIST pidlFull, LPWSTR pszDarwinID, BOOL fUpdate);
  9758. // Use this function to update the Darwin state for all registered Darwin shortcuts.
  9759. SHSTDAPI_(void) SHReValidateDarwinCache();
  9760. SHSTDAPI SHParseDarwinIDFromCacheW(LPWSTR pszDarwinDescriptor, LPWSTR *ppwszOut);
  9761. #endif
  9762. //
  9763. // GroupButton is a variation of a group box control but supports a link-like
  9764. // caption bar, and optionally, can be buddied to a containee window for
  9765. // auto-positioning behavior.
  9766. //
  9767. // scotthan: author/owner
  9768. #define GROUPBUTTON_CLASS TEXT("GroupButton")
  9769. EXTERN_C ATOM WINAPI GroupButton_RegisterClass() ;
  9770. EXTERN_C BOOL WINAPI GroupButton_UnregisterClass() ;
  9771. #include <pshpack8.h>
  9772. typedef struct tagGBPLACEMENT
  9773. {
  9774. LONG x ; // in: top left; -1 to ignore
  9775. LONG y ; // in: top right; -1 to ignore
  9776. LONG cx ; // in: width to assign; -1 to ignore.
  9777. // If cx != -1, cxContain and cxMax are ignored.
  9778. LONG cy ; // in: height to assign; -1 to ignore.
  9779. // If cy != -1, cyContain and cyMax are ignored.
  9780. LONG cxBuddy ; // in: width of buddy area; -1 to ignore
  9781. LONG cyBuddy ; // in: height of buddy area; -1 to ignore
  9782. LONG cxBuddyMargin ;// in: width of buddy margin; -1 to ignore
  9783. LONG cyBuddyMargin ;// in: height of buddy margin; -1 to ignore
  9784. RECT rcBuddy ; // out: new buddy rect in parent coords.
  9785. RECT rcWindow ; // out: new window rect in parent coords.
  9786. HDWP hdwp ; // optional in: Non-NULL => DeferWindowPos,
  9787. // NULL => SetWindowPos
  9788. } GBPLACEMENT, *PGBPLACEMENT, *LPGBPLACEMENT ;
  9789. #include <poppack.h> /* Return to byte packing */
  9790. // Buddy flags
  9791. #define GBBF_HRESIZE 0x00000001
  9792. #define GBBF_VRESIZE 0x00000002
  9793. #define GBBF_HSCROLL 0x00000004
  9794. #define GBBF_VSCROLL 0x00000008
  9795. #define GBBF_HSLAVE 0x00000010
  9796. #define GBBF_VSLAVE 0x00000020
  9797. // Group button messages
  9798. #define GBM_FIRST (WM_USER+0x400) // arbitrary
  9799. #define GBM_SETPLACEMENT (GBM_FIRST+0) // WPARAM: n/a, LPARAM: PGBPLACEMENT, return: BOOL
  9800. #define GBM_SETBUDDY (GBM_FIRST+1) // WPARAM: HWND hwndBuddy, LPARAM: dwBuddyFlags, return: BOOL
  9801. #define GBM_GETBUDDY (GBM_FIRST+2) // WPARAM: n/a, LPARAM: n/a, return: HWND
  9802. #define GBM_SETDROPSTATE (GBM_FIRST+3) // WPARAM: BOOL fDropped, LPARAM: n/a, return: BOOL
  9803. #define GBM_GETDROPSTATE (GBM_FIRST+4) // WPARAM: n/a, LPARAM: n/a, return: BOOL fDropped
  9804. #define GBM_LAST GBM_GETDROPSTATE
  9805. typedef struct tagGBNQUERYBUDDYSIZE
  9806. {
  9807. NMHDR hdr;
  9808. LONG cx ;
  9809. LONG cy ;
  9810. } GBNQUERYBUDDYSIZE, *LPGBNQUERYBUDDYSIZE, *PGBNQUERYBUDDYSIZE ;
  9811. // Group button notifications
  9812. #define GBN_FIRST 2000U
  9813. #define GBN_LAST 2020U
  9814. #define GBN_QUERYBUDDYHEIGHT (GBN_FIRST+0) // LPARAM: LPGBNQUERYBUDDYSIZE
  9815. #define GBN_QUERYBUDDYWIDTH (GBN_FIRST+1) // LPARAM: LPGBNQUERYBUDDYSIZE.
  9816. // create standard IExtractIcon for file system like things (that does not really exist)
  9817. // DOC'ed for DOJ compliance
  9818. ;end_internal
  9819. SHSTDAPI SHCreateFileExtractIcon%(LPCTSTR% pszFile, DWORD dwFileAttributes, REFIID riid, void **ppv);
  9820. ;begin_internal
  9821. // Limit Input Mask values:
  9822. #define LIM_FLAGS 0x00000001 // dwFlags contains valid data. Otherwise all default values are used.
  9823. #define LIM_FILTER 0x00000002 // pszFilter contains valid data. At least one of the filter and mask fields must be used. Both can be used it desired.
  9824. #define LIM_HINST 0x00000008 // hinst contains valid data
  9825. #define LIM_TITLE 0x00000010 // pszTitle contains valid data. This data will be shown in bold at the top of any tooltips displayed.
  9826. #define LIM_MESSAGE 0x00000020 // pszMessage contains valid data. This data will be shown in default font below the title if a title is also used.
  9827. #define LIM_ICON 0x00000040 // hicon contains valid data. This icon will be displayed in front of the title if a title is given.
  9828. #define LIM_NOTIFY 0x00000080 // hwndNotify contains the window handle that should receive any notification messages. By default, the parent of hwndEdit recieves notifications.
  9829. #define LIM_TIMEOUT 0x00000100 // iTimeout is valid. Otherwise the default timeout of 10 seconds is used.
  9830. #define LIM_TIPWIDTH 0x00000200 // cxTipWidth is valid. Otherwiser the default is 500 pixels.
  9831. // Limit Input Flags values:
  9832. #define LIF_INCLUDEFILTER 0x00000000 // default value. pszFilter is a string of allowable characters.
  9833. #define LIF_EXCLUDEFILTER 0x00000001 // pszFilter is a string of excluded characters.
  9834. #define LIF_CATEGORYFILTER 0x00000002 // pszFilter is not a pointer, but rather its a bitfield indicating types or characters. If combined with LIF_EXCLUDEFILTER these are excluded categories, otherwise they are allowed categories.
  9835. #define LIF_WARNINGBELOW 0x00000000 // default value. Balloon tooltips will be shown below the window by default.
  9836. #define LIF_WARNINGABOVE 0x00000004 // Ballon tooltips will be shown above the window by default.
  9837. #define LIF_WARNINGCENTERED 0x00000008 // Ballon tooltips will be shown pointing to the center of the window.
  9838. #define LIF_WARNINGOFF 0x00000010 // no balloon tooltip will be displayed upon invalid input.
  9839. #define LIF_FORCEUPPERCASE 0x00000020 // all characters will be converted to upper case. Cannot be use with LIF_FORCELOWERCASE.
  9840. #define LIF_FORCELOWERCASE 0x00000040 // all characters will be converted to lower case. Cannot be use with LIF_FORCEUPPERCASE.
  9841. #define LIF_MEESAGEBEEP 0x00000000 // default value. A tone will be played to alert the user if they attemp invalid input.
  9842. #define LIF_SILENT 0x00000080 // No tone will be played.
  9843. #define LIF_NOTIFYONBADCHAR 0x00000100 // a notify message will be sent to hwndNotify when invalid input is attempted.
  9844. #define LIF_HIDETIPONVALID 0x00000200 // if the tooltip is displayed, it should be hidden when the next valid character is entered. By default, the tip remains visible for iTimeOut milliseconds.
  9845. #define LIF_PASTESKIP 0x00000000 // default value. When pasting, skip the bad characters and paste all of the good characters.
  9846. #define LIF_PASTESTOP 0x00000400 // When pasting, stop when the first bad character is incountered. Valid characters in front of this will get pasted.
  9847. #define LIF_PASTECANCEL 0x00000800 // When pasting, abort the entire paste if any characters are invalid.
  9848. #define LIF_KEEPCLIPBOARD 0x00001000 // When pasting, don't modify the contents of the clipboard when there are invalid characters. By defualt the clipboard is changed. How it is changed depends on which LIF_PASTE* flag is used.
  9849. // Limit Input Category Filters:
  9850. // these flags use the result of GetStringTypeEx with CT_TYPE1:
  9851. #define LICF_UPPER 0x00000001 // Uppercase
  9852. #define LICF_LOWER 0x00000002 // Lowercase
  9853. #define LICF_DIGIT 0x00000004 // Decimal digits
  9854. #define LICF_SPACE 0x00000008 // Space characters
  9855. #define LICF_PUNCT 0x00000010 // Punctuation
  9856. #define LICF_CNTRL 0x00000020 // Control characters
  9857. #define LICF_BLANK 0x00000040 // Blank characters
  9858. #define LICF_XDIGIT 0x00000080 // Hexadecimal digits
  9859. #define LICF_ALPHA 0x00000100 // Any linguistic character: alphabetic, syllabary, or ideographic
  9860. // these flags check for a few things that GetStringTypeEx doesn't check
  9861. #define LICF_BINARYDIGIT 0x00010000 // 0-1
  9862. #define LICF_OCTALDIGIT 0x00020000 // 0-7
  9863. #define LICF_ATOZUPPER 0x00100000 // A-Z (use LICF_ALPHA for language independent check)
  9864. #define LICF_ATOZLOWER 0x00200000 // a-z (use LICF_ALPHA for language independent check)
  9865. #define LICF_ATOZ (LICF_ATOZUPPER|LICF_ATOZLOWER) // a-z, A-Z
  9866. ;end_internal
  9867. ;begin_both
  9868. #include <pshpack8.h>
  9869. ;end_both
  9870. ;begin_internal
  9871. typedef struct tagLIMITINPUT
  9872. {
  9873. DWORD cbSize;
  9874. DWORD dwMask;
  9875. DWORD dwFlags;
  9876. HINSTANCE hinst;
  9877. LPWSTR pszFilter; // pointer to a string, or the ID of a string resource if hinst is also given, or LPSTR_TEXTCALLBACK if the parent window should be notified to provide a string.
  9878. LPWSTR pszTitle; // pointer to a string, or the ID of a string resource if hinst is also given, or LPSTR_TEXTCALLBACK if the parent window should be notified to provide a string.
  9879. LPWSTR pszMessage; // pointer to a string, or the ID of a string resource if hinst is also given, or LPSTR_TEXTCALLBACK if the parent window should be notified to provide a string.
  9880. HICON hIcon; // handle to an icon, or I_ICONCALLBACK if the notify window should be asked to provide an icon.
  9881. HWND hwndNotify; // handle to a window to process notify messages
  9882. INT iTimeout; // time in milliseconds to display the tooltip
  9883. INT cxTipWidth; // max width of the tooltip in pixels. Defaults to 500.
  9884. } LIMITINPUT;
  9885. typedef struct tagNMLIDISPINFO
  9886. {
  9887. NMHDR hdr; // standard notification header structure
  9888. LIMITINPUT li; // the mask member indicates which fields must be filled out.
  9889. } NMLIDISPINFO, * LPNMLIDISPINFO, NMLIFILTERINFO, * LPNMLIFILTERINFO;
  9890. #define LIN_GETDISPINFO 0x01 // notify code sent to retrieve tooltip display info
  9891. #define LIN_GETFILTERINFO 0x02 // notify code sent to retrieve filter or mask info
  9892. typedef struct tagNMLIBADCHAR
  9893. {
  9894. NMHDR hdr; // standard notification header structure
  9895. WPARAM wParam; // wParam sent in WM_CHAR message
  9896. LPARAM lParam; // lParam sent in WM_CHAR message
  9897. } NMLIBADCHAR, * LPNMLIBADCHAR;
  9898. #define LIN_BADCHAR 0x03 // notify code sent when a character is filtered out
  9899. #define I_ICONCALLBACK ((HICON)-1L)
  9900. // Helpers which prevent entry of invalid (as defined by the folder) characters. Call on LVN_BEGIN_INPUT_EDIT
  9901. // DOC'ed for DOJ compliance
  9902. ;end_internal
  9903. SHSTDAPI SHLimitInputEdit(HWND hwndEdit, IShellFolder *psf);
  9904. ;begin_internal
  9905. SHSTDAPI SHLimitInputEditWithFlags(HWND hwndEdit, LIMITINPUT * pil);
  9906. SHSTDAPI SHLimitInputEditChars(HWND hwndEdit, LPCWSTR pszValidChars, LPCWSTR pszInvalidChars);
  9907. SHSTDAPI SHLimitInputCombo(HWND hwndComboBox, IShellFolder *psf);
  9908. // DOC'ed for DOJ Compliance
  9909. ;end_internal
  9910. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_WINDOWS >= 0x0500)
  9911. //
  9912. // The SHMultiFileProperties API displays a property sheet for a
  9913. // set of files specified in an IDList Array.
  9914. //
  9915. // Parameters:
  9916. // pdtobj - Data object containing list of files. The data
  9917. // object must provide the "Shell IDList Array"
  9918. // clipboard format. The parent folder's implementation of
  9919. // IShellFolder::GetDisplayNameOf must return a fully-qualified
  9920. // filesystem path for each item in response to the
  9921. // SHGDN_FORPARSING flag.
  9922. //
  9923. // dwFlags - Reserved for future use. Should be set to 0.
  9924. //
  9925. // Returns:
  9926. // S_OK
  9927. //
  9928. SHSTDAPI SHMultiFileProperties(IDataObject *pdtobj, DWORD dwFlags);
  9929. #endif
  9930. #if (_WIN32_IE >= 0x0600)
  9931. //
  9932. //
  9933. typedef void (CALLBACK *PFNASYNCICONTASKBALLBACK)(LPCITEMIDLIST pidl, LPVOID pvData, LPVOID pvHint, INT iIconIndex, INT iOpenIconIndex);
  9934. // HRESULT SHMapIDListToImageListIndexAsync(IShellTaskScheduler* pts, IShellFolder *psf, LPCITEMIDLIST pidl, UINT flags,
  9935. // PFNASYNCICONTASKBALLBACK pfn, LPVOID pvData, LPVOID pvHint, int *piIndex, int *piIndexSel);
  9936. // A usefull function for asynchronously mapping idlist into index into system
  9937. // image list. Optionally it can also look up the index of the selected icon.
  9938. // pts Task scheduler interface to use to create the background task
  9939. // psf Shell folder relating to the pidl
  9940. // pidl Item whose icon is requested
  9941. // flags GIL_ flags
  9942. // pfn Function called back when the background task is done
  9943. // pvData User data passed back in the (*pfn) callback
  9944. // pvHint User data passed back in the (*pfn) callback
  9945. // piIndex Icon index returned. This is the temporary index if the function returns E_PENDING. The final index will be provided thru the callback
  9946. // piIndexSel Optional icon index for the open icon case (GIL_OPENICON).
  9947. //
  9948. // Returns S_OK if all the requested info was available. E_PENDING means that you get temporary icons, and will be called back
  9949. // asynchronously with the final icons. Other failure code means the function failed.
  9950. SHSTDAPI SHMapIDListToImageListIndexAsync(IShellTaskScheduler* pts, IShellFolder *psf, LPCITEMIDLIST pidl, UINT flags,
  9951. PFNASYNCICONTASKBALLBACK pfn, LPVOID pvData, LPVOID pvHint, int *piIndex, int *piIndexSel);
  9952. #endif // (_WIN32_IE >= 0x0600)
  9953. // A usefull function in Defview for mapping idlist into index into system
  9954. // image list. Optionally it can also look up the index of the selected
  9955. // icon.
  9956. SHSTDAPI_(int) SHMapPIDLToSystemImageListIndex(IShellFolder *pshf, LPCITEMIDLIST pidl, int *piIndexSel);
  9957. ;begin_internal
  9958. // DOC'ed for DOJ Compliance
  9959. ;end_internal
  9960. EXTERN_C WINSHELLAPI HRESULT STDAPICALLTYPE SHCLSIDFromString(LPCWSTR lpsz, LPCLSID lpclsid);
  9961. HANDLE _SHAllocShared(LPCVOID pvData, DWORD dwSize, DWORD dwDestinationProcessId);
  9962. BOOL _SHFreeShared(HANDLE hData, DWORD dwSourceProcessId);
  9963. void *_SHLockShared(HANDLE hData, DWORD dwSourceProcessId);
  9964. BOOL _SHUnlockShared(void * pvData);
  9965. STDAPI SHFlushClipboard(void);
  9966. STDAPI SHCreateQueryCancelAutoPlayMoniker(IMoniker** ppmoniker);
  9967. HINSTANCE WINAPI SHGetShellStyleHInstance(void);
  9968. STDAPI_(void) PerUserInit(void);
  9969. WINSHELLAPI BOOL WINAPI SHRunControlPanel(LPCWSTR lpcszCmdLine, HWND hwndMsgParent);
  9970. WINSHELLAPI int WINAPI PickIconDlg(HWND hwnd, LPWSTR pszIconPath, UINT cbIconPath, int *piIconIndex);
  9971. typedef struct tagAAMENUFILENAME
  9972. {
  9973. SHORT cbTotal;
  9974. BYTE rgbReserved[12];
  9975. WCHAR szFileName[1]; // variable length string
  9976. } AASHELLMENUFILENAME, *LPAASHELLMENUFILENAME;
  9977. typedef struct tagAASHELLMENUITEM
  9978. {
  9979. void* lpReserved1;
  9980. int iReserved;
  9981. UINT uiReserved;
  9982. LPAASHELLMENUFILENAME lpName; // name of file
  9983. LPWSTR psz; // text to use if no file
  9984. } AASHELLMENUITEM, *LPAASHELLMENUITEM;
  9985. ;begin_internal
  9986. int _cdecl ShellMessageBoxWrapW(HINSTANCE hInst, HWND hWnd, LPCWSTR pszMsg, LPCWSTR pszTitle, UINT fuStyle, ...);
  9987. #ifdef UNICODE
  9988. #define ShellMessageBoxWrap ShellMessageBoxWrapW
  9989. #else
  9990. #define ShellMessageBoxWrap ShellMessageBoxA
  9991. #endif
  9992. // Helpers for handling IDataObject stuff - from shell32.dll
  9993. // DOC'ed for DOJ compliance
  9994. ;end_internal
  9995. STDAPI SHGetAttributesFromDataObject(IDataObject *pdo, DWORD dwAttributeMask, DWORD *pdwAttributes, UINT *pcItems);
  9996. ;begin_internal
  9997. STDAPI SHSimulateDropOnClsid(REFCLSID clsidDrop, IUnknown* punkSite, IDataObject* pdo);
  9998. ;end_internal
  9999. ;begin_both
  10000. #include <poppack.h> /* Return to byte packing */
  10001. ;end_both
  10002. ;begin_both
  10003. #ifdef __cplusplus
  10004. }
  10005. #endif /* __cplusplus */
  10006. #include <poppack.h>
  10007. ;end_both
  10008. SHDOCAPI_(BOOL) ImportPrivacySettings( LPCWSTR szFilename,
  10009. IN OUT BOOL* pfParsePrivacyPreferences, IN OUT BOOL* pfParsePerSiteRules);
  10010. #ifndef IEnumPrivacyRecords
  10011. typedef interface IEnumPrivacyRecords IEnumPrivacyRecords;
  10012. #endif
  10013. SHDOCAPI DoPrivacyDlg( HWND hwndParent, LPOLESTR pszUrl, IEnumPrivacyRecords *pPrivacyEnum, BOOL fReportAllSites);
  10014. #endif // _SHLOBJ_H_
  10015. #endif // _SHLOBJP_H_ ;Internal