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.

5296 lines
217 KiB

  1. //===========================================================================
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // File: shlobj.h
  6. //
  7. //===========================================================================
  8. #ifndef _SHLOBJ_H_
  9. #define _SHLOBJ_H_
  10. #ifndef _WINRESRC_
  11. #ifndef _WIN32_IE
  12. #define _WIN32_IE 0x0501
  13. #else
  14. #if (_WIN32_IE < 0x0400) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
  15. #error _WIN32_IE setting conflicts with _WIN32_WINNT setting
  16. #endif
  17. #endif
  18. #endif
  19. #ifndef SNDMSG
  20. #ifdef __cplusplus
  21. #define SNDMSG ::SendMessage
  22. #else
  23. #define SNDMSG SendMessage
  24. #endif
  25. #endif // ifndef SNDMSG
  26. //
  27. // Define API decoration for direct importing of DLL references.
  28. //
  29. #ifndef WINSHELLAPI
  30. #if defined(_SHELL32_)
  31. #define WINSHELLAPI
  32. #else
  33. #define WINSHELLAPI DECLSPEC_IMPORT
  34. #endif
  35. #endif // WINSHELLAPI
  36. #ifndef SHSTDAPI
  37. #if defined(_SHELL32_)
  38. #define SHSTDAPI STDAPI
  39. #define SHSTDAPI_(type) STDAPI_(type)
  40. #else
  41. #define SHSTDAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  42. #define SHSTDAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  43. #endif
  44. #endif // SHSTDAPI
  45. #ifndef SHDOCAPI
  46. #if defined(_SHDOCVW_)
  47. #define SHDOCAPI STDAPI
  48. #define SHDOCAPI_(type) STDAPI_(type)
  49. #else
  50. #define SHDOCAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  51. #define SHDOCAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  52. #endif
  53. #endif // SHDOCAPI
  54. // shell32 APIs that are also exported from shdocvw
  55. #ifndef SHSTDDOCAPI
  56. #if defined(_SHDOCVW_) || defined(_SHELL32_)
  57. #define SHSTDDOCAPI STDAPI
  58. #define SHSTDDOCAPI_(type) STDAPI_(type)
  59. #else
  60. #define SHSTDDOCAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  61. #define SHSTDDOCAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  62. #endif
  63. #endif // SHSTDDOCAPI
  64. #ifndef BROWSEUIAPI
  65. #if defined(_BROWSEUI_)
  66. #define BROWSEUIAPI STDAPI
  67. #define BROWSEUIAPI_(type) STDAPI_(type)
  68. #else
  69. #define BROWSEUIAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  70. #define BROWSEUIAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  71. #endif // defined(_BROWSEUI_)
  72. #endif // BROWSEUIAPI
  73. // shell32 APIs that are also exported from shfolder
  74. #ifndef SHFOLDERAPI
  75. #if defined(_SHFOLDER_) || defined(_SHELL32_)
  76. #define SHFOLDERAPI STDAPI
  77. #else
  78. #define SHFOLDERAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  79. #endif
  80. #endif
  81. #include <ole2.h>
  82. #ifndef _PRSHT_H_
  83. #include <prsht.h>
  84. #endif
  85. #ifndef _INC_COMMCTRL
  86. #include <commctrl.h> // for LPTBBUTTON
  87. #endif
  88. #ifndef INITGUID
  89. #include <shlguid.h>
  90. #endif /* !INITGUID */
  91. #include <pshpack1.h> /* Assume byte packing throughout */
  92. #ifdef __cplusplus
  93. extern "C" { /* Assume C declarations for C++ */
  94. #endif /* __cplusplus */
  95. #include <shtypes.h>
  96. #include <shobjidl.h>
  97. //===========================================================================
  98. //
  99. // Task allocator API
  100. //
  101. // All the shell extensions MUST use the task allocator (see OLE 2.0
  102. // programming guild for its definition) when they allocate or free
  103. // memory objects (mostly ITEMIDLIST) that are returned across any
  104. // shell interfaces. There are two ways to access the task allocator
  105. // from a shell extension depending on whether or not it is linked with
  106. // OLE32.DLL or not (purely for efficiency).
  107. //
  108. // (1) A shell extension which calls any OLE API (i.e., linked with
  109. // OLE32.DLL) should call OLE's task allocator (by retrieving
  110. // the task allocator by calling CoGetMalloc API).
  111. //
  112. // (2) A shell extension which does not call any OLE API (i.e., not linked
  113. // with OLE32.DLL) should call the shell task allocator API (defined
  114. // below), so that the shell can quickly loads it when OLE32.DLL is not
  115. // loaded by any application at that point.
  116. //
  117. // Notes:
  118. // In next version of Windowso release, SHGetMalloc will be replaced by
  119. // the following macro.
  120. //
  121. // #define SHGetMalloc(ppmem) CoGetMalloc(MEMCTX_TASK, ppmem)
  122. //
  123. //===========================================================================
  124. SHSTDAPI SHGetMalloc(LPMALLOC * ppMalloc);
  125. SHSTDAPI_(void *) SHAlloc(SIZE_T cb);
  126. SHSTDAPI_(void) SHFree(void * pv);
  127. //===========================================================================
  128. //
  129. // IContextMenu interface
  130. //
  131. // [OverView]
  132. //
  133. // The shell uses the IContextMenu interface in following three cases.
  134. //
  135. // case-1: The shell is loading context menu extensions.
  136. //
  137. // When the user clicks the right mouse button on an item within the shell's
  138. // name space (i.g., file, directory, server, work-group, etc.), it creates
  139. // the default context menu for its type, then loads context menu extensions
  140. // that are registered for that type (and its base type) so that they can
  141. // add extra menu items. Those context menu extensions are registered at
  142. // HKCR\{ProgID}\shellex\ContextMenuHandlers.
  143. //
  144. // case-2: The shell is retrieving a context menu of sub-folders in extended
  145. // name-space.
  146. //
  147. // When the explorer's name space is extended by name space extensions,
  148. // the shell calls their IShellFolder::GetUIObjectOf to get the IContextMenu
  149. // objects when it creates context menus for folders under those extended
  150. // name spaces.
  151. //
  152. // case-3: The shell is loading non-default drag and drop handler for directories.
  153. //
  154. // When the user performed a non-default drag and drop onto one of file
  155. // system folders (i.e., directories), it loads shell extensions that are
  156. // registered at HKCR\{ProgID}\DragDropHandlers.
  157. //
  158. //
  159. // [Member functions]
  160. //
  161. //
  162. // IContextMenu::QueryContextMenu
  163. //
  164. // This member function may insert one or more menuitems to the specified
  165. // menu (hmenu) at the specified location (indexMenu which is never be -1).
  166. // The IDs of those menuitem must be in the specified range (idCmdFirst and
  167. // idCmdLast). It returns the maximum menuitem ID offset (ushort) in the
  168. // 'code' field (low word) of the scode.
  169. //
  170. // The uFlags specify the context. It may have one or more of following
  171. // flags.
  172. //
  173. // CMF_DEFAULTONLY: This flag is passed if the user is invoking the default
  174. // action (typically by double-clicking, case 1 and 2 only). Context menu
  175. // extensions (case 1) should not add any menu items, and returns NOERROR.
  176. //
  177. // CMF_VERBSONLY: The explorer passes this flag if it is constructing
  178. // a context menu for a short-cut object (case 1 and case 2 only). If this
  179. // flag is passed, it should not add any menu-items that is not appropriate
  180. // from a short-cut.
  181. // A good example is the "Delete" menuitem, which confuses the user
  182. // because it is not clear whether it deletes the link source item or the
  183. // link itself.
  184. //
  185. // CMF_EXPLORER: The explorer passes this flag if it has the left-side pane
  186. // (case 1 and 2 only). Context menu extensions should ignore this flag.
  187. //
  188. // High word (16-bit) are reserved for context specific communications
  189. // and the rest of flags (13-bit) are reserved by the system.
  190. //
  191. //
  192. // IContextMenu::InvokeCommand
  193. //
  194. // This member is called when the user has selected one of menuitems that
  195. // are inserted by previous QueryContextMenu member. In this case, the
  196. // LOWORD(lpici->lpVerb) contains the menuitem ID offset (menuitem ID -
  197. // idCmdFirst).
  198. //
  199. // This member function may also be called programmatically. In such a case,
  200. // lpici->lpVerb specifies the canonical name of the command to be invoked,
  201. // which is typically retrieved by GetCommandString member previously.
  202. //
  203. // Parameters in lpci:
  204. // cbSize -- Specifies the size of this structure (sizeof(*lpci))
  205. // hwnd -- Specifies the owner window for any message/dialog box.
  206. // fMask -- Specifies whether or not dwHotkey/hIcon paramter is valid.
  207. // lpVerb -- Specifies the command to be invoked.
  208. // lpParameters -- Parameters (optional)
  209. // lpDirectory -- Working directory (optional)
  210. // nShow -- Specifies the flag to be passed to ShowWindow (SW_*).
  211. // dwHotKey -- Hot key to be assigned to the app after invoked (optional).
  212. // hIcon -- Specifies the icon (optional).
  213. // hMonitor -- Specifies the default monitor (optional).
  214. //
  215. //
  216. // IContextMenu::GetCommandString
  217. //
  218. // This member function is called by the explorer either to get the
  219. // canonical (language independent) command name (uFlags == GCS_VERB) or
  220. // the help text ((uFlags & GCS_HELPTEXT) != 0) for the specified command.
  221. // The retrieved canonical string may be passed to its InvokeCommand
  222. // member function to invoke a command programmatically. The explorer
  223. // displays the help texts in its status bar; therefore, the length of
  224. // the help text should be reasonably short (<40 characters).
  225. //
  226. // Parameters:
  227. // idCmd -- Specifies menuitem ID offset (from idCmdFirst)
  228. // uFlags -- Either GCS_VERB or GCS_HELPTEXT
  229. // pwReserved -- Reserved (must pass NULL when calling, must ignore when called)
  230. // pszName -- Specifies the string buffer.
  231. // cchMax -- Specifies the size of the string buffer.
  232. //
  233. //===========================================================================
  234. // QueryContextMenu uFlags
  235. #define CMF_NORMAL 0x00000000
  236. #define CMF_DEFAULTONLY 0x00000001
  237. #define CMF_VERBSONLY 0x00000002
  238. #define CMF_EXPLORE 0x00000004
  239. #define CMF_NOVERBS 0x00000008
  240. #define CMF_CANRENAME 0x00000010
  241. #define CMF_NODEFAULT 0x00000020
  242. #define CMF_INCLUDESTATIC 0x00000040
  243. #define CMF_EXTENDEDVERBS 0x00000100 // rarely used verbs
  244. #define CMF_RESERVED 0xffff0000 // View specific
  245. // GetCommandString uFlags
  246. #define GCS_VERBA 0x00000000 // canonical verb
  247. #define GCS_HELPTEXTA 0x00000001 // help text (for status bar)
  248. #define GCS_VALIDATEA 0x00000002 // validate command exists
  249. #define GCS_VERBW 0x00000004 // canonical verb (unicode)
  250. #define GCS_HELPTEXTW 0x00000005 // help text (unicode version)
  251. #define GCS_VALIDATEW 0x00000006 // validate command exists (unicode)
  252. #define GCS_UNICODE 0x00000004 // for bit testing - Unicode string
  253. #ifdef UNICODE
  254. #define GCS_VERB GCS_VERBW
  255. #define GCS_HELPTEXT GCS_HELPTEXTW
  256. #define GCS_VALIDATE GCS_VALIDATEW
  257. #else
  258. #define GCS_VERB GCS_VERBA
  259. #define GCS_HELPTEXT GCS_HELPTEXTA
  260. #define GCS_VALIDATE GCS_VALIDATEA
  261. #endif
  262. #define CMDSTR_NEWFOLDERA "NewFolder"
  263. #define CMDSTR_VIEWLISTA "ViewList"
  264. #define CMDSTR_VIEWDETAILSA "ViewDetails"
  265. #define CMDSTR_NEWFOLDERW L"NewFolder"
  266. #define CMDSTR_VIEWLISTW L"ViewList"
  267. #define CMDSTR_VIEWDETAILSW L"ViewDetails"
  268. #ifdef UNICODE
  269. #define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERW
  270. #define CMDSTR_VIEWLIST CMDSTR_VIEWLISTW
  271. #define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSW
  272. #else
  273. #define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERA
  274. #define CMDSTR_VIEWLIST CMDSTR_VIEWLISTA
  275. #define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSA
  276. #endif
  277. #define CMIC_MASK_HOTKEY SEE_MASK_HOTKEY
  278. #define CMIC_MASK_ICON SEE_MASK_ICON
  279. #define CMIC_MASK_FLAG_NO_UI SEE_MASK_FLAG_NO_UI
  280. #define CMIC_MASK_UNICODE SEE_MASK_UNICODE
  281. #define CMIC_MASK_NO_CONSOLE SEE_MASK_NO_CONSOLE
  282. #define CMIC_MASK_HASLINKNAME SEE_MASK_HASLINKNAME
  283. #define CMIC_MASK_FLAG_SEP_VDM SEE_MASK_FLAG_SEPVDM
  284. #define CMIC_MASK_HASTITLE SEE_MASK_HASTITLE
  285. #define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK
  286. #if (_WIN32_IE >= 0x0501)
  287. #define CMIC_MASK_SHIFT_DOWN 0x10000000
  288. #define CMIC_MASK_CONTROL_DOWN 0x40000000
  289. #endif // (_WIN32_IE >= 0x501)
  290. #if (_WIN32_IE >= 0x0560)
  291. #define CMIC_MASK_FLAG_LOG_USAGE SEE_MASK_FLAG_LOG_USAGE
  292. #define CMIC_MASK_NOZONECHECKS SEE_MASK_NOZONECHECKS
  293. #endif // (_WIN32_IE >= 0x560)
  294. #if (_WIN32_IE >= 0x0400)
  295. #define CMIC_MASK_PTINVOKE 0x20000000
  296. #endif
  297. #include <pshpack8.h>
  298. //NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor
  299. typedef struct _CMINVOKECOMMANDINFO {
  300. DWORD cbSize; // sizeof(CMINVOKECOMMANDINFO)
  301. DWORD fMask; // any combination of CMIC_MASK_*
  302. HWND hwnd; // might be NULL (indicating no owner window)
  303. LPCSTR lpVerb; // either a string or MAKEINTRESOURCE(idOffset)
  304. LPCSTR lpParameters; // might be NULL (indicating no parameter)
  305. LPCSTR lpDirectory; // might be NULL (indicating no specific directory)
  306. int nShow; // one of SW_ values for ShowWindow() API
  307. DWORD dwHotKey;
  308. HANDLE hIcon;
  309. } CMINVOKECOMMANDINFO, *LPCMINVOKECOMMANDINFO;
  310. typedef struct _CMInvokeCommandInfoEx {
  311. DWORD cbSize; // must be sizeof(CMINVOKECOMMANDINFOEX)
  312. DWORD fMask; // any combination of CMIC_MASK_*
  313. HWND hwnd; // might be NULL (indicating no owner window)
  314. LPCSTR lpVerb; // either a string or MAKEINTRESOURCE(idOffset)
  315. LPCSTR lpParameters; // might be NULL (indicating no parameter)
  316. LPCSTR lpDirectory; // might be NULL (indicating no specific directory)
  317. int nShow; // one of SW_ values for ShowWindow() API
  318. DWORD dwHotKey;
  319. HANDLE hIcon;
  320. LPCSTR lpTitle; // For CreateProcess-StartupInfo.lpTitle
  321. LPCWSTR lpVerbW; // Unicode verb (for those who can use it)
  322. LPCWSTR lpParametersW; // Unicode parameters (for those who can use it)
  323. LPCWSTR lpDirectoryW; // Unicode directory (for those who can use it)
  324. LPCWSTR lpTitleW; // Unicode title (for those who can use it)
  325. #if (_WIN32_IE >= 0x0400)
  326. POINT ptInvoke; // Point where it's invoked
  327. #endif
  328. } CMINVOKECOMMANDINFOEX, *LPCMINVOKECOMMANDINFOEX;
  329. #include <poppack.h> /* Return to byte packing */
  330. #undef INTERFACE
  331. #define INTERFACE IContextMenu
  332. DECLARE_INTERFACE_(IContextMenu, IUnknown)
  333. {
  334. // *** IUnknown methods ***
  335. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  336. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  337. STDMETHOD_(ULONG,Release) (THIS) PURE;
  338. STDMETHOD(QueryContextMenu)(THIS_
  339. HMENU hmenu,
  340. UINT indexMenu,
  341. UINT idCmdFirst,
  342. UINT idCmdLast,
  343. UINT uFlags) PURE;
  344. STDMETHOD(InvokeCommand)(THIS_
  345. LPCMINVOKECOMMANDINFO lpici) PURE;
  346. STDMETHOD(GetCommandString)(THIS_
  347. UINT_PTR idCmd,
  348. UINT uType,
  349. UINT * pwReserved,
  350. LPSTR pszName,
  351. UINT cchMax) PURE;
  352. };
  353. typedef IContextMenu * LPCONTEXTMENU;
  354. //
  355. // IContextMenu2 (IContextMenu with one new member)
  356. //
  357. // IContextMenu2::HandleMenuMsg
  358. //
  359. // This function is called, if the client of IContextMenu is aware of
  360. // IContextMenu2 interface and receives one of following messages while
  361. // it is calling TrackPopupMenu (in the window proc of hwnd):
  362. // WM_INITPOPUP, WM_DRAWITEM and WM_MEASUREITEM
  363. // The callee may handle these messages to draw owner draw menuitems.
  364. //
  365. #undef INTERFACE
  366. #define INTERFACE IContextMenu2
  367. DECLARE_INTERFACE_(IContextMenu2, IContextMenu)
  368. {
  369. // *** IUnknown methods ***
  370. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  371. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  372. STDMETHOD_(ULONG,Release) (THIS) PURE;
  373. // *** IContextMenu methods ***
  374. STDMETHOD(QueryContextMenu)(THIS_
  375. HMENU hmenu,
  376. UINT indexMenu,
  377. UINT idCmdFirst,
  378. UINT idCmdLast,
  379. UINT uFlags) PURE;
  380. STDMETHOD(InvokeCommand)(THIS_
  381. LPCMINVOKECOMMANDINFO lpici) PURE;
  382. STDMETHOD(GetCommandString)(THIS_
  383. UINT_PTR idCmd,
  384. UINT uType,
  385. UINT * pwReserved,
  386. LPSTR pszName,
  387. UINT cchMax) PURE;
  388. // *** IContextMenu2 methods ***
  389. STDMETHOD(HandleMenuMsg)(THIS_
  390. UINT uMsg,
  391. WPARAM wParam,
  392. LPARAM lParam) PURE;
  393. };
  394. typedef IContextMenu2 * LPCONTEXTMENU2;
  395. //
  396. // IContextMenu3 (IContextMenu with one new member)
  397. //
  398. // IContextMenu3::HandleMenuMsg2
  399. //
  400. // This function is called, if the client of IContextMenu is aware of
  401. // IContextMenu3 interface and receives a menu message while
  402. // it is calling TrackPopupMenu (in the window proc of hwnd):
  403. //
  404. #undef INTERFACE
  405. #define INTERFACE IContextMenu3
  406. DECLARE_INTERFACE_(IContextMenu3, IContextMenu2)
  407. {
  408. // *** IUnknown methods ***
  409. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  410. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  411. STDMETHOD_(ULONG,Release) (THIS) PURE;
  412. // *** IContextMenu methods ***
  413. STDMETHOD(QueryContextMenu)(THIS_
  414. HMENU hmenu,
  415. UINT indexMenu,
  416. UINT idCmdFirst,
  417. UINT idCmdLast,
  418. UINT uFlags) PURE;
  419. STDMETHOD(InvokeCommand)(THIS_
  420. LPCMINVOKECOMMANDINFO lpici) PURE;
  421. STDMETHOD(GetCommandString)(THIS_
  422. UINT_PTR idCmd,
  423. UINT uType,
  424. UINT * pwReserved,
  425. LPSTR pszName,
  426. UINT cchMax) PURE;
  427. // *** IContextMenu2 methods ***
  428. STDMETHOD(HandleMenuMsg)(THIS_
  429. UINT uMsg,
  430. WPARAM wParam,
  431. LPARAM lParam) PURE;
  432. // *** IContextMenu3 methods ***
  433. STDMETHOD(HandleMenuMsg2)(THIS_
  434. UINT uMsg,
  435. WPARAM wParam,
  436. LPARAM lParam,
  437. LRESULT* plResult) PURE;
  438. };
  439. typedef IContextMenu3 * LPCONTEXTMENU3;
  440. #if (_WIN32_IE >= 0x0500)
  441. #undef INTERFACE
  442. #define INTERFACE IPersistFolder3
  443. #define CSIDL_FLAG_PFTI_TRACKTARGET CSIDL_FLAG_DONT_VERIFY
  444. // DESCRIPTION: PERSIST_FOLDER_TARGET_INFO
  445. // This stucture is used for Folder Shortcuts which allow the shell to
  446. // have a file system folder act like another area in the name space.
  447. // One of pidlTargetFolder, szTargetParsingName, or csidl needs to
  448. // specify the destination name space.
  449. //
  450. // pidlTargetFolder: This is a full pidl to the target folder. Can be NULL in the IPersistFolder3::InitializeEx()
  451. // call but not in the GetFolderTargetInfo() return structure.
  452. // szTargetParsingName: Empty string if not specified. Ortherwise, it is the parsible name
  453. // to the target. This name can be parsed by IShellFolder::
  454. // ParsedName() from the desktop.
  455. // szNetworkProvider: Can be an empty string. If not empty, it specifies the type of network
  456. // provider that will be used when binding to the target. This is used
  457. // for performance optimizations for the WNet APIs.
  458. // dwAttributes: -1 if not known. These are the SFGAO_ flags for IShellFolder::GetAttributesOf()
  459. // csidl: This is -1 if it's not used. This can be used instead of pidlTargetFolder or
  460. // szTargetParsingName to indicate the TargetFolder. See the list of CSIDL_ folders
  461. // below. CSIDL_FLAG_PFTI_TRACKTARGET means that the IShellFolder's target folder
  462. // should change if the user changes the target of the underlying CSIDL value.
  463. // You can also pass CSIDL_FLAG_CREATE to indicate that the target folder
  464. // should be created if it does not exist. No other CSIDL_FLAG_* values are supported.
  465. #include <pshpack8.h>
  466. typedef struct
  467. {
  468. LPITEMIDLIST pidlTargetFolder; // pidl for the folder we want to intiailize
  469. WCHAR szTargetParsingName[MAX_PATH]; // optional parsing name for the target
  470. WCHAR szNetworkProvider[MAX_PATH]; // optional network provider
  471. DWORD dwAttributes; // optional FILE_ATTRIBUTES_ flags (-1 if not used)
  472. int csidl; // optional folder index (SHGetFolderPath()) -1 if not used
  473. } PERSIST_FOLDER_TARGET_INFO;
  474. #include <poppack.h> /* Return to byte packing */
  475. // DESCRIPTION: IPersistFolder3
  476. // This interface is implemented by an IShellFolder object that wants non-default
  477. // handling of Folder Shortcuts. In general, shell name space extensions should use
  478. // pidlRoot (the alias pidl) as their location in the name space and pass it to public
  479. // APIs, such as ShellExecute(). The one exception is that pidlTarget should be used
  480. // when sending ChangeNotifies or registering to listen for change notifies
  481. // (see SFVM_GETNOTIFY).
  482. //
  483. // InitializeEx: This method initializes an IShellFolder and specifies where
  484. // it is rooted in the name space.
  485. // pbc: May be NULL.
  486. // pidlRoot: This is the same parameter as IPersistFolder::Initialize(). Caller allocates
  487. // and frees this parameter.
  488. // ppfti: May be NULL, in which case this is the same as a call to IPersistFolder::Initialize().
  489. // Otherwise this is a Folder Shortcut and this structure specifies the target
  490. // folder and it's attributes.
  491. // GetFolderTargetInfo: This is used by the caller to find information about
  492. // the folder shortcut. This structure may not be initialized by the caller,
  493. // so the callee needs to initialize every member. The callee allocates
  494. // pidlTargetFolder and the caller will free it. Filling in pidlTargetFolder is
  495. // ALWAYS required.
  496. DECLARE_INTERFACE_(IPersistFolder3, IPersistFolder2)
  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. // *** IPersist methods ***
  503. STDMETHOD(GetClassID)(THIS_ LPCLSID lpClassID) PURE;
  504. // *** IPersistFolder methods ***
  505. STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidl) PURE;
  506. // *** IPersistFolder2 methods ***
  507. STDMETHOD(GetCurFolder)(THIS_ LPITEMIDLIST *ppidl) PURE;
  508. // *** IPersistFolder3 methods ***
  509. STDMETHOD(InitializeEx)(THIS_ IBindCtx *pbc, LPCITEMIDLIST pidlRoot, const PERSIST_FOLDER_TARGET_INFO *ppfti) PURE;
  510. STDMETHOD(GetFolderTargetInfo)(THIS_ PERSIST_FOLDER_TARGET_INFO *ppfti) PURE;
  511. };
  512. #endif
  513. //
  514. //===========================================================================
  515. //
  516. // IExtractIcon interface
  517. //
  518. // This interface is used in two different places in the shell.
  519. //
  520. // Case-1: Icons of sub-folders for the scope-pane of the explorer.
  521. //
  522. // It is used by the explorer to get the "icon location" of
  523. // sub-folders from each shell folders. When the user expands a folder
  524. // in the scope pane of the explorer, the explorer does following:
  525. // (1) binds to the folder (gets IShellFolder),
  526. // (2) enumerates its sub-folders by calling its EnumObjects member,
  527. // (3) calls its GetUIObjectOf member to get IExtractIcon interface
  528. // for each sub-folders.
  529. // In this case, the explorer uses only IExtractIcon::GetIconLocation
  530. // member to get the location of the appropriate icon. An icon location
  531. // always consists of a file name (typically DLL or EXE) and either an icon
  532. // resource or an icon index.
  533. //
  534. //
  535. // Case-2: Extracting an icon image from a file
  536. //
  537. // It is used by the shell when it extracts an icon image
  538. // from a file. When the shell is extracting an icon from a file,
  539. // it does following:
  540. // (1) creates the icon extraction handler object (by getting its CLSID
  541. // under the {ProgID}\shell\ExtractIconHanler key and calling
  542. // CoCreateInstance requesting for IExtractIcon interface).
  543. // (2) Calls IExtractIcon::GetIconLocation.
  544. // (3) Then, calls IExtractIcon::ExtractIcon with the location/index pair.
  545. // (4) If (3) returns NOERROR, it uses the returned icon.
  546. // (5) Otherwise, it recursively calls this logic with new location
  547. // assuming that the location string contains a fully qualified path name.
  548. //
  549. // From extension programmer's point of view, there are only two cases
  550. // where they provide implementations of IExtractIcon:
  551. // Case-1) providing explorer extensions (i.e., IShellFolder).
  552. // Case-2) providing per-instance icons for some types of files.
  553. //
  554. // Because Case-1 is described above, we'll explain only Case-2 here.
  555. //
  556. // When the shell is about display an icon for a file, it does following:
  557. // (1) Finds its ProgID and ClassID.
  558. // (2) If the file has a ClassID, it gets the icon location string from the
  559. // "DefaultIcon" key under it. The string indicates either per-class
  560. // icon (e.g., "FOOBAR.DLL,2") or per-instance icon (e.g., "%1,1").
  561. // (3) If a per-instance icon is specified, the shell creates an icon
  562. // extraction handler object for it, and extracts the icon from it
  563. // (which is described above).
  564. //
  565. // It is important to note that the shell calls IExtractIcon::GetIconLocation
  566. // first, then calls IExtractIcon::Extract. Most application programs
  567. // that support per-instance icons will probably store an icon location
  568. // (DLL/EXE name and index/id) rather than an icon image in each file.
  569. // In those cases, a programmer needs to implement only the GetIconLocation
  570. // member and it Extract member simply returns S_FALSE. They need to
  571. // implement Extract member only if they decided to store the icon images
  572. // within files themselved or some other database (which is very rare).
  573. //
  574. //
  575. //
  576. // [Member functions]
  577. //
  578. //
  579. // IExtractIcon::GetIconLocation
  580. //
  581. // This function returns an icon location.
  582. //
  583. // Parameters:
  584. // uFlags [in] -- Specifies if it is opened or not (GIL_OPENICON or 0)
  585. // szIconFile [out] -- Specifies the string buffer buffer for a location name.
  586. // cchMax [in] -- Specifies the size of szIconFile (almost always MAX_PATH)
  587. // piIndex [out] -- Sepcifies the address of UINT for the index.
  588. // pwFlags [out] -- Returns GIL_* flags
  589. // Returns:
  590. // NOERROR, if it returns a valid location; S_FALSE, if the shell use a
  591. // default icon.
  592. //
  593. // Notes: The location may or may not be a path to a file. The caller can
  594. // not assume anything unless the subsequent Extract member call returns
  595. // S_FALSE.
  596. //
  597. // if the returned location is not a path to a file, GIL_NOTFILENAME should
  598. // be set in the returned flags.
  599. //
  600. // IExtractIcon::Extract
  601. //
  602. // This function extracts an icon image from a specified file.
  603. //
  604. // Parameters:
  605. // pszFile [in] -- Specifies the icon location (typically a path to a file).
  606. // nIconIndex [in] -- Specifies the icon index.
  607. // phiconLarge [out] -- Specifies the HICON variable for large icon.
  608. // phiconSmall [out] -- Specifies the HICON variable for small icon.
  609. // nIconSize [in] -- Specifies the size icon required (size of large icon)
  610. // LOWORD is the requested large icon size
  611. // HIWORD is the requested small icon size
  612. // Returns:
  613. // NOERROR, if it extracted the from the file.
  614. // S_FALSE, if the caller should extract from the file specified in the
  615. // location.
  616. //
  617. //===========================================================================
  618. // GetIconLocation() input flags
  619. #define GIL_OPENICON 0x0001 // allows containers to specify an "open" look
  620. #define GIL_FORSHELL 0x0002 // icon is to be displayed in a ShellFolder
  621. #define GIL_ASYNC 0x0020 // this is an async extract, return E_PENDING
  622. #define GIL_DEFAULTICON 0x0040 // get the default icon location if the final one takes too long to get
  623. #define GIL_FORSHORTCUT 0x0080 // the icon is for a shortcut to the object
  624. // GetIconLocation() return flags
  625. #define GIL_SIMULATEDOC 0x0001 // simulate this document icon for this
  626. #define GIL_PERINSTANCE 0x0002 // icons from this class are per instance (each file has its own)
  627. #define GIL_PERCLASS 0x0004 // icons from this class per class (shared for all files of this type)
  628. #define GIL_NOTFILENAME 0x0008 // location is not a filename, must call ::ExtractIcon
  629. #define GIL_DONTCACHE 0x0010 // this icon should not be cached
  630. #undef INTERFACE
  631. #define INTERFACE IExtractIconA
  632. DECLARE_INTERFACE_(IExtractIconA, IUnknown) // exic
  633. {
  634. // *** IUnknown methods ***
  635. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  636. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  637. STDMETHOD_(ULONG,Release) (THIS) PURE;
  638. // *** IExtractIcon methods ***
  639. STDMETHOD(GetIconLocation)(THIS_
  640. UINT uFlags,
  641. LPSTR szIconFile,
  642. UINT cchMax,
  643. int * piIndex,
  644. UINT * pwFlags) PURE;
  645. STDMETHOD(Extract)(THIS_
  646. LPCSTR pszFile,
  647. UINT nIconIndex,
  648. HICON *phiconLarge,
  649. HICON *phiconSmall,
  650. UINT nIconSize) PURE;
  651. };
  652. typedef IExtractIconA * LPEXTRACTICONA;
  653. #undef INTERFACE
  654. #define INTERFACE IExtractIconW
  655. DECLARE_INTERFACE_(IExtractIconW, IUnknown) // exic
  656. {
  657. // *** IUnknown methods ***
  658. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  659. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  660. STDMETHOD_(ULONG,Release) (THIS) PURE;
  661. // *** IExtractIcon methods ***
  662. STDMETHOD(GetIconLocation)(THIS_
  663. UINT uFlags,
  664. LPWSTR szIconFile,
  665. UINT cchMax,
  666. int * piIndex,
  667. UINT * pwFlags) PURE;
  668. STDMETHOD(Extract)(THIS_
  669. LPCWSTR pszFile,
  670. UINT nIconIndex,
  671. HICON *phiconLarge,
  672. HICON *phiconSmall,
  673. UINT nIconSize) PURE;
  674. };
  675. typedef IExtractIconW * LPEXTRACTICONW;
  676. #ifdef UNICODE
  677. #define IExtractIcon IExtractIconW
  678. #define IExtractIconVtbl IExtractIconWVtbl
  679. #define LPEXTRACTICON LPEXTRACTICONW
  680. #else
  681. #define IExtractIcon IExtractIconA
  682. #define IExtractIconVtbl IExtractIconAVtbl
  683. #define LPEXTRACTICON LPEXTRACTICONA
  684. #endif
  685. //===========================================================================
  686. //
  687. // IShellIcon Interface
  688. //
  689. // used to get a icon index for a IShellFolder object.
  690. //
  691. // this interface can be implemented by a IShellFolder, as a quick way to
  692. // return the icon for a object in the folder.
  693. //
  694. // a instance of this interface is only created once for the folder, unlike
  695. // IExtractIcon witch is created once for each object.
  696. //
  697. // if a ShellFolder does not implement this interface, the standard
  698. // GetUIObject(....IExtractIcon) method will be used to get a icon
  699. // for all objects.
  700. //
  701. // the following standard imagelist indexs can be returned:
  702. //
  703. // 0 document (blank page) (not associated)
  704. // 1 document (with stuff on the page)
  705. // 2 application (exe, com, bat)
  706. // 3 folder (plain)
  707. // 4 folder (open)
  708. //
  709. // IShellIcon:GetIconOf(pidl, flags, lpIconIndex)
  710. //
  711. // pidl object to get icon for.
  712. // flags GIL_* input flags (GIL_OPEN, ...)
  713. // lpIconIndex place to return icon index.
  714. //
  715. // returns:
  716. // NOERROR, if lpIconIndex contains the correct system imagelist index.
  717. // S_FALSE, if unable to get icon for this object, go through
  718. // GetUIObject, IExtractIcon, methods.
  719. //
  720. //===========================================================================
  721. #undef INTERFACE
  722. #define INTERFACE IShellIcon
  723. DECLARE_INTERFACE_(IShellIcon, IUnknown) // shi
  724. {
  725. // *** IUnknown methods ***
  726. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  727. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  728. STDMETHOD_(ULONG,Release) (THIS) PURE;
  729. // *** IShellIcon methods ***
  730. STDMETHOD(GetIconOf)(THIS_ LPCITEMIDLIST pidl, UINT flags,
  731. LPINT lpIconIndex) PURE;
  732. };
  733. typedef IShellIcon *LPSHELLICON;
  734. //===========================================================================
  735. //
  736. // IShellIconOverlayIdentifier
  737. //
  738. // Used to identify a file as a member of the group of files that have this specific
  739. // icon overlay
  740. //
  741. // Users can create new IconOverlayIdentifiers and place them in the following registry
  742. // location together with the Icon overlay image and their priority.
  743. // HKEY_LOCAL_MACHINE "Software\\Microsoft\\Windows\\CurrentVersion\\ShellIconOverlayIdentifiers"
  744. //
  745. // The shell will enumerate through all IconOverlayIdentifiers at start, and prioritize
  746. // them according to internal rules, in case the internal rules don't apply, we use their
  747. // input priority
  748. //
  749. // IShellIconOverlayIdentifier:IsMemberOf(LPCWSTR pwszPath, DWORD dwAttrib)
  750. // pwszPath full path of the file
  751. // dwAttrib attribute of this file
  752. //
  753. // returns:
  754. // S_OK, if the file is a member
  755. // S_FALSE, if the file is not a member
  756. // E_FAIL, if the operation failed due to bad WIN32_FIND_DATA
  757. //
  758. // IShellIconOverlayIdentifier::GetOverlayInfo(LPWSTR pwszIconFile, int * pIndex, DWORD * dwFlags) PURE;
  759. // pszIconFile the path of the icon file
  760. // pIndex Depend on the flags, this could contain the IconIndex
  761. // dwFlags defined below
  762. //
  763. // IShellIconOverlayIdentifier::GetPriority(int * pIPriority) PURE;
  764. // pIPriority the priority of this Overlay Identifier
  765. //
  766. //===========================================================================
  767. #undef INTERFACE
  768. #define INTERFACE IShellIconOverlayIdentifier
  769. DECLARE_INTERFACE_(IShellIconOverlayIdentifier, IUnknown)
  770. {
  771. // *** IUnknown methods ***
  772. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  773. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  774. STDMETHOD_(ULONG,Release) (THIS) PURE;
  775. // *** IShellIconOverlayIdentifier methods ***
  776. STDMETHOD (IsMemberOf)(THIS_ LPCWSTR pwszPath, DWORD dwAttrib) PURE;
  777. STDMETHOD (GetOverlayInfo)(THIS_ LPWSTR pwszIconFile, int cchMax, int * pIndex, DWORD * pdwFlags) PURE;
  778. STDMETHOD (GetPriority)(THIS_ int * pIPriority) PURE;
  779. };
  780. #define ISIOI_ICONFILE 0x00000001 // path is returned through pwszIconFile
  781. #define ISIOI_ICONINDEX 0x00000002 // icon index in pwszIconFile is returned through pIndex
  782. //===========================================================================
  783. //
  784. // IShellIconOverlayManager
  785. //
  786. // Used to return the icon overlay information including OverlayIndex, Image Index or Priority for an IShellFolder object.
  787. //
  788. // IShellIconOverlayManager:GetFileOverlayInfo(LPCWSTR pwszPath, DWORD dwAttrib, int * pIndex, DWORD dwflags)
  789. // pwszPath full path of the file
  790. // dwAttrib attribute of this file
  791. // pIndex pointer to the Icon Index in the system image list
  792. // pOverlayIndex pointer to the OverlayIndex in the system image list
  793. // pPriority pointer to the Priority of this overlay
  794. // IShellIconOverlayManager:GetReservedOverlayInfo(LPCWSTR pwszPath, DWORD dwAttrib, int * pIndex, DWORD dwflags, int iReservedID)
  795. // iReservedID reserved icon overlay id
  796. // returns:
  797. // S_OK, if the index of an Overlay is found
  798. // S_FALSE, if no Overlay exists for this file
  799. // E_FAIL, if lpfd is bad
  800. // IShellIconOverlayManager:RefreshOverlayImages(DWORD dwFlags)
  801. // This will refresh the overlay cache, depends on the dwFlags passed in
  802. // It will reload the icons into the imagelist, when passed SIOM_ICONINDEX
  803. // IShellIconOverlayManager::LoadNonloadedOverlayIdentifiers()
  804. // This method loads any registered overlay identifiers (handlers) that
  805. // are not currently loaded.
  806. // IShellIconOverlayManager::OverlayIndexFromImageIndex(int iImage, int *piIndex, BOOL fAdd)
  807. // iImage existing shell image list index to look for
  808. // piIndex returned overlay index
  809. // fAdd Add image if not already present?
  810. //===========================================================================
  811. #undef INTERFACE
  812. #define INTERFACE IShellIconOverlayManager
  813. DECLARE_INTERFACE_(IShellIconOverlayManager, IUnknown)
  814. {
  815. // *** IUnknown methods ***
  816. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  817. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  818. STDMETHOD_(ULONG,Release) (THIS) PURE;
  819. // *** IShellIconOverlayManager methods ***
  820. STDMETHOD(GetFileOverlayInfo)(THIS_ LPCWSTR pwszPath, DWORD dwAttrib, int * pIndex, DWORD dwflags) PURE;
  821. STDMETHOD(GetReservedOverlayInfo)(THIS_ LPCWSTR pwszPath, DWORD dwAttrib, int * pIndex, DWORD dwflags, int iReservedID) PURE;
  822. STDMETHOD(RefreshOverlayImages)(THIS_ DWORD dwFlags) PURE;
  823. STDMETHOD(LoadNonloadedOverlayIdentifiers)(THIS) PURE;
  824. STDMETHOD(OverlayIndexFromImageIndex)(THIS_ int iImage, int * piIndex, BOOL fAdd) PURE;
  825. };
  826. #define SIOM_OVERLAYINDEX 1
  827. #define SIOM_ICONINDEX 2
  828. // #define SIOM_PRIORITY 3
  829. #define SIOM_RESERVED_SHARED 0
  830. #define SIOM_RESERVED_LINK 1
  831. #define SIOM_RESERVED_SLOWFILE 2
  832. //===========================================================================
  833. //
  834. // IShellIconOverlay
  835. //
  836. // Used to return the icon overlay index or its icon index for an IShellFolder object,
  837. // this is always implemented with IShellFolder
  838. //
  839. // IShellIconOverlay:GetOverlayIndex(LPCITEMIDLIST pidl, DWORD * pdwIndex)
  840. // pidl object to identify icon overlay for.
  841. // pdwIndex the Overlay Index in the system image list
  842. //
  843. // IShellIconOverlay:GetOverlayIconIndex(LPCITEMIDLIST pidl, DWORD * pdwIndex)
  844. // pdwIconIndex the Overlay Icon index in the system image list
  845. // This method is only used for those who are interested in seeing the real bits
  846. // of the Overlay Icon
  847. //
  848. // returns:
  849. // S_OK, if the index of an Overlay is found
  850. // S_FALSE, if no Overlay exists for this file
  851. // E_FAIL, if pidl is bad
  852. //
  853. //===========================================================================
  854. #undef INTERFACE
  855. #define INTERFACE IShellIconOverlay
  856. DECLARE_INTERFACE_(IShellIconOverlay, IUnknown)
  857. {
  858. // *** IUnknown methods ***
  859. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  860. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  861. STDMETHOD_(ULONG,Release) (THIS) PURE;
  862. // *** IShellIconOverlay methods ***
  863. STDMETHOD(GetOverlayIndex)(THIS_ LPCITEMIDLIST pidl, int * pIndex) PURE;
  864. STDMETHOD(GetOverlayIconIndex)(THIS_ LPCITEMIDLIST pidl, int * pIconIndex) PURE;
  865. };
  866. #define OI_ASYNC 0xFFFFEEEE
  867. //-------------------------------------------------------------------------
  868. //
  869. // SHGetIconOverlayIndex
  870. //
  871. // This function takes the path and icon/res id to the icon and convert it into
  872. // an overlay index in the system image list.
  873. // Note: there are totally only 15 slots for system image overlays, some of which
  874. // was reserved by the system, or taken by the overlayidentifiers, so it's possible
  875. // that this function would fail and return -1;
  876. //
  877. // To get the default overlays in the system, such as the share hand, link shortcut
  878. // and slow files, pass NULL as the file name, then the IDO_SHGIOI_* flags as the icon index
  879. //-------------------------------------------------------------------------
  880. #define IDO_SHGIOI_SHARE 0x0FFFFFFF
  881. #define IDO_SHGIOI_LINK 0x0FFFFFFE
  882. #define IDO_SHGIOI_SLOWFILE 0x0FFFFFFFD
  883. SHSTDAPI_(int) SHGetIconOverlayIndexA(LPCSTR pszIconPath, int iIconIndex);
  884. SHSTDAPI_(int) SHGetIconOverlayIndexW(LPCWSTR pszIconPath, int iIconIndex);
  885. #ifdef UNICODE
  886. #define SHGetIconOverlayIndex SHGetIconOverlayIndexW
  887. #else
  888. #define SHGetIconOverlayIndex SHGetIconOverlayIndexA
  889. #endif // !UNICODE
  890. #if (_WIN32_IE >= 0x0400)
  891. // IShellLinkDataList::GetFlags()/SetFlags()
  892. typedef enum {
  893. SLDF_HAS_ID_LIST = 0x00000001, // Shell link saved with ID list
  894. SLDF_HAS_LINK_INFO = 0x00000002, // Shell link saved with LinkInfo
  895. SLDF_HAS_NAME = 0x00000004,
  896. SLDF_HAS_RELPATH = 0x00000008,
  897. SLDF_HAS_WORKINGDIR = 0x00000010,
  898. SLDF_HAS_ARGS = 0x00000020,
  899. SLDF_HAS_ICONLOCATION = 0x00000040,
  900. SLDF_UNICODE = 0x00000080, // the strings are unicode
  901. SLDF_FORCE_NO_LINKINFO = 0x00000100, // don't create a LINKINFO (make a dumb link)
  902. SLDF_HAS_EXP_SZ = 0x00000200, // the link contains expandable env strings
  903. SLDF_RUN_IN_SEPARATE = 0x00000400, // Run the 16-bit target exe in a separate VDM/WOW
  904. SLDF_HAS_LOGO3ID = 0x00000800, // this link is a special Logo3/MSICD link
  905. SLDF_HAS_DARWINID = 0x00001000, // this link is a special Darwin link
  906. SLDF_RUNAS_USER = 0x00002000, // Run this link as a different user
  907. SLDF_HAS_EXP_ICON_SZ = 0x00004000, // contains expandable env string for icon path
  908. SLDF_NO_PIDL_ALIAS = 0x00008000, // don't ever resolve to a logical location
  909. SLDF_FORCE_UNCNAME = 0x00010000, // make GetPath() prefer the UNC name to the local name
  910. SLDF_RUN_WITH_SHIMLAYER = 0x00020000, // Launch the target of this link w/ shim layer active
  911. SLDF_RESERVED = 0x80000000, // Reserved-- so we can use the low word as an index value in the future
  912. } SHELL_LINK_DATA_FLAGS;
  913. typedef struct tagDATABLOCKHEADER
  914. {
  915. DWORD cbSize; // Size of this extra data block
  916. DWORD dwSignature; // signature of this extra data block
  917. } DATABLOCK_HEADER, *LPDATABLOCK_HEADER, *LPDBLIST;
  918. typedef struct {
  919. #ifdef __cplusplus
  920. DATABLOCK_HEADER dbh;
  921. #else
  922. DATABLOCK_HEADER;
  923. #endif
  924. WORD wFillAttribute; // fill attribute for console
  925. WORD wPopupFillAttribute; // fill attribute for console popups
  926. COORD dwScreenBufferSize; // screen buffer size for console
  927. COORD dwWindowSize; // window size for console
  928. COORD dwWindowOrigin; // window origin for console
  929. DWORD nFont;
  930. DWORD nInputBufferSize;
  931. COORD dwFontSize;
  932. UINT uFontFamily;
  933. UINT uFontWeight;
  934. WCHAR FaceName[LF_FACESIZE];
  935. UINT uCursorSize;
  936. BOOL bFullScreen;
  937. BOOL bQuickEdit;
  938. BOOL bInsertMode;
  939. BOOL bAutoPosition;
  940. UINT uHistoryBufferSize;
  941. UINT uNumberOfHistoryBuffers;
  942. BOOL bHistoryNoDup;
  943. COLORREF ColorTable[ 16 ];
  944. } NT_CONSOLE_PROPS, *LPNT_CONSOLE_PROPS;
  945. #define NT_CONSOLE_PROPS_SIG 0xA0000002
  946. // This is a FE Console property
  947. typedef struct {
  948. #ifdef __cplusplus
  949. DATABLOCK_HEADER dbh;
  950. #else
  951. DATABLOCK_HEADER;
  952. #endif
  953. UINT uCodePage;
  954. } NT_FE_CONSOLE_PROPS, *LPNT_FE_CONSOLE_PROPS;
  955. #define NT_FE_CONSOLE_PROPS_SIG 0xA0000004
  956. #if (_WIN32_IE >= 0x0500)
  957. typedef struct {
  958. #ifdef __cplusplus
  959. DATABLOCK_HEADER dbh;
  960. #else
  961. DATABLOCK_HEADER;
  962. #endif
  963. CHAR szDarwinID[MAX_PATH]; // ANSI darwin ID associated with link
  964. WCHAR szwDarwinID[MAX_PATH]; // UNICODE darwin ID associated with link
  965. } EXP_DARWIN_LINK, *LPEXP_DARWIN_LINK;
  966. #define EXP_DARWIN_ID_SIG 0xA0000006
  967. // WARNING: (reinerf) - this has the same value as EXP_SZ_ICON_SIG?!?!?!
  968. #define EXP_LOGO3_ID_SIG 0xA0000007
  969. #endif
  970. #define EXP_SPECIAL_FOLDER_SIG 0xA0000005 // LPEXP_SPECIAL_FOLDER
  971. typedef struct
  972. {
  973. DWORD cbSize; // Size of this extra data block
  974. DWORD dwSignature; // signature of this extra data block
  975. DWORD idSpecialFolder; // special folder id this link points into
  976. DWORD cbOffset; // ofset into pidl from SLDF_HAS_ID_LIST for child
  977. } EXP_SPECIAL_FOLDER, *LPEXP_SPECIAL_FOLDER;
  978. typedef struct
  979. {
  980. DWORD cbSize; // Size of this extra data block
  981. DWORD dwSignature; // signature of this extra data block
  982. CHAR szTarget[ MAX_PATH ]; // ANSI target name w/EXP_SZ in it
  983. WCHAR swzTarget[ MAX_PATH ]; // UNICODE target name w/EXP_SZ in it
  984. } EXP_SZ_LINK, *LPEXP_SZ_LINK;
  985. #define EXP_SZ_LINK_SIG 0xA0000001 // LPEXP_SZ_LINK (target)
  986. #define EXP_SZ_ICON_SIG 0xA0000007 // LPEXP_SZ_LINK (icon)
  987. #undef INTERFACE
  988. #define INTERFACE IShellLinkDataList
  989. DECLARE_INTERFACE_(IShellLinkDataList, IUnknown)
  990. {
  991. // *** IUnknown methods ***
  992. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  993. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  994. STDMETHOD_(ULONG, Release) (THIS) PURE;
  995. // *** IShellLinkDataList methods ***
  996. STDMETHOD(AddDataBlock)(THIS_ void * pDataBlock) PURE;
  997. STDMETHOD(CopyDataBlock)(THIS_ DWORD dwSig, void **ppDataBlock) PURE;
  998. STDMETHOD(RemoveDataBlock)(THIS_ DWORD dwSig) PURE;
  999. STDMETHOD(GetFlags)(THIS_ DWORD *pdwFlags) PURE;
  1000. STDMETHOD(SetFlags)(THIS_ DWORD dwFlags) PURE;
  1001. };
  1002. #endif // (_WIN32_IE >= 0x0400)
  1003. #if (_WIN32_IE >= 0x0500)
  1004. #undef INTERFACE
  1005. #define INTERFACE IResolveShellLink
  1006. DECLARE_INTERFACE_(IResolveShellLink, IUnknown)
  1007. {
  1008. // *** IUnknown methods ***
  1009. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1010. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1011. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1012. // *** IResolveShellLink methods ***
  1013. STDMETHOD(ResolveShellLink)(THIS_ IUnknown* punk, HWND hwnd, DWORD fFlags) PURE;
  1014. };
  1015. #endif // (_WIN32_IE >= 0x0500)
  1016. #ifdef _INC_SHELLAPI /* for LPSHELLEXECUTEINFO */
  1017. //===========================================================================
  1018. //
  1019. // IShellExecuteHook Interface
  1020. //
  1021. //===========================================================================
  1022. #undef INTERFACE
  1023. #define INTERFACE IShellExecuteHookA
  1024. DECLARE_INTERFACE_(IShellExecuteHookA, IUnknown) // shexhk
  1025. {
  1026. // *** IUnknown methods ***
  1027. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1028. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1029. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1030. // *** IShellExecuteHookA methods ***
  1031. STDMETHOD(Execute)(THIS_ LPSHELLEXECUTEINFOA pei) PURE;
  1032. };
  1033. #undef INTERFACE
  1034. #define INTERFACE IShellExecuteHookW
  1035. DECLARE_INTERFACE_(IShellExecuteHookW, IUnknown) // shexhk
  1036. {
  1037. // *** IUnknown methods ***
  1038. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1039. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1040. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1041. // *** IShellExecuteHookW methods ***
  1042. STDMETHOD(Execute)(THIS_ LPSHELLEXECUTEINFOW pei) PURE;
  1043. };
  1044. #ifdef UNICODE
  1045. #define IShellExecuteHook IShellExecuteHookW
  1046. #define IShellExecuteHookVtbl IShellExecuteHookWVtbl
  1047. #else
  1048. #define IShellExecuteHook IShellExecuteHookA
  1049. #define IShellExecuteHookVtbl IShellExecuteHookAVtbl
  1050. #endif
  1051. #endif
  1052. //===========================================================================
  1053. //
  1054. // IURLSearchHook Interface
  1055. //
  1056. //===========================================================================
  1057. #undef INTERFACE
  1058. #define INTERFACE IURLSearchHook
  1059. DECLARE_INTERFACE_(IURLSearchHook, IUnknown)
  1060. {
  1061. // *** IUnknown methods ***
  1062. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1063. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1064. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1065. // *** IURLSearchHook methods ***
  1066. STDMETHOD(Translate)(THIS_ LPWSTR lpwszSearchURL, DWORD cchBufferSize) PURE;
  1067. };
  1068. #undef INTERFACE
  1069. #define INTERFACE ISearchContext
  1070. DECLARE_INTERFACE_(ISearchContext, IUnknown)
  1071. {
  1072. // *** IUnknown methods ***
  1073. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1074. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1075. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1076. // *** ISearchContext methods ***
  1077. STDMETHOD(GetSearchUrl)(THIS_ BSTR * pbstrSearchUrl) PURE;
  1078. STDMETHOD(GetSearchText)(THIS_ BSTR * pbstrSearchText) PURE;
  1079. STDMETHOD(GetSearchStyle)(THIS_ DWORD * pdwSearchStyle) PURE;
  1080. };
  1081. #undef INTERFACE
  1082. #define INTERFACE IURLSearchHook2
  1083. DECLARE_INTERFACE_(IURLSearchHook2, IURLSearchHook)
  1084. {
  1085. // *** IURLSearchHook2 methods ***
  1086. STDMETHOD(TranslateWithSearchContext)(THIS_ LPWSTR lpwszSearchURL, DWORD cchBufferSize, ISearchContext * pSearchContext) PURE;
  1087. };
  1088. //===========================================================================
  1089. //
  1090. // INewShortcutHook Interface
  1091. //
  1092. //===========================================================================
  1093. #undef INTERFACE
  1094. #define INTERFACE INewShortcutHookA
  1095. DECLARE_INTERFACE_(INewShortcutHookA, IUnknown) // nshhk
  1096. {
  1097. // *** IUnknown methods ***
  1098. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1099. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1100. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1101. // *** INewShortcutHook methods ***
  1102. STDMETHOD(SetReferent)(THIS_ LPCSTR pcszReferent, HWND hwnd) PURE;
  1103. STDMETHOD(GetReferent)(THIS_ LPSTR pszReferent, int cchReferent) PURE;
  1104. STDMETHOD(SetFolder)(THIS_ LPCSTR pcszFolder) PURE;
  1105. STDMETHOD(GetFolder)(THIS_ LPSTR pszFolder, int cchFolder) PURE;
  1106. STDMETHOD(GetName)(THIS_ LPSTR pszName, int cchName) PURE;
  1107. STDMETHOD(GetExtension)(THIS_ LPSTR pszExtension, int cchExtension) PURE;
  1108. };
  1109. #undef INTERFACE
  1110. #define INTERFACE INewShortcutHookW
  1111. DECLARE_INTERFACE_(INewShortcutHookW, IUnknown) // nshhk
  1112. {
  1113. // *** IUnknown methods ***
  1114. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1115. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1116. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1117. // *** INewShortcutHook methods ***
  1118. STDMETHOD(SetReferent)(THIS_ LPCWSTR pcszReferent, HWND hwnd) PURE;
  1119. STDMETHOD(GetReferent)(THIS_ LPWSTR pszReferent, int cchReferent) PURE;
  1120. STDMETHOD(SetFolder)(THIS_ LPCWSTR pcszFolder) PURE;
  1121. STDMETHOD(GetFolder)(THIS_ LPWSTR pszFolder, int cchFolder) PURE;
  1122. STDMETHOD(GetName)(THIS_ LPWSTR pszName, int cchName) PURE;
  1123. STDMETHOD(GetExtension)(THIS_ LPWSTR pszExtension, int cchExtension) PURE;
  1124. };
  1125. #ifdef UNICODE
  1126. #define INewShortcutHook INewShortcutHookW
  1127. #define INewShortcutHookVtbl INewShortcutHookWVtbl
  1128. #else
  1129. #define INewShortcutHook INewShortcutHookA
  1130. #define INewShortcutHookVtbl INewShortcutHookAVtbl
  1131. #endif
  1132. //===========================================================================
  1133. //
  1134. // ICopyHook Interface
  1135. //
  1136. // The copy hook is called whenever file system directories are
  1137. // copy/moved/deleted/renamed via the shell. It is also called by the shell
  1138. // on changes of status of printers.
  1139. //
  1140. // Clients register their id under STRREG_SHEX_COPYHOOK for file system hooks
  1141. // and STRREG_SHEx_PRNCOPYHOOK for printer hooks.
  1142. // the CopyCallback is called prior to the action, so the hook has the chance
  1143. // to allow, deny or cancel the operation by returning the falues:
  1144. // IDYES - means allow the operation
  1145. // IDNO - means disallow the operation on this file, but continue with
  1146. // any other operations (eg. batch copy)
  1147. // IDCANCEL - means disallow the current operation and cancel any pending
  1148. // operations
  1149. //
  1150. // arguments to the CopyCallback
  1151. // hwnd - window to use for any UI
  1152. // wFunc - what operation is being done
  1153. // wFlags - and flags (FOF_*) set in the initial call to the file operation
  1154. // pszSrcFile - name of the source file
  1155. // dwSrcAttribs - file attributes of the source file
  1156. // pszDestFile - name of the destiation file (for move and renames)
  1157. // dwDestAttribs - file attributes of the destination file
  1158. //
  1159. //
  1160. //===========================================================================
  1161. #ifndef FO_MOVE //these need to be kept in sync with the ones in shellapi.h
  1162. // file operations
  1163. #define FO_MOVE 0x0001
  1164. #define FO_COPY 0x0002
  1165. #define FO_DELETE 0x0003
  1166. #define FO_RENAME 0x0004
  1167. #define FOF_MULTIDESTFILES 0x0001
  1168. #define FOF_CONFIRMMOUSE 0x0002
  1169. #define FOF_SILENT 0x0004 // don't create progress/report
  1170. #define FOF_RENAMEONCOLLISION 0x0008
  1171. #define FOF_NOCONFIRMATION 0x0010 // Don't prompt the user.
  1172. #define FOF_WANTMAPPINGHANDLE 0x0020 // Fill in SHFILEOPSTRUCT.hNameMappings
  1173. // Must be freed using SHFreeNameMappings
  1174. #define FOF_ALLOWUNDO 0x0040
  1175. #define FOF_FILESONLY 0x0080 // on *.*, do only files
  1176. #define FOF_SIMPLEPROGRESS 0x0100 // means don't show names of files
  1177. #define FOF_NOCONFIRMMKDIR 0x0200 // don't confirm making any needed dirs
  1178. #define FOF_NOERRORUI 0x0400 // don't put up error UI
  1179. #define FOF_NOCOPYSECURITYATTRIBS 0x0800 // dont copy NT file Security Attributes
  1180. #define FOF_NORECURSION 0x1000 // don't recurse into directories.
  1181. #if (_WIN32_IE >= 0x500)
  1182. #define FOF_NO_CONNECTED_ELEMENTS 0x2000 // don't operate on connected file elements.
  1183. #define FOF_WANTNUKEWARNING 0x4000 // during delete operation, warn if nuking instead of recycling (partially overrides FOF_NOCONFIRMATION)
  1184. #endif // _WIN32_IE >= 0x500
  1185. #if (_WIN32_WINNT >= 0x0501)
  1186. #define FOF_NORECURSEREPARSE 0x8000 // treat reparse points as objects, not containers
  1187. #endif // (_WIN32_WINNT >= 0x501)
  1188. typedef WORD FILEOP_FLAGS;
  1189. // printer operations
  1190. #define PO_DELETE 0x0013 // printer is being deleted
  1191. #define PO_RENAME 0x0014 // printer is being renamed
  1192. #define PO_PORTCHANGE 0x0020 // port this printer connected to is being changed
  1193. // if this id is set, the strings received by
  1194. // the copyhook are a doubly-null terminated
  1195. // list of strings. The first is the printer
  1196. // name and the second is the printer port.
  1197. #define PO_REN_PORT 0x0034 // PO_RENAME and PO_PORTCHANGE at same time.
  1198. // no POF_ flags currently defined
  1199. typedef UINT PRINTEROP_FLAGS;
  1200. #endif // FO_MOVE
  1201. #undef INTERFACE
  1202. #define INTERFACE ICopyHookA
  1203. DECLARE_INTERFACE_(ICopyHookA, IUnknown) // sl
  1204. {
  1205. // *** IUnknown methods ***
  1206. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1207. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1208. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1209. // *** ICopyHook methods ***
  1210. STDMETHOD_(UINT,CopyCallback) (THIS_ HWND hwnd, UINT wFunc, UINT wFlags, LPCSTR pszSrcFile, DWORD dwSrcAttribs,
  1211. LPCSTR pszDestFile, DWORD dwDestAttribs) PURE;
  1212. };
  1213. typedef ICopyHookA * LPCOPYHOOKA;
  1214. #undef INTERFACE
  1215. #define INTERFACE ICopyHookW
  1216. DECLARE_INTERFACE_(ICopyHookW, IUnknown) // sl
  1217. {
  1218. // *** IUnknown methods ***
  1219. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1220. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1221. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1222. // *** ICopyHook methods ***
  1223. STDMETHOD_(UINT,CopyCallback) (THIS_ HWND hwnd, UINT wFunc, UINT wFlags, LPCWSTR pszSrcFile, DWORD dwSrcAttribs,
  1224. LPCWSTR pszDestFile, DWORD dwDestAttribs) PURE;
  1225. };
  1226. typedef ICopyHookW * LPCOPYHOOKW;
  1227. #ifdef UNICODE
  1228. #define ICopyHook ICopyHookW
  1229. #define ICopyHookVtbl ICopyHookWVtbl
  1230. #define LPCOPYHOOK LPCOPYHOOKW
  1231. #else
  1232. #define ICopyHook ICopyHookA
  1233. #define ICopyHookVtbl ICopyHookAVtbl
  1234. #define LPCOPYHOOK LPCOPYHOOKA
  1235. #endif
  1236. //===========================================================================
  1237. //
  1238. // IFileViewerSite Interface
  1239. //
  1240. //===========================================================================
  1241. #undef INTERFACE
  1242. #define INTERFACE IFileViewerSite
  1243. DECLARE_INTERFACE_(IFileViewerSite, IUnknown)
  1244. {
  1245. // *** IUnknown methods ***
  1246. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1247. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1248. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1249. // *** IFileViewerSite methods ***
  1250. STDMETHOD(SetPinnedWindow) (THIS_ HWND hwnd) PURE;
  1251. STDMETHOD(GetPinnedWindow) (THIS_ HWND *phwnd) PURE;
  1252. };
  1253. typedef IFileViewerSite * LPFILEVIEWERSITE;
  1254. //===========================================================================
  1255. //
  1256. // IFileViewer Interface
  1257. //
  1258. // Implemented in a FileViewer component object. Used to tell a
  1259. // FileViewer to PrintTo or to view, the latter happening though
  1260. // ShowInitialize and Show. The filename is always given to the
  1261. // viewer through IPersistFile.
  1262. //
  1263. //===========================================================================
  1264. #include <pshpack8.h>
  1265. typedef struct
  1266. {
  1267. // Stuff passed into viewer (in)
  1268. DWORD cbSize; // Size of structure for future expansion...
  1269. HWND hwndOwner; // who is the owner window.
  1270. int iShow; // The show command
  1271. // Passed in and updated (in/Out)
  1272. DWORD dwFlags; // flags
  1273. RECT rect; // Where to create the window may have defaults
  1274. IUnknown *punkRel; // Relese this interface when window is visible
  1275. // Stuff that might be returned from viewer (out)
  1276. OLECHAR strNewFile[MAX_PATH]; // New File to view.
  1277. } FVSHOWINFO, *LPFVSHOWINFO;
  1278. #include <poppack.h> /* Return to byte packing */
  1279. // Define File View Show Info Flags.
  1280. #define FVSIF_RECT 0x00000001 // The rect variable has valid data.
  1281. #define FVSIF_PINNED 0x00000002 // We should Initialize pinned
  1282. #define FVSIF_NEWFAILED 0x08000000 // The new file passed back failed
  1283. // to be viewed.
  1284. #define FVSIF_NEWFILE 0x80000000 // A new file to view has been returned
  1285. #define FVSIF_CANVIEWIT 0x40000000 // The viewer can view it.
  1286. #undef INTERFACE
  1287. #define INTERFACE IFileViewerA
  1288. DECLARE_INTERFACE(IFileViewerA)
  1289. {
  1290. // *** IUnknown methods ***
  1291. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1292. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1293. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1294. // *** IFileViewer methods ***
  1295. STDMETHOD(ShowInitialize) (THIS_ LPFILEVIEWERSITE lpfsi) PURE;
  1296. STDMETHOD(Show) (THIS_ LPFVSHOWINFO pvsi) PURE;
  1297. STDMETHOD(PrintTo) (THIS_ LPSTR pszDriver, BOOL fSuppressUI) PURE;
  1298. };
  1299. typedef IFileViewerA * LPFILEVIEWERA;
  1300. #undef INTERFACE
  1301. #define INTERFACE IFileViewerW
  1302. DECLARE_INTERFACE(IFileViewerW)
  1303. {
  1304. // *** IUnknown methods ***
  1305. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1306. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1307. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1308. // *** IFileViewer methods ***
  1309. STDMETHOD(ShowInitialize) (THIS_ LPFILEVIEWERSITE lpfsi) PURE;
  1310. STDMETHOD(Show) (THIS_ LPFVSHOWINFO pvsi) PURE;
  1311. STDMETHOD(PrintTo) (THIS_ LPWSTR pszDriver, BOOL fSuppressUI) PURE;
  1312. };
  1313. typedef IFileViewerW * LPFILEVIEWERW;
  1314. #ifdef UNICODE
  1315. #define IFileViewer IFileViewerW
  1316. #define LPFILEVIEWER LPFILEVIEWERW
  1317. #else
  1318. #define IFileViewer IFileViewerA
  1319. #define LPFILEVIEWER LPFILEVIEWERA
  1320. #endif
  1321. //==========================================================================
  1322. //
  1323. // IShellBrowser/IShellView/IShellFolder interface
  1324. //
  1325. // These three interfaces are used when the shell communicates with
  1326. // name space extensions. The shell (explorer) provides IShellBrowser
  1327. // interface, and extensions implements IShellFolder and IShellView
  1328. // interfaces.
  1329. //
  1330. //==========================================================================
  1331. //--------------------------------------------------------------------------
  1332. //
  1333. // Command/menuitem IDs
  1334. //
  1335. // The explorer dispatches WM_COMMAND messages based on the range of
  1336. // command/menuitem IDs. All the IDs of menuitems that the view (right
  1337. // pane) inserts must be in FCIDM_SHVIEWFIRST/LAST (otherwise, the explorer
  1338. // won't dispatch them). The view should not deal with any menuitems
  1339. // in FCIDM_BROWSERFIRST/LAST (otherwise, it won't work with the future
  1340. // version of the shell).
  1341. //
  1342. // FCIDM_SHVIEWFIRST/LAST for the right pane (IShellView)
  1343. // FCIDM_BROWSERFIRST/LAST for the explorer frame (IShellBrowser)
  1344. // FCIDM_GLOBAL/LAST for the explorer's submenu IDs
  1345. //
  1346. //--------------------------------------------------------------------------
  1347. #define FCIDM_SHVIEWFIRST 0x0000
  1348. #define FCIDM_SHVIEWLAST 0x7fff
  1349. #define FCIDM_BROWSERFIRST 0xa000
  1350. #define FCIDM_BROWSERLAST 0xbf00
  1351. #define FCIDM_GLOBALFIRST 0x8000
  1352. #define FCIDM_GLOBALLAST 0x9fff
  1353. //
  1354. // Global submenu IDs and separator IDs
  1355. //
  1356. #define FCIDM_MENU_FILE (FCIDM_GLOBALFIRST+0x0000)
  1357. #define FCIDM_MENU_EDIT (FCIDM_GLOBALFIRST+0x0040)
  1358. #define FCIDM_MENU_VIEW (FCIDM_GLOBALFIRST+0x0080)
  1359. #define FCIDM_MENU_VIEW_SEP_OPTIONS (FCIDM_GLOBALFIRST+0x0081)
  1360. #define FCIDM_MENU_TOOLS (FCIDM_GLOBALFIRST+0x00c0) // for Win9x compat
  1361. #define FCIDM_MENU_TOOLS_SEP_GOTO (FCIDM_GLOBALFIRST+0x00c1) // for Win9x compat
  1362. #define FCIDM_MENU_HELP (FCIDM_GLOBALFIRST+0x0100)
  1363. #define FCIDM_MENU_FIND (FCIDM_GLOBALFIRST+0x0140)
  1364. #define FCIDM_MENU_EXPLORE (FCIDM_GLOBALFIRST+0x0150)
  1365. #define FCIDM_MENU_FAVORITES (FCIDM_GLOBALFIRST+0x0170)
  1366. //--------------------------------------------------------------------------
  1367. // control IDs known to the view
  1368. //--------------------------------------------------------------------------
  1369. #define FCIDM_TOOLBAR (FCIDM_BROWSERFIRST + 0)
  1370. #define FCIDM_STATUS (FCIDM_BROWSERFIRST + 1)
  1371. #if (_WIN32_IE >= 0x0400)
  1372. //--------------------------------------------------------------------------
  1373. //
  1374. // The resource id of the offline cursor
  1375. // This cursor is avaialble in shdocvw.dll
  1376. #define IDC_OFFLINE_HAND 103
  1377. //
  1378. //--------------------------------------------------------------------------
  1379. #endif
  1380. // SBCMDID_GETPANE - not necessarily in order
  1381. #define PANE_NONE -1
  1382. #define PANE_ZONE 1
  1383. #define PANE_OFFLINE 2
  1384. #define PANE_PRINTER 3
  1385. #define PANE_SSL 4
  1386. #define PANE_NAVIGATION 5
  1387. #define PANE_PROGRESS 6
  1388. #define PANE_PRIVACY 7
  1389. //-------------------------------------------------------------------------
  1390. // ICommDlgBrowser interface
  1391. //
  1392. // ICommDlgBrowser interface is the interface that is provided by the new
  1393. // common dialog window to hook and modify the behavior of IShellView. When
  1394. // a default view is created, it queries its parent IShellBrowser for the
  1395. // ICommDlgBrowser interface. If supported, it calls out to that interface
  1396. // in several cases that need to behave differently in a dialog.
  1397. //
  1398. // Member functions:
  1399. //
  1400. // ICommDlgBrowser::OnDefaultCommand()
  1401. // Called when the user double-clicks in the view or presses Enter. The
  1402. // browser should return S_OK if it processed the action itself, S_FALSE
  1403. // to let the view perform the default action.
  1404. //
  1405. // ICommDlgBrowser::OnStateChange(ULONG uChange)
  1406. // Called when some states in the view change. 'uChange' is one of the
  1407. // CDBOSC_* values. This call is made after the state (selection, focus,
  1408. // etc) has changed. There is no return value.
  1409. //
  1410. // ICommDlgBrowser::IncludeObject(LPCITEMIDLIST pidl)
  1411. // Called when the view is enumerating objects. 'pidl' is a relative
  1412. // IDLIST. The browser should return S_OK to include the object in the
  1413. // view, S_FALSE to hide it
  1414. //
  1415. //-------------------------------------------------------------------------
  1416. #define CDBOSC_SETFOCUS 0x00000000
  1417. #define CDBOSC_KILLFOCUS 0x00000001
  1418. #define CDBOSC_SELCHANGE 0x00000002
  1419. #define CDBOSC_RENAME 0x00000003
  1420. #define CDBOSC_STATECHANGE 0x00000004
  1421. #undef INTERFACE
  1422. #define INTERFACE ICommDlgBrowser
  1423. DECLARE_INTERFACE_(ICommDlgBrowser, IUnknown)
  1424. {
  1425. // *** IUnknown methods ***
  1426. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1427. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1428. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1429. // *** ICommDlgBrowser methods ***
  1430. STDMETHOD(OnDefaultCommand) (THIS_ struct IShellView * ppshv) PURE;
  1431. STDMETHOD(OnStateChange) (THIS_ struct IShellView * ppshv,
  1432. ULONG uChange) PURE;
  1433. STDMETHOD(IncludeObject) (THIS_ struct IShellView * ppshv,
  1434. LPCITEMIDLIST pidl) PURE;
  1435. };
  1436. typedef ICommDlgBrowser * LPCOMMDLGBROWSER;
  1437. //-------------------------------------------------------------------------
  1438. // ICommDlgBrowser2 interface
  1439. //
  1440. // Member functions:
  1441. //
  1442. // ICommDlgBrowser2::Notify(IShellView *pshv, DWORD dwNotfyType)
  1443. // Called when the view is wants to notify common dialog when an event
  1444. // occurrs.
  1445. //
  1446. // CDB2N_CONTEXTMENU_START indicates the context menu has started.
  1447. // CDB2N_CONTEXTMENU_DONE indicates the context menu has completed.
  1448. //
  1449. // ICommDlgBrowser2::GetDefaultMenuText(IShellView *pshv,
  1450. // WCHAR *pszText, INT cchMax)
  1451. // Called when the view wants to get the default context menu text.
  1452. // pszText points to buffer and cchMax specifies the size of the
  1453. // buffer in characters. The browser on return has filled the buffer
  1454. // with the default context menu text. The Shell will call this method
  1455. // with at least a buffer size of MAX_PATH. The browser should return
  1456. // S_OK if it returned a new default menu text, S_FALSE to let the view
  1457. // to use the normal default menu text.
  1458. //
  1459. // ICommDlgBrowser2::GetViewFlags(DWORD *pdwFlags)
  1460. // Called when the view wants to determine if special customization needs to
  1461. // be done for the common dialog browser. For example View calls this function to
  1462. // determin if all files(hidden and system)needs to be shown. If the GetViewFlags returns a DWORD with
  1463. // CDB2GVF_SHOWALLFILES flag set then it will show all the files.
  1464. //-------------------------------------------------------------------------
  1465. #define CDB2N_CONTEXTMENU_DONE 0x00000001
  1466. #define CDB2N_CONTEXTMENU_START 0x00000002
  1467. //GetViewFlags
  1468. #define CDB2GVF_SHOWALLFILES 0x00000001
  1469. #undef INTERFACE
  1470. #define INTERFACE ICommDlgBrowser2
  1471. DECLARE_INTERFACE_(ICommDlgBrowser2, IUnknown)
  1472. {
  1473. // *** IUnknown methods ***
  1474. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1475. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1476. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1477. // *** ICommDlgBrowser methods ***
  1478. STDMETHOD(OnDefaultCommand) (THIS_ struct IShellView * ppshv) PURE;
  1479. STDMETHOD(OnStateChange) (THIS_ struct IShellView * ppshv,
  1480. ULONG uChange) PURE;
  1481. STDMETHOD(IncludeObject) (THIS_ struct IShellView * ppshv,
  1482. LPCITEMIDLIST pidl) PURE;
  1483. // *** ICommDlgBrowser2 methods ***
  1484. STDMETHOD(Notify) (THIS_ struct IShellView * ppshv,
  1485. DWORD dwNotifyType) PURE;
  1486. STDMETHOD(GetDefaultMenuText) (THIS_ struct IShellView * ppshv,
  1487. WCHAR *pszText, INT cchMax) PURE;
  1488. STDMETHOD(GetViewFlags)(THIS_ DWORD *pdwFlags) PURE;
  1489. };
  1490. typedef ICommDlgBrowser2 * LPCOMMDLGBROWSER2;
  1491. //
  1492. // function assumes the size of the buffer (MAX_PATH). The pidl
  1493. // should point to a file system object.
  1494. SHSTDAPI_(BOOL) SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath);
  1495. SHSTDAPI_(BOOL) SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath);
  1496. #ifdef UNICODE
  1497. #define SHGetPathFromIDList SHGetPathFromIDListW
  1498. #else
  1499. #define SHGetPathFromIDList SHGetPathFromIDListA
  1500. #endif // !UNICODE
  1501. SHSTDAPI_(int) SHCreateDirectory(HWND hwnd, LPCWSTR pszPath);
  1502. SHSTDAPI_(int) SHCreateDirectoryExA(HWND hwnd, LPCSTR pszPath, SECURITY_ATTRIBUTES *psa);
  1503. SHSTDAPI_(int) SHCreateDirectoryExW(HWND hwnd, LPCWSTR pszPath, SECURITY_ATTRIBUTES *psa);
  1504. #ifdef UNICODE
  1505. #define SHCreateDirectoryEx SHCreateDirectoryExW
  1506. #else
  1507. #define SHCreateDirectoryEx SHCreateDirectoryExA
  1508. #endif // !UNICODE
  1509. SHSTDAPI SHOpenFolderAndSelectItems(LPCITEMIDLIST pidlFolder, UINT cidl, LPCITEMIDLIST *apidl, DWORD dwFlags);
  1510. SHSTDAPI SHCreateShellItem(LPCITEMIDLIST pidlParent, IShellFolder *psfParent, LPCITEMIDLIST pidl, IShellItem **ppsi);
  1511. //-------------------------------------------------------------------------
  1512. //
  1513. // SHGetSpecialFolderLocation
  1514. //
  1515. // Caller should use SHGetMalloc to obtain an allocator that can free the pidl
  1516. //
  1517. //
  1518. //-------------------------------------------------------------------------
  1519. //
  1520. // registry entries for special paths are kept in :
  1521. #define REGSTR_PATH_SPECIAL_FOLDERS REGSTR_PATH_EXPLORER TEXT("\\Shell Folders")
  1522. #define CSIDL_DESKTOP 0x0000 // <desktop>
  1523. #define CSIDL_INTERNET 0x0001 // Internet Explorer (icon on desktop)
  1524. #define CSIDL_PROGRAMS 0x0002 // Start Menu\Programs
  1525. #define CSIDL_CONTROLS 0x0003 // My Computer\Control Panel
  1526. #define CSIDL_PRINTERS 0x0004 // My Computer\Printers
  1527. #define CSIDL_PERSONAL 0x0005 // My Documents
  1528. #define CSIDL_FAVORITES 0x0006 // <user name>\Favorites
  1529. #define CSIDL_STARTUP 0x0007 // Start Menu\Programs\Startup
  1530. #define CSIDL_RECENT 0x0008 // <user name>\Recent
  1531. #define CSIDL_SENDTO 0x0009 // <user name>\SendTo
  1532. #define CSIDL_BITBUCKET 0x000a // <desktop>\Recycle Bin
  1533. #define CSIDL_STARTMENU 0x000b // <user name>\Start Menu
  1534. #define CSIDL_MYDOCUMENTS 0x000c // logical "My Documents" desktop icon
  1535. #define CSIDL_MYMUSIC 0x000d // "My Music" folder
  1536. #define CSIDL_MYVIDEO 0x000e // "My Videos" folder
  1537. #define CSIDL_DESKTOPDIRECTORY 0x0010 // <user name>\Desktop
  1538. #define CSIDL_DRIVES 0x0011 // My Computer
  1539. #define CSIDL_NETWORK 0x0012 // Network Neighborhood (My Network Places)
  1540. #define CSIDL_NETHOOD 0x0013 // <user name>\nethood
  1541. #define CSIDL_FONTS 0x0014 // windows\fonts
  1542. #define CSIDL_TEMPLATES 0x0015
  1543. #define CSIDL_COMMON_STARTMENU 0x0016 // All Users\Start Menu
  1544. #define CSIDL_COMMON_PROGRAMS 0X0017 // All Users\Start Menu\Programs
  1545. #define CSIDL_COMMON_STARTUP 0x0018 // All Users\Startup
  1546. #define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019 // All Users\Desktop
  1547. #define CSIDL_APPDATA 0x001a // <user name>\Application Data
  1548. #define CSIDL_PRINTHOOD 0x001b // <user name>\PrintHood
  1549. #ifndef CSIDL_LOCAL_APPDATA
  1550. #define CSIDL_LOCAL_APPDATA 0x001c // <user name>\Local Settings\Applicaiton Data (non roaming)
  1551. #endif // CSIDL_LOCAL_APPDATA
  1552. #define CSIDL_ALTSTARTUP 0x001d // non localized startup
  1553. #define CSIDL_COMMON_ALTSTARTUP 0x001e // non localized common startup
  1554. #define CSIDL_COMMON_FAVORITES 0x001f
  1555. #ifndef _SHFOLDER_H_
  1556. #define CSIDL_INTERNET_CACHE 0x0020
  1557. #define CSIDL_COOKIES 0x0021
  1558. #define CSIDL_HISTORY 0x0022
  1559. #define CSIDL_COMMON_APPDATA 0x0023 // All Users\Application Data
  1560. #define CSIDL_WINDOWS 0x0024 // GetWindowsDirectory()
  1561. #define CSIDL_SYSTEM 0x0025 // GetSystemDirectory()
  1562. #define CSIDL_PROGRAM_FILES 0x0026 // C:\Program Files
  1563. #define CSIDL_MYPICTURES 0x0027 // C:\Program Files\My Pictures
  1564. #endif // _SHFOLDER_H_
  1565. #define CSIDL_PROFILE 0x0028 // USERPROFILE
  1566. #define CSIDL_SYSTEMX86 0x0029 // x86 system directory on RISC
  1567. #define CSIDL_PROGRAM_FILESX86 0x002a // x86 C:\Program Files on RISC
  1568. #ifndef _SHFOLDER_H_
  1569. #define CSIDL_PROGRAM_FILES_COMMON 0x002b // C:\Program Files\Common
  1570. #endif // _SHFOLDER_H_
  1571. #define CSIDL_PROGRAM_FILES_COMMONX86 0x002c // x86 Program Files\Common on RISC
  1572. #define CSIDL_COMMON_TEMPLATES 0x002d // All Users\Templates
  1573. #ifndef _SHFOLDER_H_
  1574. #define CSIDL_COMMON_DOCUMENTS 0x002e // All Users\Documents
  1575. #define CSIDL_COMMON_ADMINTOOLS 0x002f // All Users\Start Menu\Programs\Administrative Tools
  1576. #define CSIDL_ADMINTOOLS 0x0030 // <user name>\Start Menu\Programs\Administrative Tools
  1577. #endif // _SHFOLDER_H_
  1578. #define CSIDL_CONNECTIONS 0x0031 // Network and Dial-up Connections
  1579. #define CSIDL_COMMON_MUSIC 0x0035 // All Users\My Music
  1580. #define CSIDL_COMMON_PICTURES 0x0036 // All Users\My Pictures
  1581. #define CSIDL_COMMON_VIDEO 0x0037 // All Users\My Video
  1582. #define CSIDL_RESOURCES 0x0038 // Resource Direcotry
  1583. #ifndef _SHFOLDER_H_
  1584. #define CSIDL_RESOURCES_LOCALIZED 0x0039 // Localized Resource Direcotry
  1585. #endif // _SHFOLDER_H_
  1586. #define CSIDL_COMMON_OEM_LINKS 0x003a // Links to All Users OEM specific apps
  1587. #define CSIDL_CDBURN_AREA 0x003b // USERPROFILE\Local Settings\Application Data\Microsoft\CD Burning
  1588. // unused 0x003c
  1589. #define CSIDL_COMPUTERSNEARME 0x003d // Computers Near Me (computered from Workgroup membership)
  1590. #ifndef _SHFOLDER_H_
  1591. #define CSIDL_FLAG_CREATE 0x8000 // combine with CSIDL_ value to force folder creation in SHGetFolderPath()
  1592. #endif // _SHFOLDER_H_
  1593. #define CSIDL_FLAG_DONT_VERIFY 0x4000 // combine with CSIDL_ value to return an unverified folder path
  1594. #define CSIDL_FLAG_NO_ALIAS 0x1000 // combine with CSIDL_ value to insure non-alias versions of the pidl
  1595. #define CSIDL_FLAG_PER_USER_INIT 0x0800 // combine with CSIDL_ value to indicate per-user init (eg. upgrade)
  1596. #define CSIDL_FLAG_MASK 0xFF00 // mask for all possible flag values
  1597. SHSTDAPI SHGetSpecialFolderLocation(HWND hwnd, int csidl, LPITEMIDLIST *ppidl);
  1598. #if (_WIN32_IE >= 0x0400)
  1599. SHSTDAPI_(void) SHFlushSFCache(void);
  1600. SHSTDAPI_(LPITEMIDLIST) SHCloneSpecialIDList(HWND hwnd, int csidl, BOOL fCreate);
  1601. SHSTDAPI_(BOOL) SHGetSpecialFolderPathA(HWND hwnd, LPSTR pszPath, int csidl, BOOL fCreate);
  1602. SHSTDAPI_(BOOL) SHGetSpecialFolderPathW(HWND hwnd, LPWSTR pszPath, int csidl, BOOL fCreate);
  1603. #ifdef UNICODE
  1604. #define SHGetSpecialFolderPath SHGetSpecialFolderPathW
  1605. #else
  1606. #define SHGetSpecialFolderPath SHGetSpecialFolderPathA
  1607. #endif // !UNICODE
  1608. #if (_WIN32_IE >= 0x0500)
  1609. typedef enum {
  1610. SHGFP_TYPE_CURRENT = 0, // current value for user, verify it exists
  1611. SHGFP_TYPE_DEFAULT = 1, // default value, may not exist
  1612. } SHGFP_TYPE;
  1613. SHFOLDERAPI SHGetFolderPathA(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPSTR pszPath);
  1614. SHFOLDERAPI SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath);
  1615. #ifdef UNICODE
  1616. #define SHGetFolderPath SHGetFolderPathW
  1617. #else
  1618. #define SHGetFolderPath SHGetFolderPathA
  1619. #endif // !UNICODE
  1620. SHSTDAPI SHGetFolderLocation(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPITEMIDLIST *ppidl);
  1621. SHFOLDERAPI SHGetFolderPathAndSubDirA(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPCSTR pszSubDir, LPSTR pszPath);
  1622. SHFOLDERAPI SHGetFolderPathAndSubDirW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPCWSTR pszSubDir, LPWSTR pszPath);
  1623. #ifdef UNICODE
  1624. #define SHGetFolderPathAndSubDir SHGetFolderPathAndSubDirW
  1625. #else
  1626. #define SHGetFolderPathAndSubDir SHGetFolderPathAndSubDirA
  1627. #endif // !UNICODE
  1628. #endif // _WIN32_IE >= 0x0500
  1629. #endif // _WIN32_IE >= 0x0400
  1630. #if (_WIN32_IE >= 0x0500)
  1631. #define FCS_READ 0x00000001
  1632. #define FCS_FORCEWRITE 0x00000002
  1633. #define FCS_WRITE (FCS_READ | FCS_FORCEWRITE)
  1634. #define FCS_FLAG_DRAGDROP 2
  1635. // Mask which values have been retreived or being set.
  1636. #define FCSM_VIEWID 0x00000001
  1637. #define FCSM_WEBVIEWTEMPLATE 0x00000002
  1638. #define FCSM_INFOTIP 0x00000004
  1639. #define FCSM_CLSID 0x00000008
  1640. #define FCSM_ICONFILE 0x00000010
  1641. #define FCSM_LOGO 0x00000020
  1642. #define FCSM_FLAGS 0x00000040
  1643. #include <pshpack8.h>
  1644. // Used by SHGetSetFolderCustomSettingsA
  1645. typedef struct
  1646. {
  1647. DWORD dwSize;
  1648. DWORD dwMask; // IN/OUT Which Attributes to Get/Set
  1649. SHELLVIEWID* pvid; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1650. // The folder's WebView template path
  1651. LPSTR pszWebViewTemplate; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1652. DWORD cchWebViewTemplate; // IN - Specifies the size of the buffer pointed to by pszWebViewTemplate
  1653. // Ignored if dwReadWrite is FCS_READ
  1654. LPSTR pszWebViewTemplateVersion; // currently IN only
  1655. // Infotip for the folder
  1656. LPSTR pszInfoTip; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1657. DWORD cchInfoTip; // IN - Specifies the size of the buffer pointed to by pszInfoTip
  1658. // Ignored if dwReadWrite is FCS_READ
  1659. // CLSID that points to more info in the registry
  1660. CLSID* pclsid; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1661. // Other flags for the folder. Takes FCS_FLAG_* values
  1662. DWORD dwFlags; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1663. LPSTR pszIconFile; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1664. DWORD cchIconFile; // IN - Specifies the size of the buffer pointed to by pszIconFile
  1665. // Ignored if dwReadWrite is FCS_READ
  1666. int iIconIndex; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1667. LPSTR pszLogo; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1668. DWORD cchLogo; // IN - Specifies the size of the buffer pointed to by pszIconFile
  1669. // Ignored if dwReadWrite is FCS_READ
  1670. } SHFOLDERCUSTOMSETTINGSA, *LPSHFOLDERCUSTOMSETTINGSA;
  1671. // Used by SHGetSetFolderCustomSettingsW
  1672. typedef struct
  1673. {
  1674. DWORD dwSize;
  1675. DWORD dwMask; // IN/OUT Which Attributes to Get/Set
  1676. SHELLVIEWID* pvid; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1677. // The folder's WebView template path
  1678. LPWSTR pszWebViewTemplate; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1679. DWORD cchWebViewTemplate; // IN - Specifies the size of the buffer pointed to by pszWebViewTemplate
  1680. // Ignored if dwReadWrite is FCS_READ
  1681. LPWSTR pszWebViewTemplateVersion; // currently IN only
  1682. // Infotip for the folder
  1683. LPWSTR pszInfoTip; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1684. DWORD cchInfoTip; // IN - Specifies the size of the buffer pointed to by pszInfoTip
  1685. // Ignored if dwReadWrite is FCS_READ
  1686. // CLSID that points to more info in the registry
  1687. CLSID* pclsid; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1688. // Other flags for the folder. Takes FCS_FLAG_* values
  1689. DWORD dwFlags; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1690. LPWSTR pszIconFile; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1691. DWORD cchIconFile; // IN - Specifies the size of the buffer pointed to by pszIconFile
  1692. // Ignored if dwReadWrite is FCS_READ
  1693. int iIconIndex; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1694. LPWSTR pszLogo; // OUT - if dwReadWrite is FCS_READ, IN - otherwise
  1695. DWORD cchLogo; // IN - Specifies the size of the buffer pointed to by pszIconFile
  1696. // Ignored if dwReadWrite is FCS_READ
  1697. } SHFOLDERCUSTOMSETTINGSW, *LPSHFOLDERCUSTOMSETTINGSW;
  1698. #include <poppack.h> /* Return to byte packing */
  1699. // Gets/Sets the Folder Custom Settings for pszPath based on dwReadWrite. dwReadWrite can be FCS_READ/FCS_WRITE/FCS_FORCEWRITE
  1700. SHSTDAPI SHGetSetFolderCustomSettingsA(LPSHFOLDERCUSTOMSETTINGSA pfcs, LPCSTR pszPath, DWORD dwReadWrite);
  1701. SHSTDAPI SHGetSetFolderCustomSettingsW(LPSHFOLDERCUSTOMSETTINGSW pfcs, LPCWSTR pszPath, DWORD dwReadWrite);
  1702. #ifdef UNICODE
  1703. #define SHFOLDERCUSTOMSETTINGS SHFOLDERCUSTOMSETTINGSW
  1704. #define SHGetSetFolderCustomSettings SHGetSetFolderCustomSettingsW
  1705. #define LPSHFOLDERCUSTOMSETTINGS LPSHFOLDERCUSTOMSETTINGSW
  1706. #else
  1707. #define SHFOLDERCUSTOMSETTINGS SHFOLDERCUSTOMSETTINGSA
  1708. #define SHGetSetFolderCustomSettings SHGetSetFolderCustomSettingsA
  1709. #define LPSHFOLDERCUSTOMSETTINGS LPSHFOLDERCUSTOMSETTINGSA
  1710. #endif
  1711. #endif // _WIN32_IE >= 0x0500
  1712. //-------------------------------------------------------------------------
  1713. //
  1714. // SHBrowseForFolder API
  1715. //
  1716. //
  1717. //-------------------------------------------------------------------------
  1718. typedef int (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
  1719. #include <pshpack8.h>
  1720. typedef struct _browseinfoA {
  1721. HWND hwndOwner;
  1722. LPCITEMIDLIST pidlRoot;
  1723. LPSTR pszDisplayName; // Return display name of item selected.
  1724. LPCSTR lpszTitle; // text to go in the banner over the tree.
  1725. UINT ulFlags; // Flags that control the return stuff
  1726. BFFCALLBACK lpfn;
  1727. LPARAM lParam; // extra info that's passed back in callbacks
  1728. int iImage; // output var: where to return the Image index.
  1729. } BROWSEINFOA, *PBROWSEINFOA, *LPBROWSEINFOA;
  1730. typedef struct _browseinfoW {
  1731. HWND hwndOwner;
  1732. LPCITEMIDLIST pidlRoot;
  1733. LPWSTR pszDisplayName; // Return display name of item selected.
  1734. LPCWSTR lpszTitle; // text to go in the banner over the tree.
  1735. UINT ulFlags; // Flags that control the return stuff
  1736. BFFCALLBACK lpfn;
  1737. LPARAM lParam; // extra info that's passed back in callbacks
  1738. int iImage; // output var: where to return the Image index.
  1739. } BROWSEINFOW, *PBROWSEINFOW, *LPBROWSEINFOW;
  1740. #include <poppack.h> /* Return to byte packing */
  1741. #ifdef UNICODE
  1742. #define BROWSEINFO BROWSEINFOW
  1743. #define PBROWSEINFO PBROWSEINFOW
  1744. #define LPBROWSEINFO LPBROWSEINFOW
  1745. #else
  1746. #define BROWSEINFO BROWSEINFOA
  1747. #define PBROWSEINFO PBROWSEINFOA
  1748. #define LPBROWSEINFO LPBROWSEINFOA
  1749. #endif
  1750. // Browsing for directory.
  1751. #define BIF_RETURNONLYFSDIRS 0x0001 // For finding a folder to start document searching
  1752. #define BIF_DONTGOBELOWDOMAIN 0x0002 // For starting the Find Computer
  1753. #define BIF_STATUSTEXT 0x0004 // Top of the dialog has 2 lines of text for BROWSEINFO.lpszTitle and one line if
  1754. // this flag is set. Passing the message BFFM_SETSTATUSTEXTA to the hwnd can set the
  1755. // rest of the text. This is not used with BIF_USENEWUI and BROWSEINFO.lpszTitle gets
  1756. // all three lines of text.
  1757. #define BIF_RETURNFSANCESTORS 0x0008
  1758. #define BIF_EDITBOX 0x0010 // Add an editbox to the dialog
  1759. #define BIF_VALIDATE 0x0020 // insist on valid result (or CANCEL)
  1760. #define BIF_NEWDIALOGSTYLE 0x0040 // Use the new dialog layout with the ability to resize
  1761. // Caller needs to call OleInitialize() before using this API
  1762. #define BIF_USENEWUI (BIF_NEWDIALOGSTYLE | BIF_EDITBOX)
  1763. #define BIF_BROWSEINCLUDEURLS 0x0080 // Allow URLs to be displayed or entered. (Requires BIF_USENEWUI)
  1764. #define BIF_UAHINT 0x0100 // Add a UA hint to the dialog, in place of the edit box. May not be combined with BIF_EDITBOX
  1765. #define BIF_NONEWFOLDERBUTTON 0x0200 // Do not add the "New Folder" button to the dialog. Only applicable with BIF_NEWDIALOGSTYLE.
  1766. #define BIF_NOTRANSLATETARGETS 0x0400 // don't traverse target as shortcut
  1767. #define BIF_BROWSEFORCOMPUTER 0x1000 // Browsing for Computers.
  1768. #define BIF_BROWSEFORPRINTER 0x2000 // Browsing for Printers
  1769. #define BIF_BROWSEINCLUDEFILES 0x4000 // Browsing for Everything
  1770. #define BIF_SHAREABLE 0x8000 // sharable resources displayed (remote shares, requires BIF_USENEWUI)
  1771. // message from browser
  1772. #define BFFM_INITIALIZED 1
  1773. #define BFFM_SELCHANGED 2
  1774. #define BFFM_VALIDATEFAILEDA 3 // lParam:szPath ret:1(cont),0(EndDialog)
  1775. #define BFFM_VALIDATEFAILEDW 4 // lParam:wzPath ret:1(cont),0(EndDialog)
  1776. #define BFFM_IUNKNOWN 5 // provides IUnknown to client. lParam: IUnknown*
  1777. // messages to browser
  1778. #define BFFM_SETSTATUSTEXTA (WM_USER + 100)
  1779. #define BFFM_ENABLEOK (WM_USER + 101)
  1780. #define BFFM_SETSELECTIONA (WM_USER + 102)
  1781. #define BFFM_SETSELECTIONW (WM_USER + 103)
  1782. #define BFFM_SETSTATUSTEXTW (WM_USER + 104)
  1783. #define BFFM_SETOKTEXT (WM_USER + 105) // Unicode only
  1784. #define BFFM_SETEXPANDED (WM_USER + 106) // Unicode only
  1785. SHSTDAPI_(LPITEMIDLIST) SHBrowseForFolderA(LPBROWSEINFOA lpbi);
  1786. SHSTDAPI_(LPITEMIDLIST) SHBrowseForFolderW(LPBROWSEINFOW lpbi);
  1787. #ifdef UNICODE
  1788. #define SHBrowseForFolder SHBrowseForFolderW
  1789. #define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTW
  1790. #define BFFM_SETSELECTION BFFM_SETSELECTIONW
  1791. #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
  1792. #else
  1793. #define SHBrowseForFolder SHBrowseForFolderA
  1794. #define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTA
  1795. #define BFFM_SETSELECTION BFFM_SETSELECTIONA
  1796. #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA
  1797. #endif
  1798. //-------------------------------------------------------------------------
  1799. //
  1800. // SHLoadInProc
  1801. //
  1802. // When this function is called, the shell calls CoCreateInstance
  1803. // (or equivalent) with CLSCTX_INPROC_SERVER and the specified CLSID
  1804. // from within the shell's process and release it immediately.
  1805. //
  1806. //-------------------------------------------------------------------------
  1807. SHSTDAPI SHLoadInProc(REFCLSID rclsid);
  1808. #if _WIN32_IE >= 0x0600
  1809. //-------------------------------------------------------------------------
  1810. //
  1811. // SHEnableServiceObject
  1812. //
  1813. // Like SHLoadInProc, but gives control over the object's lifetime
  1814. // via fEnable parameter. TRUE tells the shell to create the object
  1815. // and hold onto it, FALSE tells the shell to look for the previously
  1816. // created instance of the object and release it.
  1817. //
  1818. //-------------------------------------------------------------------------
  1819. SHSTDAPI SHEnableServiceObject(REFCLSID rclsid, BOOL fEnable);
  1820. #endif
  1821. //-------------------------------------------------------------------------
  1822. //
  1823. // Internet Shortcut Object
  1824. //
  1825. //-------------------------------------------------------------------------
  1826. // Cmds for CGID_ShortCut
  1827. enum {
  1828. ISHCUTCMDID_DOWNLOADICON = 0,
  1829. ISHCUTCMDID_INTSHORTCUTCREATE = 1,
  1830. };
  1831. #define CMDID_INTSHORTCUTCREATE ISHCUTCMDID_INTSHORTCUTCREATE
  1832. //
  1833. // Helper function which returns a IShellFolder interface to the desktop
  1834. // folder. This is equivalent to call CoCreateInstance with CLSID_ShellDesktop.
  1835. //
  1836. // CoCreateInstance(CLSID_Desktop, NULL,
  1837. // CLSCTX_INPROC, IID_IShellFolder, &pshf);
  1838. //
  1839. SHSTDAPI SHGetDesktopFolder(IShellFolder **ppshf);
  1840. // IShellFolder IBindCtx* parameters. the IUnknown for these are
  1841. // accessed through IBindCtx::RegisterObjectParam/GetObjectParam
  1842. // use this to provide the data needed create IDLists through
  1843. // IShellFolder::ParseDisplayName(). this data applies to the last element
  1844. // of the name that is parsed (c:\foo\bar.txt, data applies to bar.txt)
  1845. // this makes creating these IDLists much faster that suppling the name only
  1846. #define STR_FILE_SYS_BIND_DATA L"File System Bind Data"
  1847. #undef INTERFACE
  1848. #define INTERFACE IFileSystemBindData
  1849. DECLARE_INTERFACE_(IFileSystemBindData, IUnknown)
  1850. {
  1851. // *** IUnknown methods ***
  1852. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1853. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1854. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1855. // *** IFileSystemBindData methods ***
  1856. STDMETHOD(SetFindData)(THIS_ const WIN32_FIND_DATAW *pfd) PURE;
  1857. STDMETHOD(GetFindData)(THIS_ WIN32_FIND_DATAW *pfd) PURE;
  1858. };
  1859. #undef INTERFACE
  1860. #define INTERFACE IShellDetails
  1861. DECLARE_INTERFACE_(IShellDetails, IUnknown)
  1862. {
  1863. // *** IUnknown methods ***
  1864. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1865. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1866. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1867. // *** IShellDetails methods ***
  1868. STDMETHOD(GetDetailsOf)(THIS_ LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS *pDetails) PURE;
  1869. STDMETHOD(ColumnClick)(THIS_ UINT iColumn) PURE;
  1870. };
  1871. //-------------------------------------------------------------------------
  1872. //
  1873. // IObjMgr interface
  1874. //
  1875. //
  1876. // [Member functions]
  1877. //
  1878. // IObjMgr::Append(punk)
  1879. // This function adds an object to the end of a list of objects.
  1880. //
  1881. // IObjMgr::Remove(punk)
  1882. // This function removes an object from a list of objects.
  1883. //
  1884. // This is implemented by CLSID_ACLMulti so each AutoComplete List
  1885. // (CLSID_ACLHistory, CLSID_ACListISF, CLSID_ACLMRU) can be added.
  1886. // CLSID_ACLMulti's IEnumString will then be the union of the results
  1887. // from the COM Objects added.
  1888. //-------------------------------------------------------------------------
  1889. #undef INTERFACE
  1890. #define INTERFACE IObjMgr
  1891. DECLARE_INTERFACE_(IObjMgr, IUnknown)
  1892. {
  1893. // *** IUnknown methods ***
  1894. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1895. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1896. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1897. // *** IObjMgr specific methods ***
  1898. STDMETHOD(Append) (THIS_ IUnknown *punk) PURE;
  1899. STDMETHOD(Remove) (THIS_ IUnknown *punk) PURE;
  1900. };
  1901. //-------------------------------------------------------------------------
  1902. //
  1903. // ICurrentWorkingDirectory interface
  1904. //
  1905. //
  1906. // [Member functions]
  1907. //
  1908. // ICurrentWorkingDirectory::GetDirectory(LPWSTR pwzPath, DWORD cchSize)
  1909. // This function gets the Current Working Directory from a COM object that
  1910. // stores such state.
  1911. //
  1912. // ICurrentWorkingDirectory::SetDirectory(LPCWSTR pwzPath)
  1913. // This function sets the Current Working Directory of a COM object that
  1914. // stores such state.
  1915. //
  1916. // This function can be used generically. One COM object that implements it
  1917. // is CLSID_ACListISF so that the AutoComplete engine can complete relative
  1918. // paths. SetDirectory() will set the "Current Working Directory" and
  1919. // AutoComplete with then complete both absolute and relative paths.
  1920. // For Example, if ::SetDirectory(L"C:\Program Files") is called, then
  1921. // the user can AutoComplete "..\winnt". In order to set the current
  1922. // working directory for non-file system paths, "ftp://ftp.microsoft.com/" or
  1923. // "Control Panel" for example, use IPersistFolder.
  1924. //-------------------------------------------------------------------------
  1925. #undef INTERFACE
  1926. #define INTERFACE ICurrentWorkingDirectory
  1927. DECLARE_INTERFACE_(ICurrentWorkingDirectory, IUnknown)
  1928. {
  1929. // *** IUnknown methods ***
  1930. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1931. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1932. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1933. // *** ICurrentWorkingDirectory specific methods ***
  1934. STDMETHOD(GetDirectory) (THIS_ LPWSTR pwzPath, DWORD cchSize) PURE;
  1935. STDMETHOD(SetDirectory) (THIS_ LPCWSTR pwzPath) PURE;
  1936. };
  1937. //-------------------------------------------------------------------------
  1938. //
  1939. // IACList interface
  1940. //
  1941. //
  1942. // [Member functions]
  1943. //
  1944. // IObjMgr::Expand(LPCOLESTR)
  1945. // This function tells an autocomplete list to expand a specific string.
  1946. //
  1947. // If the user enters a multi-level path, AutoComplete (CLSID_AutoComplete)
  1948. // will use this interface to tell the "AutoComplete Lists" where to expand
  1949. // the results.
  1950. //
  1951. // For Example, if the user enters "C:\Program Files\Micros", AutoComplete
  1952. // first completely enumerate the "AutoComplete Lists" via IEnumString. Then it
  1953. // will call the "AutoComplete Lists" with IACList::Expand(L"C:\Program Files").
  1954. // It will then enumerate the IEnumString interface again to get results in
  1955. // that directory.
  1956. //-------------------------------------------------------------------------
  1957. #undef INTERFACE
  1958. #define INTERFACE IACList
  1959. DECLARE_INTERFACE_(IACList, IUnknown)
  1960. {
  1961. // *** IUnknown methods ***
  1962. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1963. STDMETHOD_(ULONG, AddRef) (THIS) PURE;
  1964. STDMETHOD_(ULONG, Release) (THIS) PURE;
  1965. // *** IACList specific methods ***
  1966. STDMETHOD(Expand) (THIS_ LPCOLESTR pszExpand) PURE;
  1967. };
  1968. //-------------------------------------------------------------------------
  1969. //
  1970. // IACList2 interface
  1971. //
  1972. // [Description]
  1973. // This interface exists to allow the caller to set filter criteria
  1974. // for an AutoComplete List. AutoComplete Lists generates the list of
  1975. // possible AutoComplete completions. CLSID_ACListISF is one AutoComplete
  1976. // List COM object that implements this interface.
  1977. //-------------------------------------------------------------------------
  1978. #undef INTERFACE
  1979. #define INTERFACE IACList2
  1980. typedef enum _tagAUTOCOMPLETELISTOPTIONS
  1981. {
  1982. ACLO_NONE = 0, // don't enumerate anything
  1983. ACLO_CURRENTDIR = 1, // enumerate current directory
  1984. ACLO_MYCOMPUTER = 2, // enumerate MyComputer
  1985. ACLO_DESKTOP = 4, // enumerate Desktop Folder
  1986. ACLO_FAVORITES = 8, // enumerate Favorites Folder
  1987. ACLO_FILESYSONLY = 16, // enumerate only the file system
  1988. ACLO_FILESYSDIRS = 32, // enumerate only the file system dirs, UNC shares, and UNC servers.
  1989. } AUTOCOMPLETELISTOPTIONS;
  1990. DECLARE_INTERFACE_(IACList2, IACList)
  1991. {
  1992. // *** IACList2 specific methods ***
  1993. STDMETHOD(SetOptions)(THIS_ DWORD dwFlag) PURE;
  1994. STDMETHOD(GetOptions)(THIS_ DWORD* pdwFlag) PURE;
  1995. };
  1996. /*-------------------------------------------------------------------------*\
  1997. INTERFACE: IProgressDialog
  1998. DESCRIPTION:
  1999. CLSID_ProgressDialog/IProgressDialog exist to allow a caller to create
  2000. a progress dialog, set it's title, animation, text lines, progress, and
  2001. it will do all the work of updating on a background thread, being modless,
  2002. handling the user cancelling the operation, and estimating the time remaining
  2003. until the operation completes.
  2004. USAGE:
  2005. This is how the dialog is used during operations that require progress
  2006. and the ability to cancel:
  2007. {
  2008. DWORD dwComplete, dwTotal;
  2009. IProgressDialog * ppd;
  2010. CoCreateInstance(CLSID_ProgressDialog, NULL, CLSCTX_INPROC_SERVER, IID_IProgressDialog, (void **)&ppd);
  2011. ppd->SetTitle(L"My Slow Operation"); // Set the title of the dialog.
  2012. ppd->SetAnimation(hInstApp, IDA_OPERATION_ANIMATION); // Set the animation to play.
  2013. ppd->StartProgressDialog(hwndParent, punk, PROGDLG_AUTOTIME, NULL); // Display and enable automatic estimated time remaining.
  2014. ppd->SetCancelMsg(L"Please wait while the current operation is cleaned up", NULL); // Will only be displayed if Cancel button is pressed.
  2015. dwComplete = 0;
  2016. dwTotal = CalcTotalUnitsToDo();
  2017. // Reset because CalcTotalUnitsToDo() took a long time and the estimated time
  2018. // is based on the time between ::StartProgressDialog() and the first
  2019. // ::SetProgress() call.
  2020. ppd->Timer(PDTIMER_RESET, NULL);
  2021. for (nIndex = 0; nIndex < nTotal; nIndex++)
  2022. {
  2023. if (TRUE == ppd->HasUserCancelled())
  2024. break;
  2025. ppd->SetLine(2, L"I'm processing item n", FALSE, NULL);
  2026. dwComplete += DoSlowOperation();
  2027. ppd->SetProgress(dwCompleted, dwTotal);
  2028. }
  2029. ppd->StopProgressDialog();
  2030. ppd->Release();
  2031. }
  2032. \*-------------------------------------------------------------------------*/
  2033. // Flags for IProgressDialog::StartProgressDialog() (dwFlags)
  2034. #define PROGDLG_NORMAL 0x00000000 // default normal progress dlg behavior
  2035. #define PROGDLG_MODAL 0x00000001 // the dialog is modal to its hwndParent (default is modeless)
  2036. #define PROGDLG_AUTOTIME 0x00000002 // automatically updates the "Line3" text with the "time remaining" (you cant call SetLine3 if you passs this!)
  2037. #define PROGDLG_NOTIME 0x00000004 // we dont show the "time remaining" if this is set. We need this if dwTotal < dwCompleted for sparse files
  2038. #define PROGDLG_NOMINIMIZE 0x00000008 // Do not have a minimize button in the caption bar.
  2039. #define PROGDLG_NOPROGRESSBAR 0x00000010 // Don't display the progress bar
  2040. // Time Actions (dwTimerAction)
  2041. #define PDTIMER_RESET 0x00000001 // Reset the timer so the progress will be calculated from now until the first ::SetProgress() is called so
  2042. // those this time will correspond to the values passed to ::SetProgress(). Only do this before ::SetProgress() is called.
  2043. #undef INTERFACE
  2044. #define INTERFACE IProgressDialog
  2045. DECLARE_INTERFACE_(IProgressDialog, IUnknown)
  2046. {
  2047. // *** IUnknown methods ***
  2048. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2049. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2050. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2051. // *** IProgressDialog specific methods
  2052. STDMETHOD(StartProgressDialog)(THIS_ HWND hwndParent, IUnknown * punkEnableModless, DWORD dwFlags, LPCVOID pvResevered) PURE;
  2053. STDMETHOD(StopProgressDialog)(THIS) PURE;
  2054. STDMETHOD(SetTitle)(THIS_ LPCWSTR pwzTitle) PURE;
  2055. STDMETHOD(SetAnimation)(THIS_ HINSTANCE hInstAnimation, UINT idAnimation) PURE;
  2056. STDMETHOD_(BOOL,HasUserCancelled) (THIS) PURE;
  2057. STDMETHOD(SetProgress)(THIS_ DWORD dwCompleted, DWORD dwTotal) PURE;
  2058. STDMETHOD(SetProgress64)(THIS_ ULONGLONG ullCompleted, ULONGLONG ullTotal) PURE;
  2059. STDMETHOD(SetLine)(THIS_ DWORD dwLineNum, LPCWSTR pwzString, BOOL fCompactPath, LPCVOID pvResevered) PURE;
  2060. STDMETHOD(SetCancelMsg)(THIS_ LPCWSTR pwzCancelMsg, LPCVOID pvResevered) PURE;
  2061. STDMETHOD(Timer)(THIS_ DWORD dwTimerAction, LPCVOID pvResevered) PURE;
  2062. };
  2063. //==========================================================================
  2064. // IInputObjectSite/IInputObject interfaces
  2065. //
  2066. // These interfaces allow us (or ISVs) to install/update external Internet
  2067. // Toolbar for IE and the shell. The frame will simply get the CLSID from
  2068. // registry (to be defined) and CoCreateInstance it.
  2069. //
  2070. //==========================================================================
  2071. //-------------------------------------------------------------------------
  2072. //
  2073. // IInputObjectSite interface
  2074. //
  2075. // A site implements this interface so the object can communicate
  2076. // focus change to it.
  2077. //
  2078. // [Member functions]
  2079. //
  2080. // IInputObjectSite::OnFocusChangeIS(punkObj, fSetFocus)
  2081. // Object (punkObj) is getting or losing the focus.
  2082. //
  2083. //-------------------------------------------------------------------------
  2084. #undef INTERFACE
  2085. #define INTERFACE IInputObjectSite
  2086. DECLARE_INTERFACE_(IInputObjectSite, IUnknown)
  2087. {
  2088. // *** IUnknown methods ***
  2089. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2090. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2091. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2092. // *** IInputObjectSite specific methods ***
  2093. STDMETHOD(OnFocusChangeIS)(THIS_ IUnknown* punkObj, BOOL fSetFocus) PURE;
  2094. };
  2095. //-------------------------------------------------------------------------
  2096. //
  2097. // IInputObject interface
  2098. //
  2099. // An object implements this interface so the site can communicate
  2100. // activation and accelerator events to it.
  2101. //
  2102. // [Member functions]
  2103. //
  2104. // IInputObject::UIActivateIO(fActivate, lpMsg)
  2105. // Activates or deactivates the object. lpMsg may be NULL. Returns
  2106. // S_OK if the activation succeeded.
  2107. //
  2108. // IInputObject::HasFocusIO()
  2109. // Returns S_OK if the object has the focus, S_FALSE if not.
  2110. //
  2111. // IInputObject::TranslateAcceleratorIO(lpMsg)
  2112. // Allow the object to process the message. Returns S_OK if the
  2113. // message was processed (eaten).
  2114. //
  2115. //-------------------------------------------------------------------------
  2116. #undef INTERFACE
  2117. #define INTERFACE IInputObject
  2118. DECLARE_INTERFACE_(IInputObject, IUnknown)
  2119. {
  2120. // *** IUnknown methods ***
  2121. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2122. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2123. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2124. // *** IInputObject specific methods ***
  2125. STDMETHOD(UIActivateIO)(THIS_ BOOL fActivate, LPMSG lpMsg) PURE;
  2126. STDMETHOD(HasFocusIO)(THIS) PURE;
  2127. STDMETHOD(TranslateAcceleratorIO)(THIS_ LPMSG lpMsg) PURE;
  2128. };
  2129. //==========================================================================
  2130. // IDockingWindowSite/IDockingWindow/IDockingWindowFrame interfaces
  2131. // IInputObjectSite/IInputObject interfaces
  2132. //
  2133. // These interfaces allow us (or ISVs) to install/update external Internet
  2134. // Toolbar for IE and the shell. The frame will simply get the CLSID from
  2135. // registry (to be defined) and CoCreateInstance it.
  2136. //
  2137. //==========================================================================
  2138. //-------------------------------------------------------------------------
  2139. //
  2140. // IDockingWindowSite interface
  2141. //
  2142. // A site implements this interface so the object can negotiate for
  2143. // and inquire about real estate on the site.
  2144. //
  2145. // [Member functions]
  2146. //
  2147. // IDockingWindowSite::GetBorderDW(punkObj, prcBorder)
  2148. // Site returns the bounding rectangle of the given source object
  2149. // (punkObj).
  2150. //
  2151. // IDockingWindowSite::RequestBorderSpaceDW(punkObj, pbw)
  2152. // Object requests that the site makes room for it, as specified in
  2153. // *pbw.
  2154. //
  2155. // IDockingWindowSite::SetBorderSpaceDW(punkObj, pbw)
  2156. // Object requests that the site set the border spacing to the size
  2157. // specified in *pbw.
  2158. //
  2159. //-------------------------------------------------------------------------
  2160. #undef INTERFACE
  2161. #define INTERFACE IDockingWindowSite
  2162. DECLARE_INTERFACE_(IDockingWindowSite, IOleWindow)
  2163. {
  2164. // *** IUnknown methods ***
  2165. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2166. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2167. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2168. // *** IOleWindow methods ***
  2169. STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2170. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2171. // *** IDockingWindowSite methods ***
  2172. STDMETHOD(GetBorderDW) (THIS_ IUnknown* punkObj, LPRECT prcBorder) PURE;
  2173. STDMETHOD(RequestBorderSpaceDW) (THIS_ IUnknown* punkObj, LPCBORDERWIDTHS pbw) PURE;
  2174. STDMETHOD(SetBorderSpaceDW) (THIS_ IUnknown* punkObj, LPCBORDERWIDTHS pbw) PURE;
  2175. };
  2176. //-------------------------------------------------------------------------
  2177. //
  2178. // IDockingWindowFrame interface
  2179. //
  2180. // [Member functions]
  2181. //
  2182. // IDockingWindowFrame::AddToolbar(punkSrc, pwszItem, dwReserved)
  2183. //
  2184. // IDockingWindowFrame::RemoveToolbar(punkSrc, dwRemoveFlags)
  2185. //
  2186. // IDockingWindowFrame::FindToolbar(pwszItem, riid, ppv)
  2187. //
  2188. //-------------------------------------------------------------------------
  2189. // flags for RemoveToolbar
  2190. #define DWFRF_NORMAL 0x0000
  2191. #define DWFRF_DELETECONFIGDATA 0x0001
  2192. // flags for AddToolbar
  2193. #define DWFAF_HIDDEN 0x0001 // add hidden
  2194. #undef INTERFACE
  2195. #define INTERFACE IDockingWindowFrame
  2196. DECLARE_INTERFACE_(IDockingWindowFrame, IOleWindow)
  2197. {
  2198. // *** IUnknown methods ***
  2199. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2200. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2201. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2202. // *** IOleWindow methods ***
  2203. STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2204. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2205. // *** IDockingWindowFrame methods ***
  2206. STDMETHOD(AddToolbar) (THIS_ IUnknown* punkSrc, LPCWSTR pwszItem, DWORD dwAddFlags) PURE;
  2207. STDMETHOD(RemoveToolbar) (THIS_ IUnknown* punkSrc, DWORD dwRemoveFlags) PURE;
  2208. STDMETHOD(FindToolbar) (THIS_ LPCWSTR pwszItem, REFIID riid, void **ppv) PURE;
  2209. };
  2210. #if (_WIN32_IE >= 0x0400)
  2211. //-------------------------------------------------------------------------
  2212. //
  2213. // IRunnableTask interface
  2214. //
  2215. // This is a free threaded interface used for putting items on a background
  2216. // scheduler for execution within the view. It allows a scheduler to start and
  2217. // stop tasks on as many worker threads as it deems necessary.
  2218. //
  2219. // Run(), Kill() and Suspend() may be called from different threads.
  2220. //
  2221. // [Member functions]
  2222. //
  2223. // IRunnableTask::Run(void)
  2224. // Initiate the task to run. This should return E_PENDING if the task
  2225. // has been suspended.
  2226. //
  2227. // IRunnableTask::Kill(void)
  2228. //
  2229. // IRunnableTask::Suspend(void)
  2230. //
  2231. // IRunnableTask::Resume(void)
  2232. //
  2233. // IRunnableTask::IsRunning(void)
  2234. //
  2235. //-------------------------------------------------------------------------
  2236. // Convenient state values
  2237. #define IRTIR_TASK_NOT_RUNNING 0
  2238. #define IRTIR_TASK_RUNNING 1
  2239. #define IRTIR_TASK_SUSPENDED 2
  2240. #define IRTIR_TASK_PENDING 3
  2241. #define IRTIR_TASK_FINISHED 4
  2242. #undef INTERFACE
  2243. #define INTERFACE IRunnableTask
  2244. DECLARE_INTERFACE_( IRunnableTask, IUnknown )
  2245. {
  2246. // *** IUnknown methods ***
  2247. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2248. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  2249. STDMETHOD_(ULONG, Release)(THIS) PURE;
  2250. // *** IRunnableTask methods ***
  2251. STDMETHOD (Run)(THIS) PURE;
  2252. STDMETHOD (Kill)(THIS_ BOOL fWait ) PURE;
  2253. STDMETHOD (Suspend)(THIS) PURE;
  2254. STDMETHOD (Resume)(THIS) PURE;
  2255. STDMETHOD_(ULONG, IsRunning)(THIS) PURE;
  2256. };
  2257. typedef IRunnableTask * LPRUNNABLETASK;
  2258. #endif
  2259. #if (_WIN32_IE >= 0x0400)
  2260. #define TASKOWNERID GUID
  2261. #define REFTASKOWNERID REFGUID
  2262. // ---IShellTaskScheduler
  2263. // An interface for interacting with and controlling a task scheduler. This
  2264. // interface does not need to be free-threaded unless the items in the queue
  2265. // interact with the scheduler as well as the main execution thread on which the
  2266. // task scheduler was created.
  2267. // IShellTaskScheduler::AddTask()
  2268. // Adds Tasks to the scheduler's background queue. The TASKOWNERID allow particular types
  2269. // of tasks to be grouped so that they can be counted or removed. The lParam allows the task
  2270. // to be associated with a particular item (for example an item in a listview).
  2271. // IShellTaskScheduler::RemoveTasks()
  2272. // Removes tasks from the scheduler's queue. These can be sepcified in terms of their TASKOWNERID
  2273. // or their LPARAM, or both, or neither (TOID_NULL && ITSAT_DEFAULT_LPARAM results in all tasks being
  2274. // removed). If a task that matches is currently running and ITaskScheduler::Status() has been
  2275. // passeed ITSSFLAG_KILL_ON_DESTROY then the scheduler will attempt to kill the current task. The
  2276. // fWaitIfRunning parameter is then passed to IRunnableTask::Kill().
  2277. // IShellTaskScheduler::CountTasks()
  2278. // Counts the tasks in the queue depending upon the TASKOWNERID and the LPARAM passed. (TOID_NULL and
  2279. // ITSAT_DEFAULT_LPARAM will count all tasks in the queue)
  2280. // IShellTaskScheduler::Status()
  2281. // This sets the ReleaseStatus for the current task and the background thread timeout. When
  2282. // ITaskScheduler::RemoveTasks() is called and there is a task currently running that matches
  2283. // ITSSFLAG_COMPLETE_ON_DESTROY will cause TRUE to be passed to the task's IRunnableTask::Kill().
  2284. // The dwThreadTimeout parameter if not set to the default will cause the background thread to
  2285. // die if no new tasks have been added to the queue in the timeout period. The Thread will be
  2286. // recreated when the next new task is added.
  2287. ////////////////////////
  2288. // Status() flags,
  2289. // wait for the current task to complete before deleting the scheduler
  2290. #define ITSSFLAG_COMPLETE_ON_DESTROY 0x0000
  2291. // kill the current task (if there is one) when the task scheduler is deleted
  2292. #define ITSSFLAG_KILL_ON_DESTROY 0x0001
  2293. #define ITSSFLAG_SUPPORTS_TERMINATE 0x0002
  2294. #define ITSSFLAG_FLAGS_MASK 0x0003
  2295. // set the timeout for killing the thread when the object is terminated.
  2296. // this timeout can be used to stop the object from blocking the system
  2297. // indefinitely.
  2298. #define ITSSFLAG_THREAD_TERMINATE_TIMEOUT 0x0010
  2299. // set the timeout for threads that are idle in the thread pool
  2300. #define ITSSFLAG_THREAD_POOL_TIMEOUT 0x0020
  2301. // The default timeout passed to release Status to determine how long the thread
  2302. // can be asleep before the thread is expired
  2303. #define ITSS_THREAD_DESTROY_DEFAULT_TIMEOUT (60*1000)
  2304. // default, we won't kill it...
  2305. #define ITSS_THREAD_TERMINATE_TIMEOUT (INFINITE)
  2306. // there is no change to the thread timeout
  2307. #define ITSS_THREAD_TIMEOUT_NO_CHANGE (INFINITE - 1)
  2308. // the LPARAM allows task to be associated with items thus all tasks owned by a
  2309. // particular item can be accessed by passing a non default value for this parameter
  2310. #define ITSAT_DEFAULT_LPARAM 0xffffffff
  2311. // Task priorities
  2312. // ---------------
  2313. // This depends on the cooperation of tasks currently under execution. New tasks will
  2314. // be inserted in the queue in priority order. If a task of a low priority is currently
  2315. // under execution when a higher priority task is added, the scheduler will attempt
  2316. // to suspend the task currently under execution. It will be resumed when the other tasks
  2317. // have been completed.
  2318. #define ITSAT_DEFAULT_PRIORITY 0x10000000
  2319. #define ITSAT_MAX_PRIORITY 0x7fffffff
  2320. #define ITSAT_MIN_PRIORITY 0x00000000
  2321. #define TOID_NULL CLSID_NULL
  2322. #undef INTERFACE
  2323. #define INTERFACE IShellTaskScheduler
  2324. DECLARE_INTERFACE_( IShellTaskScheduler, IUnknown )
  2325. {
  2326. // *** IUnknown methods ***
  2327. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2328. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  2329. STDMETHOD_(ULONG, Release)(THIS) PURE;
  2330. // *** IShellTaskScheduler methods ***
  2331. STDMETHOD (AddTask)(THIS_ IRunnableTask * pTask,
  2332. REFTASKOWNERID rtoid,
  2333. DWORD_PTR lParam,
  2334. DWORD dwPriority ) PURE;
  2335. STDMETHOD (RemoveTasks)(THIS_ REFTASKOWNERID rtoid,
  2336. DWORD_PTR lParam,
  2337. BOOL fWaitIfRunning ) PURE;
  2338. STDMETHOD_(UINT, CountTasks)(THIS_ REFTASKOWNERID rtoid) PURE;
  2339. STDMETHOD (Status)(THIS_ DWORD dwReleaseStatus, DWORD dwThreadTimeout ) PURE;
  2340. };
  2341. typedef IShellTaskScheduler * LPSHELLTASKSCHEDULER;
  2342. #if (_WIN32_IE >= 0x0501)
  2343. #define ITSSFLAG_TASK_PLACEINFRONT 0x00000001
  2344. #define ITSSFLAG_TASK_PLACEINBACK 0x00000002
  2345. #undef INTERFACE
  2346. #define INTERFACE IShellTaskScheduler2
  2347. DECLARE_INTERFACE_( IShellTaskScheduler2, IShellTaskScheduler )
  2348. {
  2349. // *** IUnknown methods ***
  2350. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2351. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  2352. STDMETHOD_(ULONG, Release)(THIS) PURE;
  2353. // *** IShellTaskScheduler methods ***
  2354. STDMETHOD (AddTask)(THIS_ IRunnableTask * pTask,
  2355. REFTASKOWNERID rtoid,
  2356. DWORD_PTR lParam,
  2357. DWORD dwPriority ) PURE;
  2358. STDMETHOD (RemoveTasks)(THIS_ REFTASKOWNERID rtoid,
  2359. DWORD_PTR lParam,
  2360. BOOL fWaitIfRunning ) PURE;
  2361. STDMETHOD_(UINT, CountTasks)(THIS_ REFTASKOWNERID rtoid) PURE;
  2362. STDMETHOD (Status)(THIS_ DWORD dwReleaseStatus, DWORD dwThreadTimeout ) PURE;
  2363. // *** IShellTaskScheduler2 methods ***
  2364. STDMETHOD (AddTask2)(THIS_ IRunnableTask * pTask,
  2365. REFTASKOWNERID rtoid,
  2366. DWORD_PTR lParam,
  2367. DWORD dwPriority,
  2368. DWORD grfFlags ) PURE;
  2369. STDMETHOD (MoveTask)(THIS_ REFTASKOWNERID rtoid,
  2370. DWORD_PTR lParam,
  2371. DWORD dwPriority,
  2372. DWORD grfFlags ) PURE;
  2373. };
  2374. #endif // (_WIN32_IE >= 0x0501)
  2375. #endif // (_WIN32_IE >= 0x0400)
  2376. #if (_WIN32_IE >= 0x0400)
  2377. /* ***************** IThumbnailCapture
  2378. * CaptureThumbnail : takes an IHTMLDocument2 and returns a thumbnail of specified
  2379. * size as an hbitmap
  2380. */
  2381. #undef INTERFACE
  2382. #define INTERFACE IThumbnailCapture
  2383. DECLARE_INTERFACE_ ( IThumbnailCapture, IUnknown )
  2384. {
  2385. // *** IThumbnailCapture methods ***
  2386. STDMETHOD (CaptureThumbnail) ( THIS_ const SIZE * pMaxSize,
  2387. IUnknown * pHTMLDoc2,
  2388. HBITMAP * phbmThumbnail ) PURE;
  2389. };
  2390. typedef IThumbnailCapture * LPTHUMBNAILCAPTURE;
  2391. #endif
  2392. #if ( _WIN32_IE >= 0x0500 )
  2393. ///////////////////////////////////////////////////////////////////////
  2394. // interface for
  2395. #include <pshpack8.h>
  2396. typedef struct _EnumImageStoreDATAtag
  2397. {
  2398. WCHAR szPath[MAX_PATH];
  2399. FILETIME ftTimeStamp;
  2400. } ENUMSHELLIMAGESTOREDATA, * PENUMSHELLIMAGESTOREDATA;
  2401. #include <poppack.h> /* Return to byte packing */
  2402. #undef INTERFACE
  2403. #define INTERFACE IEnumShellImageStore
  2404. DECLARE_INTERFACE_( IEnumShellImageStore, IUnknown )
  2405. {
  2406. STDMETHOD ( QueryInterface ) ( THIS_ REFIID riid, void **ppv ) PURE;
  2407. STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
  2408. STDMETHOD_( ULONG, Release ) ( THIS ) PURE;
  2409. STDMETHOD ( Reset ) ( THIS ) PURE;
  2410. STDMETHOD ( Next ) ( THIS_ ULONG celt, PENUMSHELLIMAGESTOREDATA * prgElt, ULONG * pceltFetched ) PURE;
  2411. STDMETHOD ( Skip ) ( THIS_ ULONG celt ) PURE;
  2412. STDMETHOD ( Clone ) ( THIS_ IEnumShellImageStore ** ppEnum ) PURE;
  2413. };
  2414. typedef IEnumShellImageStore * LPENUMSHELLIMAGESTORE;
  2415. // flags used to determine the capabilities of the storage for the images
  2416. #define SHIMSTCAPFLAG_LOCKABLE 0x0001 // does the store require/support locking
  2417. #define SHIMSTCAPFLAG_PURGEABLE 0x0002 // does the store require dead items purging externally ?
  2418. #undef INTERFACE
  2419. #define INTERFACE IShellImageStore
  2420. // this interface is used to manipulate the Image cache. It can potentially be used
  2421. // in a free threaded manner in conjunction with the Lock parameter to Open and close
  2422. DECLARE_INTERFACE_( IShellImageStore, IUnknown )
  2423. {
  2424. STDMETHOD ( QueryInterface )( THIS_ REFIID riid, void **ppv ) PURE;
  2425. STDMETHOD_( ULONG, AddRef ) ( THIS ) PURE;
  2426. STDMETHOD_( ULONG, Release ) ( THIS ) PURE;
  2427. // if the lock parameter is used, then all other calls into
  2428. // open and/or create will block until the lock is released.
  2429. STDMETHOD ( Open ) ( THIS_ DWORD dwMode, DWORD * pdwLock ) PURE;
  2430. STDMETHOD ( Create ) ( THIS_ DWORD dwMode, DWORD * pdwLock ) PURE;
  2431. // if the lock is passed to either of these two methods, it releases the lock
  2432. // once the operation is complete.
  2433. STDMETHOD ( ReleaseLock ) ( THIS_ DWORD const * pdwLock ) PURE;
  2434. STDMETHOD ( Close ) ( THIS_ DWORD const * pdwLock ) PURE;
  2435. STDMETHOD ( Commit ) ( THIS_ DWORD const * pdwLock ) PURE;
  2436. STDMETHOD ( IsLocked ) ( THIS ) PURE;
  2437. STDMETHOD ( GetMode ) ( THIS_ DWORD * pdwMode ) PURE;
  2438. STDMETHOD ( GetCapabilities ) ( THIS_ DWORD * pdwCapMask ) PURE;
  2439. STDMETHOD ( AddEntry ) ( THIS_ LPCWSTR pszName, const FILETIME * pftTimeStamp, DWORD dwMode, HBITMAP hImage ) PURE;
  2440. STDMETHOD ( GetEntry ) ( THIS_ LPCWSTR pszName, DWORD dwMode, HBITMAP * phImage ) PURE;
  2441. STDMETHOD ( DeleteEntry ) ( THIS_ LPCWSTR pszName ) PURE;
  2442. STDMETHOD ( IsEntryInStore ) ( THIS_ LPCWSTR pszName, FILETIME * pftTimeStamp ) PURE;
  2443. STDMETHOD ( Enum ) ( THIS_ LPENUMSHELLIMAGESTORE * ppEnum ) PURE;
  2444. };
  2445. typedef IShellImageStore * LPSHELLIMAGESTORE;
  2446. #endif
  2447. #if (_WIN32_IE >= 0x0400)
  2448. //// IShellFolderBand
  2449. // Field mask
  2450. #define ISFB_MASK_STATE 0x00000001 // TRUE if dwStateMask and dwState is valid
  2451. #define ISFB_MASK_BKCOLOR 0x00000002 // TRUE if crBkgnd field is valid
  2452. #define ISFB_MASK_VIEWMODE 0x00000004 // TRUE if wViewMode field is valid
  2453. #define ISFB_MASK_SHELLFOLDER 0x00000008
  2454. #define ISFB_MASK_IDLIST 0x00000010
  2455. #define ISFB_MASK_COLORS 0x00000020 // TRUE if crXXXX fields are valid (except bkgnd)
  2456. #define ISFB_STATE_DEFAULT 0x00000000
  2457. #define ISFB_STATE_DEBOSSED 0x00000001
  2458. #define ISFB_STATE_ALLOWRENAME 0x00000002
  2459. #define ISFB_STATE_NOSHOWTEXT 0x00000004 // TRUE if _fNoShowText
  2460. #define ISFB_STATE_CHANNELBAR 0x00000010 // TRUE if we want NavigateTarget support
  2461. #define ISFB_STATE_QLINKSMODE 0x00000020 // TRUE if we want to turn off drag & drop onto content items
  2462. #define ISFB_STATE_FULLOPEN 0x00000040 // TRUE if band should maximize when opened
  2463. #define ISFB_STATE_NONAMESORT 0x00000080 // TRUE if band should _not_ sort icons by name
  2464. #define ISFB_STATE_BTNMINSIZE 0x00000100 // TRUE if band should report min thickness of button
  2465. #define ISFBVIEWMODE_SMALLICONS 0x0001
  2466. #define ISFBVIEWMODE_LARGEICONS 0x0002
  2467. #define ISFBVIEWMODE_LOGOS 0x0003
  2468. #include <pshpack8.h>
  2469. typedef struct {
  2470. DWORD dwMask; // [in] ISFB_MASK mask of valid fields from crBkgnd on
  2471. DWORD dwStateMask; // [in] ISFB_STATE mask of dwState bits being set/queried
  2472. DWORD dwState; // [in/out] ISFB_STATE bits
  2473. COLORREF crBkgnd; // [in/out]
  2474. COLORREF crBtnLt; // [in/out]
  2475. COLORREF crBtnDk; // [in/out]
  2476. WORD wViewMode; // [in/out]
  2477. WORD wAlign; // not used (yet)
  2478. IShellFolder * psf; // [out]
  2479. LPITEMIDLIST pidl; // [out]
  2480. } BANDINFOSFB, *PBANDINFOSFB;
  2481. #include <poppack.h> /* Return to byte packing */
  2482. #undef INTERFACE
  2483. #define INTERFACE IShellFolderBand
  2484. DECLARE_INTERFACE_(IShellFolderBand, IUnknown)
  2485. {
  2486. // *** IUnknown methods ***
  2487. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2488. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2489. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2490. // *** IShellFolderBand Methods ***
  2491. STDMETHOD(InitializeSFB)(THIS_ IShellFolder *psf, LPCITEMIDLIST pidl) PURE;
  2492. STDMETHOD(SetBandInfoSFB)(THIS_ PBANDINFOSFB pbi) PURE;
  2493. STDMETHOD(GetBandInfoSFB)(THIS_ PBANDINFOSFB pbi) PURE;
  2494. };
  2495. // Command Target IDs
  2496. enum {
  2497. SFBID_PIDLCHANGED,
  2498. };
  2499. //// IDeskBarClient
  2500. #undef INTERFACE
  2501. #define INTERFACE IDeskBarClient
  2502. DECLARE_INTERFACE_(IDeskBarClient, IOleWindow)
  2503. {
  2504. // *** IUnknown methods ***
  2505. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2506. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2507. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2508. // *** IOleWindow methods ***
  2509. STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2510. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2511. // *** IDeskBarClient methods ***
  2512. STDMETHOD(SetDeskBarSite) (THIS_ IUnknown* punkSite) PURE;
  2513. STDMETHOD(SetModeDBC) (THIS_ DWORD dwMode) PURE;
  2514. STDMETHOD(UIActivateDBC) (THIS_ DWORD dwState) PURE;
  2515. STDMETHOD(GetSize) (THIS_ DWORD dwWhich, LPRECT prc) PURE;
  2516. };
  2517. #define DBC_GS_IDEAL 0 // get the ideal size
  2518. #define DBC_GS_SIZEDOWN 1 // clip the height of a rect to a multiple of the rebar's integral size
  2519. #define DBC_HIDE 0 // Band is hidden (being destroyed)
  2520. #define DBC_SHOW 1 // Band is visible
  2521. #define DBC_SHOWOBSCURE 2 // Band is completely obscured
  2522. enum {
  2523. DBCID_EMPTY = 0, // bandsite is empty
  2524. DBCID_ONDRAG = 1, // (down)DragMoveEnter/Leave vaIn:I4:eDrag
  2525. DBCID_CLSIDOFBAR = 2, // clsid of bar inside
  2526. DBCID_RESIZE = 3, // resize from keyboard
  2527. DBCID_GETBAR = 4, // returns vaOut:VT_UNKNOWN of hosting dockbar (IDeskBar)
  2528. };
  2529. #endif // _WIN32_IE > 0x0400
  2530. #if (_WIN32_IE >= 0x400)
  2531. //
  2532. // We need to make sure that WININET.H is included before this interface is
  2533. // used because the COMPONENT structure uses INTERNET_MAX_URL_LENGTH
  2534. //
  2535. #ifdef _WININET_
  2536. //
  2537. // Flags and structures used by IActiveDesktop
  2538. //
  2539. typedef struct _tagWALLPAPEROPT
  2540. {
  2541. DWORD dwSize; // size of this Structure.
  2542. DWORD dwStyle; // WPSTYLE_* mentioned above
  2543. }
  2544. WALLPAPEROPT;
  2545. typedef WALLPAPEROPT *LPWALLPAPEROPT;
  2546. typedef const WALLPAPEROPT *LPCWALLPAPEROPT;
  2547. typedef struct _tagCOMPONENTSOPT
  2548. {
  2549. DWORD dwSize; //Size of this structure
  2550. BOOL fEnableComponents; //Enable components?
  2551. BOOL fActiveDesktop; // Active desktop enabled ?
  2552. }
  2553. COMPONENTSOPT;
  2554. typedef COMPONENTSOPT *LPCOMPONENTSOPT;
  2555. typedef const COMPONENTSOPT *LPCCOMPONENTSOPT;
  2556. typedef struct _tagCOMPPOS
  2557. {
  2558. DWORD dwSize; //Size of this structure
  2559. int iLeft; //Left of top-left corner in screen co-ordinates.
  2560. int iTop; //Top of top-left corner in screen co-ordinates.
  2561. DWORD dwWidth; // Width in pixels.
  2562. DWORD dwHeight; // Height in pixels.
  2563. int izIndex; // Indicates the Z-order of the component.
  2564. BOOL fCanResize; // Is the component resizeable?
  2565. BOOL fCanResizeX; // Resizeable in X-direction?
  2566. BOOL fCanResizeY; // Resizeable in Y-direction?
  2567. int iPreferredLeftPercent; //Left of top-left corner as percent of screen width
  2568. int iPreferredTopPercent; //Top of top-left corner as percent of screen height
  2569. }
  2570. COMPPOS;
  2571. typedef COMPPOS *LPCOMPPOS;
  2572. typedef const COMPPOS *LPCCOMPPOS;
  2573. typedef struct _tagCOMPSTATEINFO
  2574. {
  2575. DWORD dwSize; // Size of this structure.
  2576. int iLeft; // Left of the top-left corner in screen co-ordinates.
  2577. int iTop; // Top of top-left corner in screen co-ordinates.
  2578. DWORD dwWidth; // Width in pixels.
  2579. DWORD dwHeight; // Height in pixels.
  2580. DWORD dwItemState; // State of the component (full-screen mode or split-screen or normal state.
  2581. }
  2582. COMPSTATEINFO;
  2583. typedef COMPSTATEINFO *LPCOMPSTATEINFO;
  2584. typedef const COMPSTATEINFO *LPCCOMPSTATEINFO;
  2585. #define COMPONENT_TOP (0x3fffffff) // izOrder value meaning component is at the top
  2586. // iCompType values
  2587. #define COMP_TYPE_HTMLDOC 0
  2588. #define COMP_TYPE_PICTURE 1
  2589. #define COMP_TYPE_WEBSITE 2
  2590. #define COMP_TYPE_CONTROL 3
  2591. #define COMP_TYPE_CFHTML 4
  2592. #define COMP_TYPE_MAX 4
  2593. // The following is the COMPONENT structure used in IE4.01, IE4.0 and Memphis. It is kept here for compatibility
  2594. // reasons.
  2595. typedef struct _tagIE4COMPONENT
  2596. {
  2597. DWORD dwSize; //Size of this structure
  2598. DWORD dwID; //Reserved: Set it always to zero.
  2599. int iComponentType; //One of COMP_TYPE_*
  2600. BOOL fChecked; // Is this component enabled?
  2601. BOOL fDirty; // Had the component been modified and not yet saved to disk?
  2602. BOOL fNoScroll; // Is the component scrollable?
  2603. COMPPOS cpPos; // Width, height etc.,
  2604. WCHAR wszFriendlyName[MAX_PATH]; // Friendly name of component.
  2605. WCHAR wszSource[INTERNET_MAX_URL_LENGTH]; //URL of the component.
  2606. WCHAR wszSubscribedURL[INTERNET_MAX_URL_LENGTH]; //Subscrined URL
  2607. }
  2608. IE4COMPONENT;
  2609. typedef IE4COMPONENT *LPIE4COMPONENT;
  2610. typedef const IE4COMPONENT *LPCIE4COMPONENT;
  2611. //
  2612. // The following is the new NT5 component structure. Note that the initial portion of this component exactly
  2613. // matches the IE4COMPONENT structure. All new fields are added at the bottom and the dwSize field is used to
  2614. // distinguish between IE4COMPONENT and the new COMPONENT structures.
  2615. //
  2616. typedef struct _tagCOMPONENT
  2617. {
  2618. DWORD dwSize; //Size of this structure
  2619. DWORD dwID; //Reserved: Set it always to zero.
  2620. int iComponentType; //One of COMP_TYPE_*
  2621. BOOL fChecked; // Is this component enabled?
  2622. BOOL fDirty; // Had the component been modified and not yet saved to disk?
  2623. BOOL fNoScroll; // Is the component scrollable?
  2624. COMPPOS cpPos; // Width, height etc.,
  2625. WCHAR wszFriendlyName[MAX_PATH]; // Friendly name of component.
  2626. WCHAR wszSource[INTERNET_MAX_URL_LENGTH]; //URL of the component.
  2627. WCHAR wszSubscribedURL[INTERNET_MAX_URL_LENGTH]; //Subscrined URL
  2628. //New fields are added below. Everything above here must exactly match the IE4COMPONENT Structure.
  2629. DWORD dwCurItemState; // Current state of the Component.
  2630. COMPSTATEINFO csiOriginal; // Original state of the component when it was first added.
  2631. COMPSTATEINFO csiRestored; // Restored state of the component.
  2632. }
  2633. COMPONENT;
  2634. typedef COMPONENT *LPCOMPONENT;
  2635. typedef const COMPONENT *LPCCOMPONENT;
  2636. // Defines for dwCurItemState
  2637. #define IS_NORMAL 0x00000001
  2638. #define IS_FULLSCREEN 0x00000002
  2639. #define IS_SPLIT 0x00000004
  2640. #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.
  2641. #define IS_VALIDSTATEBITS (IS_NORMAL | IS_SPLIT | IS_FULLSCREEN | 0x80000000 | 0x40000000) // All of the currently defined IS_* bits.
  2642. ////////////////////////////////////////////
  2643. // Flags for IActiveDesktop::ApplyChanges()
  2644. #define AD_APPLY_SAVE 0x00000001
  2645. #define AD_APPLY_HTMLGEN 0x00000002
  2646. #define AD_APPLY_REFRESH 0x00000004
  2647. #define AD_APPLY_ALL (AD_APPLY_SAVE | AD_APPLY_HTMLGEN | AD_APPLY_REFRESH)
  2648. #define AD_APPLY_FORCE 0x00000008
  2649. #define AD_APPLY_BUFFERED_REFRESH 0x00000010
  2650. #define AD_APPLY_DYNAMICREFRESH 0x00000020
  2651. ////////////////////////////////////////////
  2652. // Flags for IActiveDesktop::GetWallpaperOptions()
  2653. // IActiveDesktop::SetWallpaperOptions()
  2654. #define WPSTYLE_CENTER 0
  2655. #define WPSTYLE_TILE 1
  2656. #define WPSTYLE_STRETCH 2
  2657. #define WPSTYLE_MAX 3
  2658. ////////////////////////////////////////////
  2659. // Flags for IActiveDesktop::ModifyComponent()
  2660. #define COMP_ELEM_TYPE 0x00000001
  2661. #define COMP_ELEM_CHECKED 0x00000002
  2662. #define COMP_ELEM_DIRTY 0x00000004
  2663. #define COMP_ELEM_NOSCROLL 0x00000008
  2664. #define COMP_ELEM_POS_LEFT 0x00000010
  2665. #define COMP_ELEM_POS_TOP 0x00000020
  2666. #define COMP_ELEM_SIZE_WIDTH 0x00000040
  2667. #define COMP_ELEM_SIZE_HEIGHT 0x00000080
  2668. #define COMP_ELEM_POS_ZINDEX 0x00000100
  2669. #define COMP_ELEM_SOURCE 0x00000200
  2670. #define COMP_ELEM_FRIENDLYNAME 0x00000400
  2671. #define COMP_ELEM_SUBSCRIBEDURL 0x00000800
  2672. #define COMP_ELEM_ORIGINAL_CSI 0x00001000
  2673. #define COMP_ELEM_RESTORED_CSI 0x00002000
  2674. #define COMP_ELEM_CURITEMSTATE 0x00004000
  2675. #define COMP_ELEM_ALL (COMP_ELEM_TYPE | COMP_ELEM_CHECKED | COMP_ELEM_DIRTY | \
  2676. COMP_ELEM_NOSCROLL | COMP_ELEM_POS_LEFT | COMP_ELEM_SIZE_WIDTH | \
  2677. COMP_ELEM_SIZE_HEIGHT | COMP_ELEM_POS_ZINDEX | COMP_ELEM_SOURCE | \
  2678. COMP_ELEM_FRIENDLYNAME | COMP_ELEM_POS_TOP | COMP_ELEM_SUBSCRIBEDURL | \
  2679. COMP_ELEM_ORIGINAL_CSI | COMP_ELEM_RESTORED_CSI | COMP_ELEM_CURITEMSTATE)
  2680. ////////////////////////////////////////////
  2681. // Flags for IActiveDesktop::AddDesktopItemWithUI()
  2682. typedef enum tagDTI_ADTIWUI
  2683. {
  2684. DTI_ADDUI_DEFAULT = 0x00000000,
  2685. DTI_ADDUI_DISPSUBWIZARD = 0x00000001,
  2686. DTI_ADDUI_POSITIONITEM = 0x00000002,
  2687. };
  2688. ////////////////////////////////////////////
  2689. // Flags for IActiveDesktop::AddUrl()
  2690. #define ADDURL_SILENT 0X0001
  2691. ////////////////////////////////////////////
  2692. // Default positions for ADI
  2693. #define COMPONENT_DEFAULT_LEFT (0xFFFF)
  2694. #define COMPONENT_DEFAULT_TOP (0xFFFF)
  2695. //
  2696. // Interface for manipulating the Active Desktop.
  2697. //
  2698. #undef INTERFACE
  2699. #define INTERFACE IActiveDesktop
  2700. DECLARE_INTERFACE_( IActiveDesktop, IUnknown )
  2701. {
  2702. // IUnknown methods
  2703. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2704. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  2705. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  2706. // IActiveDesktop methods
  2707. STDMETHOD (ApplyChanges)(THIS_ DWORD dwFlags) PURE;
  2708. STDMETHOD (GetWallpaper)(THIS_ LPWSTR pwszWallpaper, UINT cchWallpaper, DWORD dwReserved) PURE;
  2709. STDMETHOD (SetWallpaper)(THIS_ LPCWSTR pwszWallpaper, DWORD dwReserved) PURE;
  2710. STDMETHOD (GetWallpaperOptions)(THIS_ LPWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
  2711. STDMETHOD (SetWallpaperOptions)(THIS_ LPCWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
  2712. STDMETHOD (GetPattern)(THIS_ LPWSTR pwszPattern, UINT cchPattern, DWORD dwReserved) PURE;
  2713. STDMETHOD (SetPattern)(THIS_ LPCWSTR pwszPattern, DWORD dwReserved) PURE;
  2714. STDMETHOD (GetDesktopItemOptions)(THIS_ LPCOMPONENTSOPT pco, DWORD dwReserved) PURE;
  2715. STDMETHOD (SetDesktopItemOptions)(THIS_ LPCCOMPONENTSOPT pco, DWORD dwReserved) PURE;
  2716. STDMETHOD (AddDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
  2717. STDMETHOD (AddDesktopItemWithUI)(THIS_ HWND hwnd, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2718. STDMETHOD (ModifyDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwFlags) PURE;
  2719. STDMETHOD (RemoveDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
  2720. STDMETHOD (GetDesktopItemCount)(THIS_ LPINT lpiCount, DWORD dwReserved) PURE;
  2721. STDMETHOD (GetDesktopItem)(THIS_ int nComponent, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2722. STDMETHOD (GetDesktopItemByID)(THIS_ ULONG_PTR dwID, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2723. STDMETHOD (GenerateDesktopItemHtml)(THIS_ LPCWSTR pwszFileName, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2724. STDMETHOD (AddUrl)(THIS_ HWND hwnd, LPCWSTR pszSource, LPCOMPONENT pcomp, DWORD dwFlags) PURE;
  2725. STDMETHOD (GetDesktopItemBySource)(THIS_ LPCWSTR pwszSource, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2726. };
  2727. typedef IActiveDesktop * LPACTIVEDESKTOP;
  2728. // Flags for SetSafeMode
  2729. #define SSM_CLEAR 0x0000
  2730. #define SSM_SET 0x0001
  2731. #define SSM_REFRESH 0x0002
  2732. #define SSM_UPDATE 0x0004
  2733. // Flags for Set/GetScheme
  2734. #define SCHEME_DISPLAY 0x0001
  2735. #define SCHEME_EDIT 0x0002
  2736. #define SCHEME_LOCAL 0x0004
  2737. #define SCHEME_GLOBAL 0x0008
  2738. #define SCHEME_REFRESH 0x0010
  2739. #define SCHEME_UPDATE 0x0020
  2740. #define SCHEME_DONOTUSE 0x0040 // used to be SCHEME_ENUMERATE; no longer supported
  2741. #define SCHEME_CREATE 0x0080
  2742. #undef INTERFACE
  2743. #define INTERFACE IActiveDesktopP
  2744. DECLARE_INTERFACE_( IActiveDesktopP, IUnknown )
  2745. {
  2746. // IUnknown methods
  2747. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2748. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  2749. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  2750. // IActiveDesktopP methods
  2751. STDMETHOD (SetSafeMode)(THIS_ DWORD dwFlags) PURE;
  2752. STDMETHOD (EnsureUpdateHTML)(THIS) PURE;
  2753. STDMETHOD (SetScheme)(THIS_ LPCWSTR pwszSchemeName, DWORD dwFlags) PURE;
  2754. STDMETHOD (GetScheme)(THIS_ LPWSTR pwszSchemeName, DWORD *lpdwcchBuffer, DWORD dwFlags) PURE;
  2755. //
  2756. };
  2757. typedef IActiveDesktopP * LPACTIVEDESKTOPP;
  2758. //Flags for GetObjectFlags
  2759. #define GADOF_DIRTY 0x00000001
  2760. #undef INTERFACE
  2761. #define INTERFACE IADesktopP2
  2762. DECLARE_INTERFACE_( IADesktopP2, IUnknown )
  2763. {
  2764. // IUnknown methods
  2765. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2766. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  2767. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  2768. // IADesktopP2 methods
  2769. STDMETHOD (ReReadWallpaper)(THIS) PURE;
  2770. STDMETHOD (GetADObjectFlags)(THIS_ DWORD *lpdwFlags, DWORD dwMask) PURE;
  2771. STDMETHOD (UpdateAllDesktopSubscriptions)(THIS) PURE;
  2772. STDMETHOD (MakeDynamicChanges)(THIS_ IOleObject *pOleObj) PURE;
  2773. };
  2774. typedef IADesktopP2 * LPADESKTOPP2;
  2775. #endif // _WININET_
  2776. #if (_WIN32_IE >= 0x0500)
  2777. #define MAX_COLUMN_NAME_LEN 80
  2778. #define MAX_COLUMN_DESC_LEN 128
  2779. #include <pshpack1.h>
  2780. typedef struct {
  2781. SHCOLUMNID scid; // OUT the unique identifier of this column
  2782. VARTYPE vt; // OUT the native type of the data returned
  2783. DWORD fmt; // OUT this listview format (LVCFMT_LEFT, usually)
  2784. UINT cChars; // OUT the default width of the column, in characters
  2785. DWORD csFlags; // OUT SHCOLSTATE flags
  2786. WCHAR wszTitle[MAX_COLUMN_NAME_LEN]; // OUT the title of the column
  2787. WCHAR wszDescription[MAX_COLUMN_DESC_LEN]; // OUT full description of this column
  2788. } SHCOLUMNINFO, *LPSHCOLUMNINFO;
  2789. typedef const SHCOLUMNINFO* LPCSHCOLUMNINFO;
  2790. #include <poppack.h> /* Return to default */
  2791. #include <pshpack8.h>
  2792. typedef struct {
  2793. ULONG dwFlags; // initialization flags
  2794. ULONG dwReserved; // reserved for future use.
  2795. WCHAR wszFolder[MAX_PATH]; // fully qualified folder path (or empty if multiple folders)
  2796. } SHCOLUMNINIT, *LPSHCOLUMNINIT;
  2797. typedef const SHCOLUMNINIT* LPCSHCOLUMNINIT;
  2798. #define SHCDF_UPDATEITEM 0x00000001 // this flag is a hint that the file has changed since the last call to GetItemData
  2799. typedef struct {
  2800. ULONG dwFlags; // combination of SHCDF_ flags.
  2801. DWORD dwFileAttributes; // file attributes.
  2802. ULONG dwReserved; // reserved for future use.
  2803. WCHAR* pwszExt; // address of file name extension
  2804. WCHAR wszFile[MAX_PATH]; // Absolute path of file.
  2805. } SHCOLUMNDATA, *LPSHCOLUMNDATA;
  2806. typedef const SHCOLUMNDATA* LPCSHCOLUMNDATA;
  2807. #include <poppack.h> /* Return to byte packing */
  2808. #undef INTERFACE
  2809. #define INTERFACE IColumnProvider
  2810. // Note: these objects must be threadsafe! GetItemData _will_ be called
  2811. // simultaneously from multiple threads.
  2812. DECLARE_INTERFACE_(IColumnProvider, IUnknown)
  2813. {
  2814. // IUnknown methods
  2815. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2816. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  2817. STDMETHOD_(ULONG, Release)(THIS) PURE;
  2818. // IColumnProvider methods
  2819. STDMETHOD (Initialize)(THIS_ LPCSHCOLUMNINIT psci) PURE;
  2820. STDMETHOD (GetColumnInfo)(THIS_ DWORD dwIndex, SHCOLUMNINFO *psci) PURE;
  2821. STDMETHOD (GetItemData)(THIS_ LPCSHCOLUMNID pscid, LPCSHCOLUMNDATA pscd, VARIANT *pvarData) PURE;
  2822. };
  2823. ///////////////////////////////////////////////////////
  2824. //
  2825. // Drag and Drop helper
  2826. //
  2827. // Purpose: To expose the Shell drag images
  2828. //
  2829. // This interface is implemented in the shell by CLSID_DragDropHelper.
  2830. //
  2831. // To use:
  2832. // If you are the source of a drag (i.e. in response to LV_DRAGBEGIN or
  2833. // equivelent begin drag message) call
  2834. // IDragSourceHelper::InitializeFromWindow
  2835. // (<hwnd of window supporting DI_GETDRAGIMAGE>,
  2836. // <pointer to POINT indicating offset to the mouse from
  2837. // the upper left corner of the image>,
  2838. // <pointer to data object>)
  2839. //
  2840. // NOTE: The Data object must support IDataObject::SetData with multiple
  2841. // data types and GetData must implement data type cloning
  2842. // (Including HGLOBAL), not just aliasing.
  2843. //
  2844. // If you wish to have an image while over your application add the
  2845. // IDragImages::Dr* calls to your IDropTarget implementation. For Example:
  2846. //
  2847. // STDMETHODIMP CUserDropTarget::DragEnter(IDataObject* pDataObject,
  2848. // DWORD grfKeyState,
  2849. // POINTL pt, DWORD* pdwEffect)
  2850. // {
  2851. // // Process your DragEnter
  2852. // // Call IDragImages::DragEnter last.
  2853. // _pDropTargetHelper->DragEnter(_hwndDragOver, pDataObject,
  2854. // (POINT*)&pt, *pdwEffect);
  2855. // return hres;
  2856. // }
  2857. //
  2858. //
  2859. // If you wish to be able to source a drag image from a custom control,
  2860. // implement a handler for the RegisterWindowMessage(DI_GETDRAGIMAGE).
  2861. // The LPARAM is a pointer to an SHDRAGIMAGE structure.
  2862. //
  2863. // sizeDragImage - Calculate the length and width required to render
  2864. // the images.
  2865. // ptOffset - Calculate the offset from the upper left corner to
  2866. // the mouse cursor within the image
  2867. // hbmpDragImage - CreateBitmap( sizeDragImage.cx, sizeDragImage.cy,
  2868. // GetDeviceCaps(hdcScreen, PLANES),
  2869. // GetDeviceCaps(hdcScreen, BITSPIXEL),
  2870. // NULL);
  2871. //
  2872. // Drag Images will only be displayed on Windows NT 5.0 or later.
  2873. //
  2874. //
  2875. // Note about IDropTargetHelper::Show - This method is provided for
  2876. // showing/hiding the Drag image in low color depth video modes. When
  2877. // painting to a window that is currently being dragged over (i.e. For
  2878. // indicating a selection) you need to hide the drag image by calling this
  2879. // method passing FALSE. After the window is done painting, Show the image
  2880. // again by passing TRUE.
  2881. #include <pshpack8.h>
  2882. typedef struct
  2883. {
  2884. SIZE sizeDragImage; // OUT - The length and Width of the
  2885. // rendered image
  2886. POINT ptOffset; // OUT - The Offset from the mouse cursor to
  2887. // the upper left corner of the image
  2888. HBITMAP hbmpDragImage; // OUT - The Bitmap containing the rendered
  2889. // drag images
  2890. COLORREF crColorKey; // OUT - The COLORREF that has been blitted
  2891. // to the background of the images
  2892. } SHDRAGIMAGE, *LPSHDRAGIMAGE;
  2893. #include <poppack.h> /* Return to byte packing */
  2894. // This is sent to a window to get the rendered images to a bitmap
  2895. // Call RegisterWindowMessage to get the ID
  2896. #define DI_GETDRAGIMAGE TEXT("ShellGetDragImage")
  2897. #undef INTERFACE
  2898. #define INTERFACE IDropTargetHelper
  2899. DECLARE_INTERFACE_( IDropTargetHelper, IUnknown )
  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. // IDropTargetHelper
  2906. STDMETHOD (DragEnter)(THIS_ HWND hwndTarget, IDataObject* pDataObject,
  2907. POINT* ppt, DWORD dwEffect) PURE;
  2908. STDMETHOD (DragLeave)(THIS) PURE;
  2909. STDMETHOD (DragOver)(THIS_ POINT* ppt, DWORD dwEffect) PURE;
  2910. STDMETHOD (Drop)(THIS_ IDataObject* pDataObject, POINT* ppt,
  2911. DWORD dwEffect) PURE;
  2912. STDMETHOD (Show)(THIS_ BOOL fShow) PURE;
  2913. };
  2914. #undef INTERFACE
  2915. #define INTERFACE IDragSourceHelper
  2916. DECLARE_INTERFACE_( IDragSourceHelper, IUnknown )
  2917. {
  2918. // IUnknown methods
  2919. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  2920. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  2921. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  2922. // IDragSourceHelper
  2923. STDMETHOD (InitializeFromBitmap)(THIS_ LPSHDRAGIMAGE pshdi,
  2924. IDataObject* pDataObject) PURE;
  2925. STDMETHOD (InitializeFromWindow)(THIS_ HWND hwnd, POINT* ppt,
  2926. IDataObject* pDataObject) PURE;
  2927. };
  2928. #endif // _WIN32_IE >= 0x0500
  2929. #endif // _WIN32_IE
  2930. //==========================================================================
  2931. // Clipboard format which may be supported by IDataObject from system
  2932. // defined shell folders (such as directories, network, ...).
  2933. //==========================================================================
  2934. #define CFSTR_SHELLIDLIST TEXT("Shell IDList Array") // CF_IDLIST
  2935. #define CFSTR_SHELLIDLISTOFFSET TEXT("Shell Object Offsets") // CF_OBJECTPOSITIONS
  2936. #define CFSTR_NETRESOURCES TEXT("Net Resource") // CF_NETRESOURCE
  2937. #define CFSTR_FILEDESCRIPTORA TEXT("FileGroupDescriptor") // CF_FILEGROUPDESCRIPTORA
  2938. #define CFSTR_FILEDESCRIPTORW TEXT("FileGroupDescriptorW") // CF_FILEGROUPDESCRIPTORW
  2939. #define CFSTR_FILECONTENTS TEXT("FileContents") // CF_FILECONTENTS
  2940. #define CFSTR_FILENAMEA TEXT("FileName") // CF_FILENAMEA
  2941. #define CFSTR_FILENAMEW TEXT("FileNameW") // CF_FILENAMEW
  2942. #define CFSTR_PRINTERGROUP TEXT("PrinterFriendlyName") // CF_PRINTERS
  2943. #define CFSTR_FILENAMEMAPA TEXT("FileNameMap") // CF_FILENAMEMAPA
  2944. #define CFSTR_FILENAMEMAPW TEXT("FileNameMapW") // CF_FILENAMEMAPW
  2945. #define CFSTR_SHELLURL TEXT("UniformResourceLocator")
  2946. #define CFSTR_INETURLA CFSTR_SHELLURL
  2947. #define CFSTR_INETURLW TEXT("UniformResourceLocatorW")
  2948. #define CFSTR_PREFERREDDROPEFFECT TEXT("Preferred DropEffect")
  2949. #define CFSTR_PERFORMEDDROPEFFECT TEXT("Performed DropEffect")
  2950. #define CFSTR_PASTESUCCEEDED TEXT("Paste Succeeded")
  2951. #define CFSTR_INDRAGLOOP TEXT("InShellDragLoop")
  2952. #define CFSTR_DRAGCONTEXT TEXT("DragContext")
  2953. #define CFSTR_MOUNTEDVOLUME TEXT("MountedVolume")
  2954. #define CFSTR_PERSISTEDDATAOBJECT TEXT("PersistedDataObject")
  2955. #define CFSTR_TARGETCLSID TEXT("TargetCLSID") // HGLOBAL with a CLSID of the drop target
  2956. #define CFSTR_LOGICALPERFORMEDDROPEFFECT TEXT("Logical Performed DropEffect")
  2957. #define CFSTR_AUTOPLAY_SHELLIDLISTS TEXT("Autoplay Enumerated IDList Array") // (HGLOBAL with LPIDA)
  2958. #ifdef UNICODE
  2959. #define CFSTR_FILEDESCRIPTOR CFSTR_FILEDESCRIPTORW
  2960. #define CFSTR_FILENAME CFSTR_FILENAMEW
  2961. #define CFSTR_FILENAMEMAP CFSTR_FILENAMEMAPW
  2962. #define CFSTR_INETURL CFSTR_INETURLW
  2963. #else
  2964. #define CFSTR_FILEDESCRIPTOR CFSTR_FILEDESCRIPTORA
  2965. #define CFSTR_FILENAME CFSTR_FILENAMEA
  2966. #define CFSTR_FILENAMEMAP CFSTR_FILENAMEMAPA
  2967. #define CFSTR_INETURL CFSTR_INETURLA
  2968. #endif
  2969. #define DVASPECT_SHORTNAME 2 // use for CF_HDROP to get short name version of file paths
  2970. #define DVASPECT_COPY 3 // use to indicate format is a "Copy" of the data (FILECONTENTS, FILEDESCRIPTOR, etc)
  2971. #define DVASPECT_LINK 4 // use to indicate format is a "Shortcut" to the data (FILECONTENTS, FILEDESCRIPTOR, etc)
  2972. #include <pshpack8.h>
  2973. //
  2974. // format of CF_NETRESOURCE
  2975. //
  2976. typedef struct _NRESARRAY { // anr
  2977. UINT cItems;
  2978. NETRESOURCE nr[1];
  2979. } NRESARRAY, * LPNRESARRAY;
  2980. #include <poppack.h> /* Return to byte packing */
  2981. //
  2982. // format of CF_IDLIST
  2983. //
  2984. typedef struct _IDA {
  2985. UINT cidl; // number of relative IDList
  2986. UINT aoffset[1]; // [0]: folder IDList, [1]-[cidl]: item IDList
  2987. } CIDA, * LPIDA;
  2988. //
  2989. // FILEDESCRIPTOR.dwFlags field indicate which fields are to be used
  2990. //
  2991. typedef enum {
  2992. FD_CLSID = 0x0001,
  2993. FD_SIZEPOINT = 0x0002,
  2994. FD_ATTRIBUTES = 0x0004,
  2995. FD_CREATETIME = 0x0008,
  2996. FD_ACCESSTIME = 0x0010,
  2997. FD_WRITESTIME = 0x0020,
  2998. FD_FILESIZE = 0x0040,
  2999. FD_PROGRESSUI = 0x4000, // Show Progress UI w/Drag and Drop
  3000. FD_LINKUI = 0x8000, // 'link' UI is prefered
  3001. } FD_FLAGS;
  3002. typedef struct _FILEDESCRIPTORA { // fod
  3003. DWORD dwFlags;
  3004. CLSID clsid;
  3005. SIZEL sizel;
  3006. POINTL pointl;
  3007. DWORD dwFileAttributes;
  3008. FILETIME ftCreationTime;
  3009. FILETIME ftLastAccessTime;
  3010. FILETIME ftLastWriteTime;
  3011. DWORD nFileSizeHigh;
  3012. DWORD nFileSizeLow;
  3013. CHAR cFileName[ MAX_PATH ];
  3014. } FILEDESCRIPTORA, *LPFILEDESCRIPTORA;
  3015. typedef struct _FILEDESCRIPTORW { // fod
  3016. DWORD dwFlags;
  3017. CLSID clsid;
  3018. SIZEL sizel;
  3019. POINTL pointl;
  3020. DWORD dwFileAttributes;
  3021. FILETIME ftCreationTime;
  3022. FILETIME ftLastAccessTime;
  3023. FILETIME ftLastWriteTime;
  3024. DWORD nFileSizeHigh;
  3025. DWORD nFileSizeLow;
  3026. WCHAR cFileName[ MAX_PATH ];
  3027. } FILEDESCRIPTORW, *LPFILEDESCRIPTORW;
  3028. #ifdef UNICODE
  3029. #define FILEDESCRIPTOR FILEDESCRIPTORW
  3030. #define LPFILEDESCRIPTOR LPFILEDESCRIPTORW
  3031. #else
  3032. #define FILEDESCRIPTOR FILEDESCRIPTORA
  3033. #define LPFILEDESCRIPTOR LPFILEDESCRIPTORA
  3034. #endif
  3035. //
  3036. // format of CF_FILEGROUPDESCRIPTOR
  3037. //
  3038. typedef struct _FILEGROUPDESCRIPTORA { // fgd
  3039. UINT cItems;
  3040. FILEDESCRIPTORA fgd[1];
  3041. } FILEGROUPDESCRIPTORA, * LPFILEGROUPDESCRIPTORA;
  3042. typedef struct _FILEGROUPDESCRIPTORW { // fgd
  3043. UINT cItems;
  3044. FILEDESCRIPTORW fgd[1];
  3045. } FILEGROUPDESCRIPTORW, * LPFILEGROUPDESCRIPTORW;
  3046. #ifdef UNICODE
  3047. #define FILEGROUPDESCRIPTOR FILEGROUPDESCRIPTORW
  3048. #define LPFILEGROUPDESCRIPTOR LPFILEGROUPDESCRIPTORW
  3049. #else
  3050. #define FILEGROUPDESCRIPTOR FILEGROUPDESCRIPTORA
  3051. #define LPFILEGROUPDESCRIPTOR LPFILEGROUPDESCRIPTORA
  3052. #endif
  3053. //
  3054. // format of CF_HDROP and CF_PRINTERS, in the HDROP case the data that follows
  3055. // is a double null terinated list of file names, for printers they are printer
  3056. // friendly names
  3057. //
  3058. typedef struct _DROPFILES {
  3059. DWORD pFiles; // offset of file list
  3060. POINT pt; // drop point (client coords)
  3061. BOOL fNC; // is it on NonClient area
  3062. // and pt is in screen coords
  3063. BOOL fWide; // WIDE character switch
  3064. } DROPFILES, *LPDROPFILES;
  3065. //====== File System Notification APIs ===============================
  3066. //
  3067. typedef struct _SHChangeNotifyEntry
  3068. {
  3069. LPCITEMIDLIST pidl;
  3070. BOOL fRecursive;
  3071. } SHChangeNotifyEntry;
  3072. //
  3073. // File System Notification flags
  3074. //
  3075. #define SHCNE_RENAMEITEM 0x00000001L
  3076. #define SHCNE_CREATE 0x00000002L
  3077. #define SHCNE_DELETE 0x00000004L
  3078. #define SHCNE_MKDIR 0x00000008L
  3079. #define SHCNE_RMDIR 0x00000010L
  3080. #define SHCNE_MEDIAINSERTED 0x00000020L
  3081. #define SHCNE_MEDIAREMOVED 0x00000040L
  3082. #define SHCNE_DRIVEREMOVED 0x00000080L
  3083. #define SHCNE_DRIVEADD 0x00000100L
  3084. #define SHCNE_NETSHARE 0x00000200L
  3085. #define SHCNE_NETUNSHARE 0x00000400L
  3086. #define SHCNE_ATTRIBUTES 0x00000800L
  3087. #define SHCNE_UPDATEDIR 0x00001000L
  3088. #define SHCNE_UPDATEITEM 0x00002000L
  3089. #define SHCNE_SERVERDISCONNECT 0x00004000L
  3090. #define SHCNE_UPDATEIMAGE 0x00008000L
  3091. #define SHCNE_DRIVEADDGUI 0x00010000L
  3092. #define SHCNE_RENAMEFOLDER 0x00020000L
  3093. #define SHCNE_FREESPACE 0x00040000L
  3094. #if (_WIN32_IE >= 0x0400)
  3095. // SHCNE_EXTENDED_EVENT: the extended event is identified in dwItem1,
  3096. // packed in LPITEMIDLIST format (same as SHCNF_DWORD packing).
  3097. // Additional information can be passed in the dwItem2 parameter
  3098. // of SHChangeNotify (called "pidl2" below), which if present, must also
  3099. // be in LPITEMIDLIST format.
  3100. //
  3101. // Unlike the standard events, the extended events are ORDINALs, so we
  3102. // don't run out of bits. Extended events follow the SHCNEE_* naming
  3103. // convention.
  3104. //
  3105. // The dwItem2 parameter varies according to the extended event.
  3106. #define SHCNE_EXTENDED_EVENT 0x04000000L
  3107. #endif // _WIN32_IE >= 0x0400
  3108. #define SHCNE_ASSOCCHANGED 0x08000000L
  3109. #define SHCNE_DISKEVENTS 0x0002381FL
  3110. #define SHCNE_GLOBALEVENTS 0x0C0581E0L // Events that dont match pidls first
  3111. #define SHCNE_ALLEVENTS 0x7FFFFFFFL
  3112. #define SHCNE_INTERRUPT 0x80000000L // The presence of this flag indicates
  3113. // that the event was generated by an
  3114. // interrupt. It is stripped out before
  3115. // the clients of SHCNNotify_ see it.
  3116. #if (_WIN32_IE >= 0x0400)
  3117. // SHCNE_EXTENDED_EVENT extended events. These events are ordinals.
  3118. // This is not a bitfield.
  3119. #define SHCNEE_ORDERCHANGED 2L // pidl2 is the changed folder
  3120. #define SHCNEE_MSI_CHANGE 4L // pidl2 is a SHChangeProductKeyAsIDList
  3121. #define SHCNEE_MSI_UNINSTALL 5L // pidl2 is a SHChangeProductKeyAsIDList
  3122. #endif
  3123. // Flags
  3124. // uFlags & SHCNF_TYPE is an ID which indicates what dwItem1 and dwItem2 mean
  3125. #define SHCNF_IDLIST 0x0000 // LPITEMIDLIST
  3126. #define SHCNF_PATHA 0x0001 // path name
  3127. #define SHCNF_PRINTERA 0x0002 // printer friendly name
  3128. #define SHCNF_DWORD 0x0003 // DWORD
  3129. #define SHCNF_PATHW 0x0005 // path name
  3130. #define SHCNF_PRINTERW 0x0006 // printer friendly name
  3131. #define SHCNF_TYPE 0x00FF
  3132. #define SHCNF_FLUSH 0x1000
  3133. #define SHCNF_FLUSHNOWAIT 0x2000
  3134. #ifdef UNICODE
  3135. #define SHCNF_PATH SHCNF_PATHW
  3136. #define SHCNF_PRINTER SHCNF_PRINTERW
  3137. #else
  3138. #define SHCNF_PATH SHCNF_PATHA
  3139. #define SHCNF_PRINTER SHCNF_PRINTERA
  3140. #endif
  3141. //
  3142. // APIs
  3143. //
  3144. SHSTDAPI_(void) SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2);
  3145. //
  3146. // IShellChangeNotify
  3147. //
  3148. #undef INTERFACE
  3149. #define INTERFACE IShellChangeNotify
  3150. DECLARE_INTERFACE_(IShellChangeNotify, IUnknown)
  3151. {
  3152. // *** IUnknown methods ***
  3153. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3154. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3155. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3156. // *** IShellChangeNotify methods ***
  3157. STDMETHOD(OnChange) (THIS_ LONG lEvent, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  3158. } ;
  3159. //
  3160. // IQueryInfo
  3161. //
  3162. //-------------------------------------------------------------------------
  3163. //
  3164. // IQueryInfo interface
  3165. //
  3166. // [Methods]
  3167. // ::GetInfoTip()
  3168. //-------------------------------------------------------------------------
  3169. #undef INTERFACE
  3170. #define INTERFACE IQueryInfo
  3171. DECLARE_INTERFACE_(IQueryInfo, IUnknown)
  3172. {
  3173. // *** IUnknown methods ***
  3174. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3175. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3176. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3177. // *** IQueryInfo methods ***
  3178. STDMETHOD(GetInfoTip)(THIS_ DWORD dwFlags, WCHAR **ppwszTip) PURE;
  3179. STDMETHOD(GetInfoFlags)(THIS_ DWORD *pdwFlags) PURE;
  3180. } ;
  3181. #define QITIPF_DEFAULT 0x00000000
  3182. #define QITIPF_USENAME 0x00000001
  3183. #define QITIPF_LINKNOTARGET 0x00000002
  3184. #define QITIPF_LINKUSETARGET 0x00000004
  3185. #define QITIPF_USESLOWTIP 0x00000008 // Flag says it's OK to take a long time generating tip
  3186. #define QIF_CACHED 0x00000001
  3187. #define QIF_DONTEXPANDFOLDER 0x00000002
  3188. //
  3189. // SHAddToRecentDocs
  3190. //
  3191. #define SHARD_PIDL 0x00000001L
  3192. #define SHARD_PATHA 0x00000002L
  3193. #define SHARD_PATHW 0x00000003L
  3194. #ifdef UNICODE
  3195. #define SHARD_PATH SHARD_PATHW
  3196. #else
  3197. #define SHARD_PATH SHARD_PATHA
  3198. #endif
  3199. SHSTDAPI_(void) SHAddToRecentDocs(UINT uFlags, LPCVOID pv);
  3200. typedef struct _SHChangeDWORDAsIDList {
  3201. USHORT cb;
  3202. DWORD dwItem1;
  3203. DWORD dwItem2;
  3204. USHORT cbZero;
  3205. } SHChangeDWORDAsIDList, *LPSHChangeDWORDAsIDList;
  3206. #if (_WIN32_IE >= 0x0400)
  3207. typedef struct _SHChangeUpdateImageIDList {
  3208. USHORT cb;
  3209. int iIconIndex;
  3210. int iCurIndex;
  3211. UINT uFlags;
  3212. DWORD dwProcessID;
  3213. WCHAR szName[MAX_PATH];
  3214. USHORT cbZero;
  3215. } SHChangeUpdateImageIDList, * LPSHChangeUpdateImageIDList;
  3216. SHSTDAPI_(int) SHHandleUpdateImage( LPCITEMIDLIST pidlExtra );
  3217. typedef struct _SHChangeProductKeyAsIDList {
  3218. USHORT cb;
  3219. WCHAR wszProductKey[39];
  3220. USHORT cbZero;
  3221. } SHChangeProductKeyAsIDList, *LPSHChangeProductKeyAsIDList;
  3222. SHSTDAPI_(void) SHUpdateImageA(LPCSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex);
  3223. SHSTDAPI_(void) SHUpdateImageW(LPCWSTR pszHashItem, int iIndex, UINT uFlags, int iImageIndex);
  3224. #ifdef UNICODE
  3225. #define SHUpdateImage SHUpdateImageW
  3226. #else
  3227. #define SHUpdateImage SHUpdateImageA
  3228. #endif // !UNICODE
  3229. #endif /* _WIN32_IE */
  3230. SHSTDAPI_(ULONG) SHChangeNotifyRegister(HWND hwnd, int fSources, LONG fEvents, UINT wMsg, int cEntries, SHChangeNotifyEntry *pshcne);
  3231. SHSTDAPI_(BOOL) SHChangeNotifyDeregister(unsigned long ulID);
  3232. SHSTDAPI_(HANDLE) SHChangeNotification_Lock(HANDLE hChangeNotification, DWORD dwProcessId, LPITEMIDLIST **pppidl, LONG *plEvent);
  3233. SHSTDAPI_(BOOL) SHChangeNotification_Unlock(HANDLE hLock);
  3234. #if (_WIN32_IE >= 0x0400)
  3235. // The pidls that are given to the view via the ChangeNotifyEvents are simple Pidls,
  3236. // SHGetRealIDL() will convert them to true PIDLs.
  3237. SHSTDAPI SHGetRealIDL(IShellFolder *psf, LPCITEMIDLIST pidlSimple, LPITEMIDLIST * ppidlReal);
  3238. #endif // _WIN32_IE >= 0x0400
  3239. SHSTDAPI SHGetInstanceExplorer(IUnknown **ppunk);
  3240. //
  3241. // SHGetDataFromIDListA/W
  3242. //
  3243. // SHGetDataFromIDList nFormat values TCHAR
  3244. #define SHGDFIL_FINDDATA 1
  3245. #define SHGDFIL_NETRESOURCE 2
  3246. #define SHGDFIL_DESCRIPTIONID 3
  3247. #define SHDID_ROOT_REGITEM 1
  3248. #define SHDID_FS_FILE 2
  3249. #define SHDID_FS_DIRECTORY 3
  3250. #define SHDID_FS_OTHER 4
  3251. #define SHDID_COMPUTER_DRIVE35 5
  3252. #define SHDID_COMPUTER_DRIVE525 6
  3253. #define SHDID_COMPUTER_REMOVABLE 7
  3254. #define SHDID_COMPUTER_FIXED 8
  3255. #define SHDID_COMPUTER_NETDRIVE 9
  3256. #define SHDID_COMPUTER_CDROM 10
  3257. #define SHDID_COMPUTER_RAMDISK 11
  3258. #define SHDID_COMPUTER_OTHER 12
  3259. #define SHDID_NET_DOMAIN 13
  3260. #define SHDID_NET_SERVER 14
  3261. #define SHDID_NET_SHARE 15
  3262. #define SHDID_NET_RESTOFNET 16
  3263. #define SHDID_NET_OTHER 17
  3264. #define SHDID_COMPUTER_IMAGING 18
  3265. #define SHDID_COMPUTER_AUDIO 19
  3266. #define SHDID_COMPUTER_SHAREDDOCS 20
  3267. #include <pshpack8.h>
  3268. typedef struct _SHDESCRIPTIONID {
  3269. DWORD dwDescriptionId;
  3270. CLSID clsid;
  3271. } SHDESCRIPTIONID, *LPSHDESCRIPTIONID;
  3272. #include <poppack.h> /* Return to byte packing */
  3273. // these delegate to IShellFolder2::GetItemData()
  3274. SHSTDAPI SHGetDataFromIDListA(IShellFolder *psf, LPCITEMIDLIST pidl, int nFormat, void *pv, int cb);
  3275. SHSTDAPI SHGetDataFromIDListW(IShellFolder *psf, LPCITEMIDLIST pidl, int nFormat, void *pv, int cb);
  3276. #ifdef UNICODE
  3277. #define SHGetDataFromIDList SHGetDataFromIDListW
  3278. #else
  3279. #define SHGetDataFromIDList SHGetDataFromIDListA
  3280. #endif // !UNICODE
  3281. //===========================================================================
  3282. // PathResolve flags
  3283. #define PRF_VERIFYEXISTS 0x0001
  3284. #define PRF_TRYPROGRAMEXTENSIONS (0x0002 | PRF_VERIFYEXISTS)
  3285. #define PRF_FIRSTDIRDEF 0x0004
  3286. #define PRF_DONTFINDLNK 0x0008 // if PRF_TRYPROGRAMEXTENSIONS is specified
  3287. SHSTDAPI_(int) RestartDialog(HWND hwnd, LPCWSTR lpPrompt, DWORD dwReturn);
  3288. SHSTDAPI_(int) RestartDialogEx(HWND hwnd, LPCWSTR lpPrompt, DWORD dwReturn, DWORD dwReasonCode);
  3289. SHSTDAPI SHCoCreateInstance(LPCWSTR pszCLSID, const CLSID *pclsid, IUnknown *pUnkOuter, REFIID riid, void **ppv);
  3290. // For CallCPLEntry16
  3291. //
  3292. DECLARE_HANDLE(FARPROC16);
  3293. SHSTDAPI_(LRESULT) CallCPLEntry16(HINSTANCE hinst, FARPROC16 lpfnEntry, HWND hwndCPL, UINT msg, LPARAM lParam1, LPARAM lParam2);
  3294. SHSTDAPI SHCreateStdEnumFmtEtc(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **ppenumFormatEtc);
  3295. SHSTDAPI SHDoDragDrop(HWND hwnd, IDataObject *pdata, IDropSource *pdsrc, DWORD dwEffect, DWORD *pdwEffect);
  3296. // stuff for doing auto scrolling
  3297. #define NUM_POINTS 3
  3298. typedef struct { // asd
  3299. int iNextSample;
  3300. DWORD dwLastScroll;
  3301. BOOL bFull;
  3302. POINT pts[NUM_POINTS];
  3303. DWORD dwTimes[NUM_POINTS];
  3304. } AUTO_SCROLL_DATA;
  3305. SHSTDAPI_(BOOL) DAD_SetDragImage(HIMAGELIST him, POINT * pptOffset);
  3306. SHSTDAPI_(BOOL) DAD_DragEnterEx(HWND hwndTarget, const POINT ptStart);
  3307. SHSTDAPI_(BOOL) DAD_DragEnterEx2(HWND hwndTarget, const POINT ptStart, IDataObject *pdtObject);
  3308. SHSTDAPI_(BOOL) DAD_ShowDragImage(BOOL fShow);
  3309. SHSTDAPI_(BOOL) DAD_DragMove(POINT pt);
  3310. SHSTDAPI_(BOOL) DAD_DragLeave(void);
  3311. SHSTDAPI_(BOOL) DAD_AutoScroll(HWND hwnd, AUTO_SCROLL_DATA *pad, const POINT *pptNow);
  3312. typedef struct {
  3313. WORD cLength;
  3314. WORD nVersion;
  3315. BOOL fFullPathTitle : 1;
  3316. BOOL fSaveLocalView : 1;
  3317. BOOL fNotShell : 1;
  3318. BOOL fSimpleDefault : 1;
  3319. BOOL fDontShowDescBar : 1;
  3320. BOOL fNewWindowMode : 1;
  3321. BOOL fShowCompColor : 1; // NT: Show compressed volumes in a different colour
  3322. BOOL fDontPrettyNames : 1; // NT: Do 8.3 name conversion, or not!
  3323. BOOL fAdminsCreateCommonGroups : 1; // NT: Administrators create comon groups
  3324. UINT fUnusedFlags : 7;
  3325. UINT fMenuEnumFilter;
  3326. } CABINETSTATE, * LPCABINETSTATE;
  3327. #define CABINETSTATE_VERSION 2
  3328. // APIs for reading and writing the cabinet state.
  3329. SHSTDAPI_(BOOL) ReadCabinetState( LPCABINETSTATE lpState, int iSize );
  3330. SHSTDAPI_(BOOL) WriteCabinetState( LPCABINETSTATE lpState );
  3331. SHSTDAPI_(BOOL) PathMakeUniqueName(LPWSTR pszUniqueName, UINT cchMax, LPCWSTR pszTemplate, LPCWSTR pszLongPlate, LPCWSTR pszDir);
  3332. SHSTDAPI_(void) PathQualify(LPWSTR psz);
  3333. SHSTDAPI_(BOOL) PathIsExe(LPCWSTR pszPath);
  3334. SHSTDAPI_(BOOL) PathIsSlowA(LPCSTR pszFile, DWORD dwAttr);
  3335. SHSTDAPI_(BOOL) PathIsSlowW(LPCWSTR pszFile, DWORD dwAttr);
  3336. #ifdef UNICODE
  3337. #define PathIsSlow PathIsSlowW
  3338. #else
  3339. #define PathIsSlow PathIsSlowA
  3340. #endif // !UNICODE
  3341. //
  3342. // Return codes from PathCleanupSpec. Negative return values are
  3343. // unrecoverable errors
  3344. //
  3345. #define PCS_FATAL 0x80000000
  3346. #define PCS_REPLACEDCHAR 0x00000001
  3347. #define PCS_REMOVEDCHAR 0x00000002
  3348. #define PCS_TRUNCATED 0x00000004
  3349. #define PCS_PATHTOOLONG 0x00000008 // Always combined with FATAL
  3350. SHSTDAPI_(int) PathCleanupSpec(LPCWSTR pszDir, LPWSTR pszSpec);
  3351. SHSTDAPI_(int) PathResolve(LPWSTR pszPath, LPCWSTR dirs[], UINT fFlags);
  3352. SHSTDAPI_(BOOL) GetFileNameFromBrowse(HWND hwnd, LPWSTR pszFilePath, UINT cbFilePath,
  3353. LPCWSTR pszWorkingDir, LPCWSTR pszDefExt, LPCWSTR pszFilters, LPCWSTR pszTitle);
  3354. SHSTDAPI_(int) DriveType(int iDrive);
  3355. SHSTDAPI_(int) RealDriveType(int iDrive, BOOL fOKToHitNet);
  3356. SHSTDAPI_(int) IsNetDrive(int iDrive);
  3357. // Flags for Shell_MergeMenus
  3358. #define MM_ADDSEPARATOR 0x00000001L
  3359. #define MM_SUBMENUSHAVEIDS 0x00000002L
  3360. #define MM_DONTREMOVESEPS 0x00000004L
  3361. SHSTDAPI_(UINT) Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags);
  3362. /*
  3363. * The SHObjectProperties API provides an easy way to invoke
  3364. * the Properties context menu command on shell objects.
  3365. *
  3366. * PARAMETERS
  3367. *
  3368. * hwnd The window handle of the window which will own the dialog
  3369. * dwType A SHOP_ value as defined below
  3370. * lpObject Name of the object, see SHOP_ values below
  3371. * lpPage The name of the property sheet page to open to or NULL.
  3372. *
  3373. * RETURN
  3374. *
  3375. * TRUE if the Properties command was invoked
  3376. */
  3377. SHSTDAPI_(BOOL) SHObjectProperties(HWND hwnd, DWORD dwType, LPCWSTR lpObject, LPCWSTR lpPage);
  3378. #define SHOP_PRINTERNAME 0x00000001 // lpObject points to a printer friendly name
  3379. #define SHOP_FILEPATH 0x00000002 // lpObject points to a fully qualified path+file name
  3380. #define SHOP_VOLUMEGUID 0x00000004 // lpObject points to a Volume GUID
  3381. /*
  3382. * The SHFormatDrive API provides access to the Shell
  3383. * format dialog. This allows apps which want to format disks
  3384. * to bring up the same dialog that the Shell does to do it.
  3385. *
  3386. * This dialog is not sub-classable. You cannot put custom
  3387. * controls in it. If you want this ability, you will have
  3388. * to write your own front end for the DMaint_FormatDrive
  3389. * engine.
  3390. *
  3391. * NOTE that the user can format as many diskettes in the specified
  3392. * drive, or as many times, as he/she wishes to. There is no way to
  3393. * force any specififc number of disks to format. If you want this
  3394. * ability, you will have to write your own front end for the
  3395. * DMaint_FormatDrive engine.
  3396. *
  3397. * NOTE also that the format will not start till the user pushes the
  3398. * start button in the dialog. There is no way to do auto start. If
  3399. * you want this ability, you will have to write your own front end
  3400. * for the DMaint_FormatDrive engine.
  3401. *
  3402. * PARAMETERS
  3403. *
  3404. * hwnd = The window handle of the window which will own the dialog
  3405. * NOTE that unlike SHCheckDrive, hwnd == NULL does not cause
  3406. * this dialog to come up as a "top level application" window.
  3407. * This parameter should always be non-null, this dialog is
  3408. * only designed to be the child of another window, not a
  3409. * stand-alone application.
  3410. * drive = The 0 based (A: == 0) drive number of the drive to format
  3411. * fmtID = The ID of the physical format to format the disk with
  3412. * NOTE: The special value SHFMT_ID_DEFAULT means "use the
  3413. * default format specified by the DMaint_FormatDrive
  3414. * engine". If you want to FORCE a particular format
  3415. * ID "up front" you will have to call
  3416. * DMaint_GetFormatOptions yourself before calling
  3417. * this to obtain the valid list of phys format IDs
  3418. * (contents of the PhysFmtIDList array in the
  3419. * FMTINFOSTRUCT).
  3420. * options = There is currently only two option bits defined
  3421. *
  3422. * SHFMT_OPT_FULL
  3423. * SHFMT_OPT_SYSONLY
  3424. *
  3425. * The normal defualt in the Shell format dialog is
  3426. * "Quick Format", setting this option bit indicates that
  3427. * the caller wants to start with FULL format selected
  3428. * (this is useful for folks detecting "unformatted" disks
  3429. * and wanting to bring up the format dialog).
  3430. *
  3431. * The SHFMT_OPT_SYSONLY initializes the dialog to
  3432. * default to just sys the disk.
  3433. *
  3434. * All other bits are reserved for future expansion and
  3435. * must be 0.
  3436. *
  3437. * Please note that this is a bit field and not a value
  3438. * and treat it accordingly.
  3439. *
  3440. * RETURN
  3441. * The return is either one of the SHFMT_* values, or if the
  3442. * returned DWORD value is not == to one of these values, then
  3443. * the return is the physical format ID of the last succesful
  3444. * format. The LOWORD of this value can be passed on subsequent
  3445. * calls as the fmtID parameter to "format the same type you did
  3446. * last time".
  3447. *
  3448. */
  3449. SHSTDAPI_(DWORD) SHFormatDrive(HWND hwnd, UINT drive, UINT fmtID, UINT options);
  3450. //
  3451. // Special value of fmtID which means "use the default format"
  3452. //
  3453. #define SHFMT_ID_DEFAULT 0xFFFF
  3454. //
  3455. // Option bits for options parameter
  3456. //
  3457. #define SHFMT_OPT_FULL 0x0001
  3458. #define SHFMT_OPT_SYSONLY 0x0002
  3459. //
  3460. // Special return values. PLEASE NOTE that these are DWORD values.
  3461. //
  3462. #define SHFMT_ERROR 0xFFFFFFFFL // Error on last format, drive may be formatable
  3463. #define SHFMT_CANCEL 0xFFFFFFFEL // Last format was canceled
  3464. #define SHFMT_NOFORMAT 0xFFFFFFFDL // Drive is not formatable
  3465. #ifndef HPSXA_DEFINED
  3466. #define HPSXA_DEFINED
  3467. DECLARE_HANDLE( HPSXA );
  3468. #endif
  3469. WINSHELLAPI HPSXA SHCreatePropSheetExtArray( HKEY hKey, LPCWSTR pszSubKey, UINT max_iface );
  3470. WINSHELLAPI void SHDestroyPropSheetExtArray( HPSXA hpsxa );
  3471. WINSHELLAPI UINT SHAddFromPropSheetExtArray( HPSXA hpsxa, LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam );
  3472. WINSHELLAPI UINT SHReplaceFromPropSheetExtArray( HPSXA hpsxa, UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam );
  3473. SHSTDAPI_(LPITEMIDLIST) ILClone(LPCITEMIDLIST pidl);
  3474. SHSTDAPI_(LPITEMIDLIST) ILGetNext(LPCITEMIDLIST pidl);
  3475. SHSTDAPI_(UINT) ILGetSize(LPCITEMIDLIST pidl);
  3476. SHSTDAPI_(LPITEMIDLIST) ILFindLastID(LPCITEMIDLIST pidl);
  3477. SHSTDAPI_(BOOL) ILRemoveLastID(LPITEMIDLIST pidl);
  3478. SHSTDAPI_(LPITEMIDLIST) ILAppendID(LPITEMIDLIST pidl, LPCSHITEMID pmkid, BOOL fAppend);
  3479. SHSTDAPI_(void) ILFree(LPITEMIDLIST pidl);
  3480. SHSTDAPI_(LPITEMIDLIST) ILCloneFirst(LPCITEMIDLIST pidl);
  3481. SHSTDAPI_(BOOL) ILIsEqual(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  3482. SHSTDAPI_(BOOL) ILIsParent(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, BOOL fImmediate);
  3483. SHSTDAPI_(LPITEMIDLIST) ILFindChild(LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidlChild);
  3484. SHSTDAPI_(LPITEMIDLIST) ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2);
  3485. SHSTDAPI ILLoadFromStream(IStream *pstm, LPITEMIDLIST *pidl);
  3486. SHSTDAPI ILSaveToStream(IStream *pstm, LPCITEMIDLIST pidl);
  3487. #if (_WIN32_IE >= 0x0400)
  3488. SHSTDAPI_(LPITEMIDLIST) ILCreateFromPathA(LPCSTR pszPath);
  3489. SHSTDAPI_(LPITEMIDLIST) ILCreateFromPathW(LPCWSTR pszPath);
  3490. #ifdef NO_WRAPPERS_FOR_ILCREATEFROMPATH
  3491. SHSTDAPI_(LPITEMIDLIST) ILCreateFromPath(LPCTSTR pszPath);
  3492. #else
  3493. #ifdef UNICODE
  3494. #define ILCreateFromPath ILCreateFromPathW
  3495. #else
  3496. #define ILCreateFromPath ILCreateFromPathA
  3497. #endif // !UNICODE
  3498. #endif
  3499. #endif
  3500. SHSTDAPI SHILCreateFromPath(LPCWSTR szPath, LPITEMIDLIST *ppidl, DWORD *rgfInOut);
  3501. #undef INTERFACE
  3502. #define INTERFACE IDefViewFrame
  3503. DECLARE_INTERFACE_(IDefViewFrame, IUnknown)
  3504. {
  3505. // *** IUnknown methods ***
  3506. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3507. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3508. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3509. // *** IDefViewFrame methods ***
  3510. STDMETHOD(GetWindowLV) (THIS_ HWND * phwnd) PURE;
  3511. STDMETHOD(ReleaseWindowLV) (THIS) PURE;
  3512. STDMETHOD(GetShellFolder)(THIS_ IShellFolder **ppsf) PURE;
  3513. };
  3514. //===========================================================================
  3515. // Shell restrictions. (Parameter for SHRestricted)
  3516. typedef enum RESTRICTIONS
  3517. {
  3518. REST_NONE = 0x00000000,
  3519. REST_NORUN = 0x00000001,
  3520. REST_NOCLOSE = 0x00000002,
  3521. REST_NOSAVESET = 0x00000004,
  3522. REST_NOFILEMENU = 0x00000008,
  3523. REST_NOSETFOLDERS = 0x00000010,
  3524. REST_NOSETTASKBAR = 0x00000020,
  3525. REST_NODESKTOP = 0x00000040,
  3526. REST_NOFIND = 0x00000080,
  3527. REST_NODRIVES = 0x00000100,
  3528. REST_NODRIVEAUTORUN = 0x00000200,
  3529. REST_NODRIVETYPEAUTORUN = 0x00000400,
  3530. REST_NONETHOOD = 0x00000800,
  3531. REST_STARTBANNER = 0x00001000,
  3532. REST_RESTRICTRUN = 0x00002000,
  3533. REST_NOPRINTERTABS = 0x00004000,
  3534. REST_NOPRINTERDELETE = 0x00008000,
  3535. REST_NOPRINTERADD = 0x00010000,
  3536. REST_NOSTARTMENUSUBFOLDERS = 0x00020000,
  3537. REST_MYDOCSONNET = 0x00040000,
  3538. REST_NOEXITTODOS = 0x00080000,
  3539. REST_ENFORCESHELLEXTSECURITY = 0x00100000,
  3540. REST_LINKRESOLVEIGNORELINKINFO = 0x00200000,
  3541. REST_NOCOMMONGROUPS = 0x00400000,
  3542. REST_SEPARATEDESKTOPPROCESS = 0x00800000,
  3543. REST_NOWEB = 0x01000000,
  3544. REST_NOTRAYCONTEXTMENU = 0x02000000,
  3545. REST_NOVIEWCONTEXTMENU = 0x04000000,
  3546. REST_NONETCONNECTDISCONNECT = 0x08000000,
  3547. REST_STARTMENULOGOFF = 0x10000000,
  3548. REST_NOSETTINGSASSIST = 0x20000000,
  3549. REST_NOINTERNETICON = 0x40000001,
  3550. REST_NORECENTDOCSHISTORY = 0x40000002,
  3551. REST_NORECENTDOCSMENU = 0x40000003,
  3552. REST_NOACTIVEDESKTOP = 0x40000004,
  3553. REST_NOACTIVEDESKTOPCHANGES = 0x40000005,
  3554. REST_NOFAVORITESMENU = 0x40000006,
  3555. REST_CLEARRECENTDOCSONEXIT = 0x40000007,
  3556. REST_CLASSICSHELL = 0x40000008,
  3557. REST_NOCUSTOMIZEWEBVIEW = 0x40000009,
  3558. REST_NOHTMLWALLPAPER = 0x40000010,
  3559. REST_NOCHANGINGWALLPAPER = 0x40000011,
  3560. REST_NODESKCOMP = 0x40000012,
  3561. REST_NOADDDESKCOMP = 0x40000013,
  3562. REST_NODELDESKCOMP = 0x40000014,
  3563. REST_NOCLOSEDESKCOMP = 0x40000015,
  3564. REST_NOCLOSE_DRAGDROPBAND = 0x40000016, // Disable Close and Drag & Drop on ALL Bands
  3565. REST_NOMOVINGBAND = 0x40000017, // Disable Moving ALL Bands
  3566. REST_NOEDITDESKCOMP = 0x40000018,
  3567. REST_NORESOLVESEARCH = 0x40000019,
  3568. REST_NORESOLVETRACK = 0x4000001A,
  3569. REST_FORCECOPYACLWITHFILE = 0X4000001B,
  3570. REST_NOLOGO3CHANNELNOTIFY = 0x4000001C,
  3571. REST_NOFORGETSOFTWAREUPDATE = 0x4000001D,
  3572. REST_NOSETACTIVEDESKTOP = 0x4000001E, // No Active desktop on Settings Menu
  3573. REST_NOUPDATEWINDOWS = 0x4000001F, // No Windows Update on Settings Menu
  3574. REST_NOCHANGESTARMENU = 0x40000020, // No Context menu or Drag and Drop on Start menu
  3575. REST_NOFOLDEROPTIONS = 0x40000021, // No Folder Options on Settings Menu
  3576. REST_HASFINDCOMPUTERS = 0x40000022, // Show Start/Search/Computers
  3577. REST_INTELLIMENUS = 0x40000023,
  3578. REST_RUNDLGMEMCHECKBOX = 0x40000024,
  3579. REST_ARP_ShowPostSetup = 0x40000025, // ARP: Show Post-Setup page
  3580. REST_NOCSC = 0x40000026, // Disable the ClientSide caching on SM
  3581. REST_NOCONTROLPANEL = 0x40000027, // Remove the Control Panel only from SM|Settings
  3582. REST_ENUMWORKGROUP = 0x40000028, // Enumerate workgroup in root of nethood
  3583. REST_ARP_NOARP = 0x40000029, // ARP: Don't Allow ARP to come up at all
  3584. REST_ARP_NOREMOVEPAGE = 0x4000002A, // ARP: Don't allow Remove page
  3585. REST_ARP_NOADDPAGE = 0x4000002B, // ARP: Don't allow Add page
  3586. REST_ARP_NOWINSETUPPAGE = 0x4000002C, // ARP: Don't allow opt components page
  3587. REST_GREYMSIADS = 0x4000002D, // SM: Allow the greying of Darwin Ads in SM
  3588. REST_NOCHANGEMAPPEDDRIVELABEL = 0x4000002E, // Don't enable the UI which allows users to rename mapped drive labels
  3589. REST_NOCHANGEMAPPEDDRIVECOMMENT = 0x4000002F, // Don't enable the UI which allows users to change mapped drive comments
  3590. REST_MaxRecentDocs = 0x40000030,
  3591. REST_NONETWORKCONNECTIONS = 0x40000031, // No Start Menu | Settings |Network Connections
  3592. REST_FORCESTARTMENULOGOFF = 0x40000032, // Force logoff on the Start Menu
  3593. REST_NOWEBVIEW = 0x40000033, // Disable Web View
  3594. REST_NOCUSTOMIZETHISFOLDER = 0x40000034, // Disable Customize This Folder
  3595. REST_NOENCRYPTION = 0x40000035, // Don't allow file encryption
  3596. // Do NOT use me 0x40000036,
  3597. REST_DONTSHOWSUPERHIDDEN = 0x40000037, // don't show super hidden files
  3598. REST_NOSHELLSEARCHBUTTON = 0x40000038,
  3599. REST_NOHARDWARETAB = 0x40000039, // No Hardware tab on Drives or in control panel
  3600. REST_NORUNASINSTALLPROMPT = 0x4000003A, // Don't bring up "Run As" prompt for install programs
  3601. REST_PROMPTRUNASINSTALLNETPATH = 0x4000003B, // Force the "Run As" prompt for install programs on unc/network shares
  3602. REST_NOMANAGEMYCOMPUTERVERB = 0x4000003C, // No Manage verb on My Computer
  3603. REST_NORECENTDOCSNETHOOD = 0x4000003D, // dont add the recent docs shares to nethood
  3604. REST_DISALLOWRUN = 0x4000003E, // don't allow certain apps to be run
  3605. REST_NOWELCOMESCREEN = 0x4000003F, // don't allow the welcome screen to be displayed.
  3606. REST_RESTRICTCPL = 0x40000040, // only allow certain cpls to be run
  3607. REST_DISALLOWCPL = 0x40000041, // don't allow certain cpls to be run
  3608. REST_NOSMBALLOONTIP = 0x40000042, // No Start Menu Balloon Tip
  3609. REST_NOSMHELP = 0x40000043, // No Help on the Start Menu
  3610. REST_NOWINKEYS = 0x40000044, // No Windows-X Hot keys
  3611. REST_NOENCRYPTONMOVE = 0x40000045, // Don't automatically try to encrypt files that are moved to encryped directories
  3612. REST_NOLOCALMACHINERUN = 0x40000046, // ignore HKLM\sw\ms\win\cv\Run and all of it's sub keys
  3613. REST_NOCURRENTUSERRUN = 0x40000047, // ignore HKCU\sw\ms\win\cv\Run and all of it's sub keys
  3614. REST_NOLOCALMACHINERUNONCE = 0x40000048, // ignore HKLM\sw\ms\win\cv\RunOnce and all of it's sub keys
  3615. REST_NOCURRENTUSERRUNONCE = 0x40000049, // ignore HKCU\sw\ms\win\cv\RunOnce and all of it's sub keys
  3616. REST_FORCEACTIVEDESKTOPON = 0x4000004A, // Force ActiveDesktop to be turned ON all the time.
  3617. REST_NOCOMPUTERSNEARME = 0x4000004B, // removes the "Computers near me" link
  3618. REST_NOVIEWONDRIVE = 0x4000004C, // disallows CreateViewObject() on specified drives (CFSFolder only)
  3619. REST_NONETCRAWL = 0x4000004D, // disables the crawling of the WNet namespace.
  3620. REST_NOSHAREDDOCUMENTS = 0x4000004E, // don't auto share the Shared Documents/create link
  3621. REST_NOSMMYDOCS = 0x4000004F, // Don't show the My Documents item on the Start Menu.
  3622. REST_NOSMMYPICS = 0x40000050, // Don't show the My Pictures item on the Start Menu
  3623. REST_ALLOWBITBUCKDRIVES = 0x40000051, // Bit mask indicating which which drives have bit bucket support
  3624. REST_NONLEGACYSHELLMODE = 0x40000052, // new consumer shell modes
  3625. REST_NOCONTROLPANELBARRICADE = 0x40000053, // The webview barricade in Control Panel
  3626. REST_NOSTARTPAGE = 0x40000054, // Whistler Start Page on desktop.
  3627. REST_NOAUTOTRAYNOTIFY = 0x40000055, // Whistler auto-tray notify feature
  3628. REST_NOTASKGROUPING = 0x40000056, // Whistler taskbar button grouping feature
  3629. REST_NOCDBURNING = 0x40000057, // whistler cd burning feature
  3630. REST_MYCOMPNOPROP = 0x40000058, // disables Properties on My Computer's context menu
  3631. REST_MYDOCSNOPROP = 0x40000059, // disables Properties on My Documents' context menu
  3632. REST_NOSTARTPANEL = 0x4000005A, // Windows start panel (New start menu) for Whistler.
  3633. REST_NODISPLAYAPPEARANCEPAGE = 0x4000005B, // disable Themes and Appearance tabs in the Display Control Panel.
  3634. REST_NOTHEMESTAB = 0x4000005C, // disable the Themes tab in the Display Control Panel.
  3635. REST_NOVISUALSTYLECHOICE = 0x4000005D, // disable the visual style drop down in the Appearance tab of the Display Control Panel.
  3636. REST_NOSIZECHOICE = 0x4000005E, // disable the size drop down in the Appearance tab of the Display Control Panel.
  3637. REST_NOCOLORCHOICE = 0x4000005F, // disable the color drop down in the Appearance tab of the Display Control Panel.
  3638. REST_SETVISUALSTYLE = 0x40000060, // Load the specified file as the visual style.
  3639. REST_STARTRUNNOHOMEPATH = 0x40000061, // dont use the %HOMEPATH% env var for the Start-Run dialog
  3640. REST_NOUSERNAMEINSTARTPANEL = 0x40000062, // don't show the username is the startpanel.
  3641. REST_NOMYCOMPUTERICON = 0x40000063, // don't show my computer anywhere, hide its contents
  3642. REST_NOSMNETWORKPLACES = 0x40000064, // don't show network places in startpanel.
  3643. REST_NOSMPINNEDLIST = 0x40000065, // don't show the pinned list in startpanel.
  3644. REST_NOSMMYMUSIC = 0x40000066, // don't show MyMusic folder in startpanel
  3645. REST_NOSMEJECTPC = 0x40000067, // don't show "Undoc PC" command in startmenu
  3646. REST_NOSMMOREPROGRAMS = 0x40000068, // don't show "More Programs" button in StartPanel.
  3647. REST_NOSMMFUPROGRAMS = 0x40000069, // don't show the MFU programs list in StartPanel.
  3648. REST_NOTRAYITEMSDISPLAY = 0x4000006A, // disables the display of the system tray
  3649. REST_NOTOOLBARSONTASKBAR = 0x4000006B, // disables toolbar display on the taskbar
  3650. REST_NOSMCONFIGUREPROGRAMS = 0x4000006F, // No Configure Programs on Settings Menu
  3651. REST_HIDECLOCK = 0x40000070, // don't show the clock
  3652. REST_NOLOWDISKSPACECHECKS = 0x40000071, // disable the low disk space checking
  3653. REST_NOENTIRENETWORK = 0x40000072, // removes the "Entire Network" link (i.e. from "My Network Places")
  3654. REST_NODESKTOPCLEANUP = 0x40000073, // disable the desktop cleanup wizard
  3655. REST_BITBUCKNUKEONDELETE = 0x40000074, // disables recycling of files
  3656. REST_BITBUCKCONFIRMDELETE = 0x40000075, // always show the delete confirmation dialog when deleting files
  3657. REST_BITBUCKNOPROP = 0x40000076, // disables Properties on Recycle Bin's context menu
  3658. REST_NODISPBACKGROUND = 0x40000077, // disables the Desktop tab in the Display CPL
  3659. REST_NODISPSCREENSAVEPG = 0x40000078, // disables the Screen Saver tab in the Display CPL
  3660. REST_NODISPSETTINGSPG = 0x40000079, // disables the Settings tab in the Display CPL
  3661. REST_NODISPSCREENSAVEPREVIEW = 0x4000007A, // disables the screen saver on the Screen Saver tab in the Display CPL
  3662. REST_NODISPLAYCPL = 0x4000007B, // disables the Display CPL
  3663. REST_HIDERUNASVERB = 0x4000007C, // hides the "Run As..." context menu item
  3664. REST_NOTHUMBNAILCACHE = 0x4000007D, // disables use of the thumbnail cache
  3665. REST_NOSTRCMPLOGICAL = 0x4000007E, // dont use StrCmpLogical() instead use default CompareString()
  3666. REST_NOPUBLISHWIZARD = 0x4000007F, // disables publishing wizard (WPW)
  3667. REST_NOONLINEPRINTSWIZARD = 0x40000080, // disables online prints wizard (OPW)
  3668. REST_NOWEBSERVICES = 0x40000081, // disables the web specified services for both OPW and WPW
  3669. 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
  3670. REST_ALLOWLEGACYWEBVIEW = 0x40000083, // allow legacy webview template to be shown.
  3671. REST_REVERTWEBVIEWSECURITY = 0x40000084, // disable added webview security measures (revert to w2k functionality).
  3672. REST_INHERITCONSOLEHANDLES = 0x40000086, // ShellExec() will check for the current process and target process being console processes to inherit handles
  3673. REST_NODISCONNECT = 0x41000001, // No Disconnect option in Start menu
  3674. REST_NOSECURITY = 0x41000002, // No Security option in start menu
  3675. REST_NOFILEASSOCIATE = 0x41000003, // Do not allow user to change file association
  3676. } RESTRICTIONS;
  3677. SHSTDAPI_(IStream *) OpenRegStream(HKEY hkey, LPCWSTR pszSubkey, LPCWSTR pszValue, DWORD grfMode);
  3678. SHSTDAPI_(BOOL) SHFindFiles(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile);
  3679. SHSTDAPI_(void) PathGetShortPath(LPWSTR pszLongPath);
  3680. SHSTDAPI_(BOOL) PathYetAnotherMakeUniqueName(LPWSTR pszUniqueName, LPCWSTR pszPath, LPCWSTR pszShort, LPCWSTR pszFileSpec);
  3681. SHSTDAPI_(BOOL) Win32DeleteFile(LPCWSTR pszPath);
  3682. //
  3683. // Path processing function
  3684. //
  3685. #define PPCF_ADDQUOTES 0x00000001 // return a quoted name if required
  3686. #define PPCF_ADDARGUMENTS 0x00000003 // appends arguments (and wraps in quotes if required)
  3687. #define PPCF_NODIRECTORIES 0x00000010 // don't match to directories
  3688. #define PPCF_FORCEQUALIFY 0x00000040 // qualify even non-relative names
  3689. #define PPCF_LONGESTPOSSIBLE 0x00000080 // always find the longest possible name
  3690. SHSTDAPI_(LONG) PathProcessCommand(LPCWSTR lpSrc, LPWSTR lpDest, int iMax, DWORD dwFlags);
  3691. SHSTDAPI_(DWORD) SHRestricted(RESTRICTIONS rest);
  3692. SHSTDAPI_(BOOL) SignalFileOpen(LPCITEMIDLIST pidl);
  3693. SHSTDAPI_(LPITEMIDLIST) SHSimpleIDListFromPath(LPCWSTR pszPath);
  3694. SHSTDAPI SHLoadOLE(LPARAM lParam);
  3695. SHSTDAPI SHStartNetConnectionDialogA(HWND hwnd, LPCSTR pszRemoteName, DWORD dwType);
  3696. SHSTDAPI SHStartNetConnectionDialogW(HWND hwnd, LPCWSTR pszRemoteName, DWORD dwType);
  3697. #ifdef UNICODE
  3698. #define SHStartNetConnectionDialog SHStartNetConnectionDialogW
  3699. #else
  3700. #define SHStartNetConnectionDialog SHStartNetConnectionDialogA
  3701. #endif // !UNICODE
  3702. SHSTDAPI SHDefExtractIconA(LPCSTR pszIconFile, int iIndex, UINT uFlags,
  3703. HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
  3704. SHSTDAPI SHDefExtractIconW(LPCWSTR pszIconFile, int iIndex, UINT uFlags,
  3705. HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize);
  3706. #ifdef UNICODE
  3707. #define SHDefExtractIcon SHDefExtractIconW
  3708. #else
  3709. #define SHDefExtractIcon SHDefExtractIconA
  3710. #endif // !UNICODE
  3711. SHSTDAPI_(BOOL) Shell_GetImageLists(HIMAGELIST *phiml, HIMAGELIST *phimlSmall);
  3712. SHSTDAPI_(int) Shell_GetCachedImageIndex(LPCWSTR pszIconPath, int iIconIndex, UINT uIconFlags);
  3713. //
  3714. // IDocViewSite
  3715. //
  3716. #undef INTERFACE
  3717. #define INTERFACE IDocViewSite
  3718. DECLARE_INTERFACE_(IDocViewSite, IUnknown)
  3719. {
  3720. // *** IUnknown methods ***
  3721. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3722. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  3723. STDMETHOD_(ULONG,Release)(THIS) PURE;
  3724. // *** IDocViewSite methods ***
  3725. STDMETHOD(OnSetTitle) (THIS_ VARIANTARG *pvTitle) PURE;
  3726. } ;
  3727. #define VALIDATEUNC_NOUI 0x0002 // don't bring up UI
  3728. #define VALIDATEUNC_CONNECT 0x0001 // connect a drive letter
  3729. #define VALIDATEUNC_PRINT 0x0004 // validate as print share instead of disk share
  3730. #define VALIDATEUNC_VALID 0x0007 // valid flags
  3731. SHSTDAPI_(BOOL) SHValidateUNC(HWND hwndOwner, LPWSTR pszFile, UINT fConnect);
  3732. #define OPENPROPS_NONE 0x0000
  3733. #define OPENPROPS_INHIBITPIF 0x8000
  3734. #define GETPROPS_NONE 0x0000
  3735. #define SETPROPS_NONE 0x0000
  3736. #define CLOSEPROPS_NONE 0x0000
  3737. #define CLOSEPROPS_DISCARD 0x0001
  3738. #define PIFNAMESIZE 30
  3739. #define PIFSTARTLOCSIZE 63
  3740. #define PIFDEFPATHSIZE 64
  3741. #define PIFPARAMSSIZE 64
  3742. #define PIFSHPROGSIZE 64
  3743. #define PIFSHDATASIZE 64
  3744. #define PIFDEFFILESIZE 80
  3745. #define PIFMAXFILEPATH 260
  3746. typedef struct PROPPRG { /* prg */
  3747. WORD flPrg; // see PRG_ flags
  3748. WORD flPrgInit; // see PRGINIT_ flags
  3749. CHAR achTitle[PIFNAMESIZE]; // name[30]
  3750. CHAR achCmdLine[PIFSTARTLOCSIZE+PIFPARAMSSIZE+1];// startfile[63] + params[64]
  3751. CHAR achWorkDir[PIFDEFPATHSIZE]; // defpath[64]
  3752. WORD wHotKey; // PfHotKeyScan thru PfHotKeyVal
  3753. CHAR achIconFile[PIFDEFFILESIZE]; // name of file containing icon
  3754. WORD wIconIndex; // index of icon within file
  3755. DWORD dwEnhModeFlags; // reserved enh-mode flags
  3756. DWORD dwRealModeFlags; // real-mode flags (see RMOPT_*)
  3757. CHAR achOtherFile[PIFDEFFILESIZE]; // name of "other" file in directory
  3758. CHAR achPIFFile[PIFMAXFILEPATH]; // name of PIF file
  3759. } PROPPRG;
  3760. typedef UNALIGNED PROPPRG *PPROPPRG;
  3761. typedef UNALIGNED PROPPRG FAR *LPPROPPRG;
  3762. typedef const UNALIGNED PROPPRG FAR *LPCPROPPRG;
  3763. SHSTDAPI_(HANDLE) PifMgr_OpenProperties(LPCWSTR pszApp, LPCWSTR pszPIF, UINT hInf, UINT flOpt);
  3764. SHSTDAPI_(int) PifMgr_GetProperties(HANDLE hProps, LPCSTR pszGroup, void *lpProps, int cbProps, UINT flOpt);
  3765. SHSTDAPI_(int) PifMgr_SetProperties(HANDLE hProps, LPCSTR pszGroup, const VOID *lpProps, int cbProps, UINT flOpt);
  3766. SHSTDAPI_(HANDLE) PifMgr_CloseProperties(HANDLE hProps, UINT flOpt);
  3767. SHSTDAPI_(void) SHSetInstanceExplorer(IUnknown *punk);
  3768. SHSTDAPI_(BOOL) IsUserAnAdmin(void);
  3769. #undef INTERFACE
  3770. #define INTERFACE IInitializeObject
  3771. DECLARE_INTERFACE_(IInitializeObject, IUnknown)
  3772. {
  3773. // *** IUnknown methods ***
  3774. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3775. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3776. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3777. // *** IInitializeObject methods
  3778. STDMETHOD(Initialize)(THIS) PURE;
  3779. };
  3780. enum
  3781. {
  3782. BMICON_LARGE = 0,
  3783. BMICON_SMALL
  3784. };
  3785. #undef INTERFACE
  3786. #define INTERFACE IBanneredBar
  3787. DECLARE_INTERFACE_(IBanneredBar, IUnknown)
  3788. {
  3789. // *** IUnknown methods ***
  3790. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3791. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3792. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3793. // *** IBanneredBar methods ***
  3794. STDMETHOD(SetIconSize)(THIS_ DWORD iIcon) PURE;
  3795. STDMETHOD(GetIconSize)(THIS_ DWORD* piIcon) PURE;
  3796. STDMETHOD(SetBitmap)(THIS_ HBITMAP hBitmap) PURE;
  3797. STDMETHOD(GetBitmap)(THIS_ HBITMAP* phBitmap) PURE;
  3798. };
  3799. SHSTDAPI_(LRESULT) SHShellFolderView_Message(HWND hwndMain, UINT uMsg, LPARAM lParam);
  3800. //
  3801. // Callback interface for the IShellFolderView
  3802. //
  3803. #undef INTERFACE
  3804. #define INTERFACE IShellFolderViewCB
  3805. DECLARE_INTERFACE_(IShellFolderViewCB, IUnknown)
  3806. {
  3807. // *** IUnknown methods ***
  3808. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3809. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3810. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3811. // *** IShellFolderViewCB methods ***
  3812. STDMETHOD(MessageSFVCB)(THIS_ UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  3813. };
  3814. #include <pshpack8.h>
  3815. #undef UNSIZED_ARRAY2
  3816. #undef EMPTY_SIZE2
  3817. #define UNSIZED_ARRAY2
  3818. #define EMPTY_SIZE2 UNSIZED_ARRAY2
  3819. #define QCMINFO_PLACE_BEFORE 0
  3820. #define QCMINFO_PLACE_AFTER 1
  3821. typedef struct _QCMINFO_IDMAP_PLACEMENT
  3822. {
  3823. UINT id;
  3824. UINT fFlags;
  3825. } QCMINFO_IDMAP_PLACEMENT;
  3826. typedef struct _QCMINFO_IDMAP
  3827. {
  3828. UINT nMaxIds;
  3829. QCMINFO_IDMAP_PLACEMENT pIdList[1];
  3830. } QCMINFO_IDMAP;
  3831. typedef struct _QCMINFO
  3832. {
  3833. HMENU hmenu; // in
  3834. UINT indexMenu; // in
  3835. UINT idCmdFirst; // in/out
  3836. UINT idCmdLast; // in
  3837. QCMINFO_IDMAP const* pIdMap; // in / unused
  3838. } QCMINFO;
  3839. typedef QCMINFO * LPQCMINFO;
  3840. // TBINFO flags
  3841. #define TBIF_APPEND 0
  3842. #define TBIF_PREPEND 1
  3843. #define TBIF_REPLACE 2
  3844. #define TBIF_DEFAULT 0x00000000
  3845. #define TBIF_INTERNETBAR 0x00010000
  3846. #define TBIF_STANDARDTOOLBAR 0x00020000
  3847. #define TBIF_NOTOOLBAR 0x00030000
  3848. typedef struct _TBINFO
  3849. {
  3850. UINT cbuttons; // out
  3851. UINT uFlags; // out (one of TBIF_ flags)
  3852. } TBINFO;
  3853. typedef struct _DETAILSINFO
  3854. {
  3855. LPCITEMIDLIST pidl;
  3856. int fmt;
  3857. int cxChar;
  3858. STRRET str;
  3859. int iImage;
  3860. } DETAILSINFO;
  3861. typedef struct _SFVM_PROPPAGE_DATA
  3862. {
  3863. DWORD dwReserved;
  3864. LPFNADDPROPSHEETPAGE pfn;
  3865. LPARAM lParam;
  3866. } SFVM_PROPPAGE_DATA;
  3867. typedef struct _SFVM_HELPTOPIC_DATA
  3868. {
  3869. WCHAR wszHelpFile[MAX_PATH];
  3870. WCHAR wszHelpTopic[MAX_PATH];
  3871. } SFVM_HELPTOPIC_DATA;
  3872. // uMsg wParam lParam
  3873. #define SFVM_MERGEMENU 1 // - LPQCMINFO
  3874. #define SFVM_INVOKECOMMAND 2 // idCmd -
  3875. #define SFVM_GETHELPTEXT 3 // idCmd,cchMax pszText
  3876. #define SFVM_GETTOOLTIPTEXT 4 // idCmd,cchMax pszText
  3877. #define SFVM_GETBUTTONINFO 5 // - LPTBINFO
  3878. #define SFVM_GETBUTTONS 6 // idCmdFirst,cbtnMax LPTBBUTTON
  3879. #define SFVM_INITMENUPOPUP 7 // idCmdFirst,nIndex hmenu
  3880. #define SFVM_FSNOTIFY 14 // LPCITEMIDLIST* lEvent
  3881. #define SFVM_WINDOWCREATED 15 // hwnd -
  3882. #define SFVM_GETDETAILSOF 23 // iColumn DETAILSINFO*
  3883. #define SFVM_COLUMNCLICK 24 // iColumn -
  3884. #define SFVM_QUERYFSNOTIFY 25 // - SHChangeNotifyEntry *
  3885. #define SFVM_DEFITEMCOUNT 26 // - UINT*
  3886. #define SFVM_DEFVIEWMODE 27 // - FOLDERVIEWMODE*
  3887. #define SFVM_UNMERGEMENU 28 // - hmenu
  3888. #define SFVM_UPDATESTATUSBAR 31 // fInitialize -
  3889. #define SFVM_BACKGROUNDENUM 32 // - -
  3890. #define SFVM_DIDDRAGDROP 36 // dwEffect IDataObject *
  3891. #define SFVM_SETISFV 39 // - IShellFolderView*
  3892. #define SFVM_THISIDLIST 41 // - LPITMIDLIST*
  3893. #define SFVM_ADDPROPERTYPAGES 47 // - SFVM_PROPPAGE_DATA *
  3894. #define SFVM_BACKGROUNDENUMDONE 48 // - -
  3895. #define SFVM_GETNOTIFY 49 // LPITEMIDLIST* LONG*
  3896. #define SFVM_GETSORTDEFAULTS 53 // iDirection iParamSort
  3897. #define SFVM_SIZE 57 // - -
  3898. #define SFVM_GETZONE 58 // - DWORD*
  3899. #define SFVM_GETPANE 59 // Pane ID DWORD*
  3900. #define SFVM_GETHELPTOPIC 63 // - SFVM_HELPTOPIC_DATA *
  3901. #define SFVM_GETANIMATION 68 // HINSTANCE * WCHAR *
  3902. // SHCreateShellFolderView struct
  3903. typedef struct _SFV_CREATE
  3904. {
  3905. UINT cbSize;
  3906. IShellFolder* pshf;
  3907. IShellView* psvOuter;
  3908. IShellFolderViewCB* psfvcb; // No callback if NULL
  3909. } SFV_CREATE;
  3910. SHSTDAPI SHCreateShellFolderView(const SFV_CREATE* pcsfv, IShellView **ppsv);
  3911. typedef HRESULT (CALLBACK * LPFNDFMCALLBACK)(IShellFolder *psf, HWND hwnd,
  3912. IDataObject *pdtobj, UINT uMsg, WPARAM wParam, LPARAM lParam);
  3913. SHSTDAPI CDefFolderMenu_Create2(LPCITEMIDLIST pidlFolder, HWND hwnd,
  3914. UINT cidl, LPCITEMIDLIST *apidl,
  3915. IShellFolder *psf, LPFNDFMCALLBACK lpfn,
  3916. UINT nKeys, const HKEY *ahkeyClsKeys,
  3917. IContextMenu **ppcm);
  3918. SHSTDAPI_(BOOL) SHOpenPropSheetA(LPCSTR pszCaption, HKEY ahkeys[], UINT cikeys,
  3919. const CLSID * pclsidDefault, IDataObject *pdtobj,
  3920. IShellBrowser *psb, LPCSTR pStartPage);
  3921. SHSTDAPI_(BOOL) SHOpenPropSheetW(LPCWSTR pszCaption, HKEY ahkeys[], UINT cikeys,
  3922. const CLSID * pclsidDefault, IDataObject *pdtobj,
  3923. IShellBrowser *psb, LPCWSTR pStartPage);
  3924. #ifdef UNICODE
  3925. #define SHOpenPropSheet SHOpenPropSheetW
  3926. #else
  3927. #define SHOpenPropSheet SHOpenPropSheetA
  3928. #endif // !UNICODE
  3929. // uMsg wParam lParam
  3930. #define DFM_MERGECONTEXTMENU 1 // uFlags LPQCMINFO
  3931. #define DFM_INVOKECOMMAND 2 // idCmd pszArgs
  3932. #define DFM_GETDEFSTATICID 14 // idCmd * 0
  3933. // Commands from DFM_INVOKECOMMAND when strings are passed in
  3934. #define DFM_CMD_PROPERTIES ((UINT)-5)
  3935. typedef TBINFO * LPTBINFO;
  3936. typedef DETAILSINFO *PDETAILSINFO;
  3937. typedef HRESULT (CALLBACK * LPFNVIEWCALLBACK)(IShellView *psvOuter,
  3938. IShellFolder *psf,
  3939. HWND hwndMain,
  3940. UINT uMsg,
  3941. WPARAM wParam,
  3942. LPARAM lParam);
  3943. // SHCreateShellFolderViewEx struct
  3944. typedef struct _CSFV
  3945. {
  3946. UINT cbSize;
  3947. IShellFolder * pshf;
  3948. IShellView * psvOuter;
  3949. LPCITEMIDLIST pidl;
  3950. LONG lEvents;
  3951. LPFNVIEWCALLBACK pfnCallback; // No callback if NULL
  3952. FOLDERVIEWMODE fvm;
  3953. } CSFV, * LPCSFV;
  3954. // Tell the FolderView to rearrange. The lParam will be passed to
  3955. // IShellFolder::CompareIDs
  3956. #define SFVM_REARRANGE 0x00000001
  3957. #define ShellFolderView_ReArrange(_hwnd, _lparam) \
  3958. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_REARRANGE, _lparam)
  3959. // Add an OBJECT into the view
  3960. #define SFVM_ADDOBJECT 0x00000003
  3961. #define ShellFolderView_AddObject(_hwnd, _pidl) \
  3962. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_ADDOBJECT, (LPARAM)_pidl)
  3963. // Remove an OBJECT into the view
  3964. #define SFVM_REMOVEOBJECT 0x00000006
  3965. #define ShellFolderView_RemoveObject(_hwnd, _pidl) \
  3966. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_REMOVEOBJECT, (LPARAM)_pidl)
  3967. // updates an object by passing in pointer to two PIDLS, the first
  3968. // is the old pidl, the second one is the one with update information.
  3969. //
  3970. // _ppidl[1] must be a *copy* of a pidl, as control over the lifetime
  3971. // of the pidl belongs to the view after successful completion of
  3972. // this call. (Unsuccessful completion (a -1 return) implies failure
  3973. // and the caller must free the memory.) Win95 waits a while before
  3974. // freeing the pidl, IE4 frees the pidl immediately.
  3975. // IShellFolderView::UpdateObject does not suffer from this problem.
  3976. //
  3977. #define SFVM_UPDATEOBJECT 0x00000007
  3978. #define ShellFolderView_UpdateObject(_hwnd, _ppidl) \
  3979. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_UPDATEOBJECT, (LPARAM)_ppidl)
  3980. // Returns an array of the selected IDS to the caller.
  3981. // lparam is a pointer to receive the idlists into
  3982. // return value is the count of items in the array.
  3983. #define SFVM_GETSELECTEDOBJECTS 0x00000009
  3984. #define ShellFolderView_GetSelectedObjects(_hwnd, ppidl) \
  3985. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETSELECTEDOBJECTS, (LPARAM)ppidl)
  3986. typedef struct _SFV_SETITEMPOS
  3987. {
  3988. LPCITEMIDLIST pidl;
  3989. POINT pt;
  3990. } SFV_SETITEMPOS, *LPSFV_SETITEMPOS;
  3991. // Sets the position of an item in the viewer
  3992. // lparam is a pointer to a SVF_SETITEMPOS
  3993. // return value is unused
  3994. #define SFVM_SETITEMPOS 0x0000000e
  3995. #define ShellFolderView_SetItemPos(_hwnd, _pidl, _x, _y) \
  3996. { SFV_SETITEMPOS _sip = {_pidl, {_x, _y}}; \
  3997. SHShellFolderView_Message(_hwnd, SFVM_SETITEMPOS, (LPARAM)(LPSFV_SETITEMPOS)&_sip);}
  3998. // Notifies a ShellView when one of its objects get put on the clipboard
  3999. // as a result of a menu command.
  4000. //
  4001. //
  4002. // lparam is the dwEffect (DROPEFFECT_MOVE, DROPEFFECT_COPY)
  4003. // return value is void.
  4004. #define SFVM_SETCLIPBOARD 0x00000010
  4005. #define ShellFolderView_SetClipboard(_hwnd, _dwEffect) \
  4006. (void)SHShellFolderView_Message(_hwnd, SFVM_SETCLIPBOARD, (LPARAM)(DWORD)(_dwEffect))
  4007. #define SFVM_SETPOINTS 0x00000017
  4008. #define ShellFolderView_SetPoints(_hwnd, _pdtobj) \
  4009. (void)SHShellFolderView_Message(_hwnd, SFVM_SETPOINTS, (LPARAM)_pdtobj)
  4010. #include <poppack.h> /* Return to byte packing */
  4011. SHSTDAPI_(IContextMenu *) SHFind_InitMenuPopup(HMENU hmenu, HWND hwndOwner, UINT idCmdFirst, UINT idCmdLast);
  4012. SHSTDAPI SHCreateShellFolderViewEx(LPCSFV pcsfv, IShellView ** ppsv);
  4013. //
  4014. // PROPIDs for Internet Shortcuts (FMTID_Intshcut) to be used with
  4015. // IPropertySetStorage/IPropertyStorage
  4016. //
  4017. // The known property ids and their variant types are:
  4018. // PID_IS_URL [VT_LPWSTR] URL
  4019. // PID_IS_NAME [VT_LPWSTR] Name of the internet shortcut
  4020. // PID_IS_WORKINGDIR [VT_LPWSTR] Working directory for the shortcut
  4021. // PID_IS_HOTKEY [VT_UI2] Hotkey for the shortcut
  4022. // PID_IS_SHOWCMD [VT_I4] Show command for shortcut
  4023. // PID_IS_ICONINDEX [VT_I4] Index into file that has icon
  4024. // PID_IS_ICONFILE [VT_LPWSTR] File that has the icon
  4025. // PID_IS_WHATSNEW [VT_LPWSTR] What's New text
  4026. // PID_IS_AUTHOR [VT_LPWSTR] Author
  4027. // PID_IS_DESCRIPTION [VT_LPWSTR] Description text of site
  4028. // PID_IS_COMMENT [VT_LPWSTR] User annotated comment
  4029. //
  4030. #define PID_IS_URL 2
  4031. #define PID_IS_NAME 4
  4032. #define PID_IS_WORKINGDIR 5
  4033. #define PID_IS_HOTKEY 6
  4034. #define PID_IS_SHOWCMD 7
  4035. #define PID_IS_ICONINDEX 8
  4036. #define PID_IS_ICONFILE 9
  4037. #define PID_IS_WHATSNEW 10
  4038. #define PID_IS_AUTHOR 11
  4039. #define PID_IS_DESCRIPTION 12
  4040. #define PID_IS_COMMENT 13
  4041. //
  4042. // PROPIDs for Internet Sites (FMTID_InternetSite) to be used with
  4043. // IPropertySetStorage/IPropertyStorage
  4044. //
  4045. // The known property ids and their variant types are:
  4046. // PID_INTSITE_WHATSNEW [VT_LPWSTR] What's New text
  4047. // PID_INTSITE_AUTHOR [VT_LPWSTR] Author
  4048. // PID_INTSITE_LASTVISIT [VT_FILETIME] Time site was last visited
  4049. // PID_INTSITE_LASTMOD [VT_FILETIME] Time site was last modified
  4050. // PID_INTSITE_VISITCOUNT [VT_UI4] Number of times user has visited
  4051. // PID_INTSITE_DESCRIPTION [VT_LPWSTR] Description text of site
  4052. // PID_INTSITE_COMMENT [VT_LPWSTR] User annotated comment
  4053. // PID_INTSITE_RECURSE [VT_UI4] Levels to recurse (0-3)
  4054. // PID_INTSITE_WATCH [VT_UI4] PIDISM_ flags
  4055. // PID_INTSITE_SUBSCRIPTION [VT_UI8] Subscription cookie
  4056. // PID_INTSITE_URL [VT_LPWSTR] URL
  4057. // PID_INTSITE_TITLE [VT_LPWSTR] Title
  4058. // PID_INTSITE_CODEPAGE [VT_UI4] Codepage of the document
  4059. // PID_INTSITE_TRACKING [VT_UI4] Tracking
  4060. // PID_INTSITE_ICONINDEX [VT_I4] Retrieve the index to the icon
  4061. // PID_INTSITE_ICONFILE [VT_LPWSTR] Retrieve the file containing the icon index.
  4062. #define PID_INTSITE_WHATSNEW 2
  4063. #define PID_INTSITE_AUTHOR 3
  4064. #define PID_INTSITE_LASTVISIT 4
  4065. #define PID_INTSITE_LASTMOD 5
  4066. #define PID_INTSITE_VISITCOUNT 6
  4067. #define PID_INTSITE_DESCRIPTION 7
  4068. #define PID_INTSITE_COMMENT 8
  4069. #define PID_INTSITE_FLAGS 9
  4070. #define PID_INTSITE_CONTENTLEN 10
  4071. #define PID_INTSITE_CONTENTCODE 11
  4072. #define PID_INTSITE_RECURSE 12
  4073. #define PID_INTSITE_WATCH 13
  4074. #define PID_INTSITE_SUBSCRIPTION 14
  4075. #define PID_INTSITE_URL 15
  4076. #define PID_INTSITE_TITLE 16
  4077. #define PID_INTSITE_CODEPAGE 18
  4078. #define PID_INTSITE_TRACKING 19
  4079. #define PID_INTSITE_ICONINDEX 20
  4080. #define PID_INTSITE_ICONFILE 21
  4081. // Flags for PID_IS_FLAGS
  4082. #define PIDISF_RECENTLYCHANGED 0x00000001
  4083. #define PIDISF_CACHEDSTICKY 0x00000002
  4084. #define PIDISF_CACHEIMAGES 0x00000010
  4085. #define PIDISF_FOLLOWALLLINKS 0x00000020
  4086. // Values for PID_INTSITE_WATCH
  4087. #define PIDISM_GLOBAL 0 // Monitor based on global setting
  4088. #define PIDISM_WATCH 1 // User says watch
  4089. #define PIDISM_DONTWATCH 2 // User says don't watch
  4090. ////////////////////////////////////////////////////////////////////
  4091. //
  4092. // The shell keeps track of some per-user state to handle display
  4093. // options that is of major interest to ISVs.
  4094. // The key one requested right now is "DoubleClickInWebView".
  4095. typedef struct {
  4096. BOOL fShowAllObjects : 1;
  4097. BOOL fShowExtensions : 1;
  4098. BOOL fNoConfirmRecycle : 1;
  4099. BOOL fShowSysFiles : 1;
  4100. BOOL fShowCompColor : 1;
  4101. BOOL fDoubleClickInWebView : 1;
  4102. BOOL fDesktopHTML : 1;
  4103. BOOL fWin95Classic : 1;
  4104. BOOL fDontPrettyPath : 1;
  4105. BOOL fShowAttribCol : 1; // No longer used, dead bit
  4106. BOOL fMapNetDrvBtn : 1;
  4107. BOOL fShowInfoTip : 1;
  4108. BOOL fHideIcons : 1;
  4109. BOOL fWebView : 1;
  4110. BOOL fFilter : 1;
  4111. BOOL fShowSuperHidden : 1;
  4112. BOOL fNoNetCrawling : 1;
  4113. DWORD dwWin95Unused; // Win95 only - no longer supported pszHiddenFileExts
  4114. UINT uWin95Unused; // Win95 only - no longer supported cbHiddenFileExts
  4115. // Note: Not a typo! This is a persisted structure so we cannot use LPARAM
  4116. LONG lParamSort;
  4117. int iSortDirection;
  4118. UINT version;
  4119. // new for win2k. need notUsed var to calc the right size of ie4 struct
  4120. // FIELD_OFFSET does not work on bit fields
  4121. UINT uNotUsed; // feel free to rename and use
  4122. BOOL fSepProcess: 1;
  4123. // new for Whistler.
  4124. BOOL fStartPanelOn: 1; //Indicates if the Whistler StartPanel mode is ON or OFF.
  4125. BOOL fShowStartPage: 1; //Indicates if the Whistler StartPage on desktop is ON or OFF.
  4126. UINT fSpareFlags : 13;
  4127. } SHELLSTATEA, *LPSHELLSTATEA;
  4128. typedef struct {
  4129. BOOL fShowAllObjects : 1;
  4130. BOOL fShowExtensions : 1;
  4131. BOOL fNoConfirmRecycle : 1;
  4132. BOOL fShowSysFiles : 1;
  4133. BOOL fShowCompColor : 1;
  4134. BOOL fDoubleClickInWebView : 1;
  4135. BOOL fDesktopHTML : 1;
  4136. BOOL fWin95Classic : 1;
  4137. BOOL fDontPrettyPath : 1;
  4138. BOOL fShowAttribCol : 1;
  4139. BOOL fMapNetDrvBtn : 1;
  4140. BOOL fShowInfoTip : 1;
  4141. BOOL fHideIcons : 1;
  4142. BOOL fWebView : 1;
  4143. BOOL fFilter : 1;
  4144. BOOL fShowSuperHidden : 1;
  4145. BOOL fNoNetCrawling : 1;
  4146. DWORD dwWin95Unused; // Win95 only - no longer supported pszHiddenFileExts
  4147. UINT uWin95Unused; // Win95 only - no longer supported cbHiddenFileExts
  4148. // Note: Not a typo! This is a persisted structure so we cannot use LPARAM
  4149. LONG lParamSort;
  4150. int iSortDirection;
  4151. UINT version;
  4152. // new for win2k. need notUsed var to calc the right size of ie4 struct
  4153. // FIELD_OFFSET does not work on bit fields
  4154. UINT uNotUsed; // feel free to rename and use
  4155. BOOL fSepProcess: 1;
  4156. // new for Whistler.
  4157. BOOL fStartPanelOn: 1; //Indicates if the Whistler StartPage mode is ON or OFF.
  4158. BOOL fShowStartPage: 1; //Indicates if the Whistler StartPage on desktop is ON or OFF.
  4159. // If you need a new flag, steal a bit from from fSpareFlags.
  4160. UINT fSpareFlags : 13;
  4161. } SHELLSTATEW, *LPSHELLSTATEW;
  4162. #define SHELLSTATEVERSION_IE4 9
  4163. #define SHELLSTATEVERSION_WIN2K 10
  4164. #ifdef UNICODE
  4165. #define SHELLSTATE SHELLSTATEW
  4166. #define LPSHELLSTATE LPSHELLSTATEW
  4167. #else
  4168. #define SHELLSTATE SHELLSTATEA
  4169. #define LPSHELLSTATE LPSHELLSTATEA
  4170. #endif
  4171. #define SHELLSTATE_SIZE_WIN95 FIELD_OFFSET(SHELLSTATE,lParamSort)
  4172. #define SHELLSTATE_SIZE_NT4 FIELD_OFFSET(SHELLSTATE,version)
  4173. #define SHELLSTATE_SIZE_IE4 FIELD_OFFSET(SHELLSTATE,uNotUsed)
  4174. #define SHELLSTATE_SIZE_WIN2K sizeof(SHELLSTATE)
  4175. SHSTDAPI_(void) SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet);
  4176. //
  4177. // SysFiles are these windows special files:
  4178. // "dll sys vxd 386 drv"
  4179. //
  4180. // hidden files are files with the FILE_ATTRIBUTE_HIDDEN attribute
  4181. //
  4182. // system files are files with the FILE_ATTRIBUTE_SYSTEM attribute
  4183. //
  4184. // fShowAllObjects fShowSysFiles Result
  4185. // --------------- ------------- ------
  4186. // 0 0 hide hidden + SysFiles + system files
  4187. // 0 1 hide hidden files.
  4188. // 1 0 show all files.
  4189. // 1 1 show all files.
  4190. //
  4191. typedef struct {
  4192. BOOL fShowAllObjects : 1;
  4193. BOOL fShowExtensions : 1;
  4194. BOOL fNoConfirmRecycle : 1;
  4195. BOOL fShowSysFiles : 1;
  4196. BOOL fShowCompColor : 1;
  4197. BOOL fDoubleClickInWebView : 1;
  4198. BOOL fDesktopHTML : 1;
  4199. BOOL fWin95Classic : 1;
  4200. BOOL fDontPrettyPath : 1;
  4201. BOOL fShowAttribCol : 1;
  4202. BOOL fMapNetDrvBtn : 1;
  4203. BOOL fShowInfoTip : 1;
  4204. BOOL fHideIcons : 1;
  4205. UINT fRestFlags : 3;
  4206. } SHELLFLAGSTATE, *LPSHELLFLAGSTATE;
  4207. #define SSF_SHOWALLOBJECTS 0x00000001
  4208. #define SSF_SHOWEXTENSIONS 0x00000002
  4209. #define SSF_HIDDENFILEEXTS 0x00000004
  4210. #define SSF_SERVERADMINUI 0x00000004
  4211. #define SSF_SHOWCOMPCOLOR 0x00000008
  4212. #define SSF_SORTCOLUMNS 0x00000010
  4213. #define SSF_SHOWSYSFILES 0x00000020
  4214. #define SSF_DOUBLECLICKINWEBVIEW 0x00000080
  4215. #define SSF_SHOWATTRIBCOL 0x00000100
  4216. #define SSF_DESKTOPHTML 0x00000200
  4217. #define SSF_WIN95CLASSIC 0x00000400
  4218. #define SSF_DONTPRETTYPATH 0x00000800
  4219. #define SSF_SHOWINFOTIP 0x00002000
  4220. #define SSF_MAPNETDRVBUTTON 0x00001000
  4221. #define SSF_NOCONFIRMRECYCLE 0x00008000
  4222. #define SSF_HIDEICONS 0x00004000
  4223. #define SSF_FILTER 0x00010000
  4224. #define SSF_WEBVIEW 0x00020000
  4225. #define SSF_SHOWSUPERHIDDEN 0x00040000
  4226. #define SSF_SEPPROCESS 0x00080000
  4227. #define SSF_NONETCRAWLING 0x00100000
  4228. #define SSF_STARTPANELON 0x00200000
  4229. #define SSF_SHOWSTARTPAGE 0x00400000
  4230. // SHGetSettings(LPSHELLFLAGSTATE lpss, DWORD dwMask)
  4231. //
  4232. // Specify the bits you are interested in in dwMask and they will be
  4233. // filled out in the lpss structure.
  4234. //
  4235. // When these settings change, a WM_SETTINGCHANGE message is sent
  4236. // with the string lParam value of "ShellState".
  4237. //
  4238. SHSTDAPI_(void) SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
  4239. // SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, void **ppv, LPCITEMIDLIST *ppidlLast)
  4240. //
  4241. // Given a pidl, you can get an interface pointer (as specified by riid) of the pidl's parent folder (in ppv)
  4242. // If ppidlLast is non-NULL, you can also get the pidl of the last item.
  4243. //
  4244. SHSTDAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, void **ppv, LPCITEMIDLIST *ppidlLast);
  4245. // SHSTDAPI SHParseDisplayName(PCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut)
  4246. //
  4247. // given a string it will call psfDesktop->ParseDisplayName() to try and create a pidl
  4248. // if no pbc specified, it uses the preferred options for parsing.
  4249. // this includes mapping file system paths to their appropriate aliased location (RegisterObjectParam(STR_PARSE_TRANSLATE_ALIASES))
  4250. // psfgaoOut is optional for SFGAO attributes
  4251. //
  4252. SHSTDAPI SHParseDisplayName(PCWSTR pszName, IBindCtx *pbc, LPITEMIDLIST *ppidl, SFGAOF sfgaoIn, SFGAOF *psfgaoOut);
  4253. // SHPathPrepareForWrite(HWND hwnd, IUnknown *punkEnableModless, LPCTSTR pszPath, DWORD dwFlags)
  4254. //
  4255. // DESCRIPTION:
  4256. // This API will prepare the path for the caller. This includes:
  4257. // 1. Prompting for the ejectable media to be re-inserted. (Floppy, CD-ROM, ZIP drive, etc.)
  4258. // 2. Prompting for the media to be formatted. (Floppy, hard drive, etc.)
  4259. // 3. Remount mapped drives if the connection was lost. (\\unc\share mapped to N: becomes disconnected)
  4260. // 4. If the path doesn't exist, create it. (SHPPFW_DIRCREATE and SHPPFW_ASKDIRCREATE)
  4261. // 5. Display an error if the media is read only. (SHPPFW_NOWRITECHECK not set)
  4262. //
  4263. // PARAMETERS:
  4264. // hwnd: Parernt window for UI. NULL means don't display UI. OPTIONAL
  4265. // punkEnableModless: Parent that will be set to modal during UI using IOleInPlaceActiveObject::EnableModeless(). OPTIONAL
  4266. // pszPath: Path to verify is valid for writting. This can be a UNC or file drive path. The path
  4267. // should only contain directories. Pass SHPPFW_IGNOREFILENAME if the last path segment
  4268. // is always filename to ignore.
  4269. // dwFlags: SHPPFW_* Flags to modify behavior
  4270. //
  4271. //-------------------------------------------------------------------------
  4272. #define SHPPFW_NONE 0x00000000
  4273. #define SHPPFW_DEFAULT SHPPFW_DIRCREATE // May change
  4274. #define SHPPFW_DIRCREATE 0x00000001 // Create the directory if it doesn't exist without asking the user.
  4275. #define SHPPFW_ASKDIRCREATE 0x00000002 // Create the directory if it doesn't exist after asking the user.
  4276. #define SHPPFW_IGNOREFILENAME 0x00000004 // Ignore the last item in pszPath because it's a file. Example: pszPath="C:\DirA\DirB", only use "C:\DirA".
  4277. #define SHPPFW_NOWRITECHECK 0x00000008 // Caller only needs to read from the drive, so don't check if it's READ ONLY.
  4278. #define SHPPFW_MEDIACHECKONLY 0x00000010 // do the retrys on the media (or net path), return errors if the file can't be found
  4279. SHSTDAPI SHPathPrepareForWriteA(HWND hwnd, IUnknown *punkEnableModless, LPCSTR pszPath, DWORD dwFlags);
  4280. SHSTDAPI SHPathPrepareForWriteW(HWND hwnd, IUnknown *punkEnableModless, LPCWSTR pszPath, DWORD dwFlags);
  4281. #ifdef UNICODE
  4282. #define SHPathPrepareForWrite SHPathPrepareForWriteW
  4283. #else
  4284. #define SHPathPrepareForWrite SHPathPrepareForWriteA
  4285. #endif // !UNICODE
  4286. //--------------------------------------------------------------------------
  4287. //
  4288. // Interface used for exposing the INI file methods on a shortcut file
  4289. //
  4290. //
  4291. //--------------------------------------------------------------------------
  4292. #undef INTERFACE
  4293. #define INTERFACE INamedPropertyBag
  4294. DECLARE_INTERFACE_(INamedPropertyBag, IUnknown)
  4295. {
  4296. // *** IUnknown methods ***
  4297. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  4298. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  4299. STDMETHOD_(ULONG,Release) (THIS) PURE;
  4300. // *** INamedPropertyBag methods ***
  4301. STDMETHOD(ReadPropertyNPB) (THIS_ /* [in] */ LPCOLESTR pszBagname,
  4302. /* [in] */ LPCOLESTR pszPropName,
  4303. /* [out][in] */ PROPVARIANT *pVar) PURE;
  4304. STDMETHOD(WritePropertyNPB)(THIS_ /* [in] */ LPCOLESTR pszBagname,
  4305. /* [in] */ LPCOLESTR pszPropName,
  4306. /* [in] */ PROPVARIANT *pVar) PURE;
  4307. STDMETHOD(RemovePropertyNPB)(THIS_ /* [in] */ LPCOLESTR pszBagname,
  4308. /* [in] */ LPCOLESTR pszPropName) PURE;
  4309. };
  4310. #ifdef __urlmon_h__
  4311. // NOTE: urlmon.h must be included before shlobj.h to access this function.
  4312. //
  4313. // SoftwareUpdateMessageBox
  4314. //
  4315. // Provides a standard message box for the alerting the user that a software
  4316. // update is available or installed. No UI will be displayed if there is no
  4317. // update available or if the available update version is less than or equal
  4318. // to the Advertised update version.
  4319. //
  4320. // hWnd - [in] Handle of owner window
  4321. // szDistUnit - [in] Unique identifier string for a code distribution unit. For
  4322. // ActiveX controls and Active Setup installed components, this
  4323. // is typically a GUID string.
  4324. // dwFlags - [in] Must be 0.
  4325. // psdi - [in,out] Pointer to SOFTDISTINFO ( see URLMon.h ). May be NULL.
  4326. // cbSize should be initialized
  4327. // by the caller to sizeof(SOFTDISTINFO), dwReserved should be set to 0.
  4328. //
  4329. // RETURNS:
  4330. //
  4331. // IDNO - The user chose cancel. If *pbRemind is FALSE, the caller should save the
  4332. // update version from the SOFTDISTINFO and pass it in as the Advertised
  4333. // version in future calls.
  4334. //
  4335. // IDYES - The user has selected Update Now/About Update. The caller should navigate to
  4336. // the SOFTDISTINFO's pszHREF to initiate the install or learn about it.
  4337. // The caller should save the update version from the SOFTDISTINFO and pass
  4338. // it in as the Advertised version in future calls.
  4339. //
  4340. // IDIGNORE - There is no pending software update. Note: There is
  4341. // no Ignore button in the standard UI. This occurs if the available
  4342. // version is less than the installed version or is not present or if the
  4343. // Advertised version is greater than or equal to the update version.
  4344. //
  4345. // IDABORT - An error occured. Call GetSoftwareUpdateInfo() for a more specific HRESULT.
  4346. // Note: There is no Abort button in the standard UI.
  4347. SHDOCAPI_(DWORD) SoftwareUpdateMessageBox( HWND hWnd,
  4348. LPCWSTR szDistUnit,
  4349. DWORD dwFlags,
  4350. LPSOFTDISTINFO psdi );
  4351. #endif // if __urlmon_h__
  4352. // SHPropStgCreate()
  4353. // Wrap of IPropertySetStorage::Open/Create
  4354. //
  4355. // This function ensures proper handling of code page retrieval/assignment
  4356. // for the requested property set operation.
  4357. //
  4358. // psstg, // Address of IPropertySetStorage vtable
  4359. // fmtid, // property set ID
  4360. // pclsid, // class ID associated with the set. This can be NULL
  4361. // grfFlags, // PROPSETFLAG_xxx. All sets containing ansi bytes should be created with
  4362. // PROPSETFLAG_ANSI, otherwise PROPSETFLAG_DEFAULT.
  4363. // grfMode, // STGM_ flags. Must contain STGM_DIRECT|STGM_EXCLUSIVE.
  4364. // dwDisposition, // OPEN_EXISTING. OPEN_ALWAYS, CREATE_NEW, or CREATE_ALWAYS
  4365. // IPropertyStorage** ppstg, // Address to receive requested vtable
  4366. // puCodePage // Optional address to receive the code page ID for the set.
  4367. //
  4368. SHSTDAPI SHPropStgCreate( IPropertySetStorage* psstg, REFFMTID fmtid, CLSID* pclsid, DWORD grfFlags, DWORD grfMode, DWORD dwDisposition, OUT IPropertyStorage** ppstg, OUT OPTIONAL UINT* puCodePage );
  4369. // SHPropStgReadMultiple()
  4370. // IPropertyStorage::ReadMultiple wrap
  4371. //
  4372. // The wrap ensures ANSI/UNICODE translations are handled properly for
  4373. // legacy property sets.
  4374. //
  4375. // pps, // address of IPropertyStorage vtable.
  4376. // uCodePage, //Code page value retrieved from SHCreatePropertySet
  4377. // cpspec, //Count of properties being read
  4378. // rgpspec, //Array of the properties to be read
  4379. // rgvar //Array of PROPVARIANTs containing the property values on return
  4380. //
  4381. SHSTDAPI SHPropStgReadMultiple( IPropertyStorage* pps, UINT uCodePage, ULONG cpspec, PROPSPEC const rgpspec[], PROPVARIANT rgvar[] );
  4382. // SHPropStgWriteMultiple()
  4383. // IPropertyStorage::WriteMultiple wrap
  4384. //
  4385. // The wrap ensures ANSI/UNICODE translations are handled properly for
  4386. // legacy property sets.
  4387. //
  4388. // pps, // address of IPropertyStorage vtable.
  4389. // uCodePage, // code page retrieved from SHCreatePropertySet.
  4390. // cpspec, // The number of properties being set
  4391. // rgpspec, // Property specifiers
  4392. // rgvar, // Array of PROPVARIANT values
  4393. // propidNameFirst // Minimum value for property identifiers. This value should be >= PID_FIRST_USABLE
  4394. //
  4395. SHSTDAPI SHPropStgWriteMultiple( IPropertyStorage* pps, UINT* puCodePage, ULONG cpspec, PROPSPEC const rgpspec[], PROPVARIANT rgvar[], PROPID propidNameFirst );
  4396. SHSTDAPI SHCreateFileExtractIconA(LPCSTR pszFile, DWORD dwFileAttributes, REFIID riid, void **ppv);
  4397. SHSTDAPI SHCreateFileExtractIconW(LPCWSTR pszFile, DWORD dwFileAttributes, REFIID riid, void **ppv);
  4398. #ifdef UNICODE
  4399. #define SHCreateFileExtractIcon SHCreateFileExtractIconW
  4400. #else
  4401. #define SHCreateFileExtractIcon SHCreateFileExtractIconA
  4402. #endif // !UNICODE
  4403. #include <pshpack8.h>
  4404. SHSTDAPI SHLimitInputEdit(HWND hwndEdit, IShellFolder *psf);
  4405. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_WINDOWS >= 0x0500)
  4406. //
  4407. // The SHMultiFileProperties API displays a property sheet for a
  4408. // set of files specified in an IDList Array.
  4409. //
  4410. // Parameters:
  4411. // pdtobj - Data object containing list of files. The data
  4412. // object must provide the "Shell IDList Array"
  4413. // clipboard format. The parent folder's implementation of
  4414. // IShellFolder::GetDisplayNameOf must return a fully-qualified
  4415. // filesystem path for each item in response to the
  4416. // SHGDN_FORPARSING flag.
  4417. //
  4418. // dwFlags - Reserved for future use. Should be set to 0.
  4419. //
  4420. // Returns:
  4421. // S_OK
  4422. //
  4423. SHSTDAPI SHMultiFileProperties(IDataObject *pdtobj, DWORD dwFlags);
  4424. #endif
  4425. #if (_WIN32_IE >= 0x0600)
  4426. //
  4427. //
  4428. typedef void (CALLBACK *PFNASYNCICONTASKBALLBACK)(LPCITEMIDLIST pidl, LPVOID pvData, LPVOID pvHint, INT iIconIndex, INT iOpenIconIndex);
  4429. // HRESULT SHMapIDListToImageListIndexAsync(IShellTaskScheduler* pts, IShellFolder *psf, LPCITEMIDLIST pidl, UINT flags,
  4430. // PFNASYNCICONTASKBALLBACK pfn, LPVOID pvData, LPVOID pvHint, int *piIndex, int *piIndexSel);
  4431. // A usefull function for asynchronously mapping idlist into index into system
  4432. // image list. Optionally it can also look up the index of the selected icon.
  4433. // pts Task scheduler interface to use to create the background task
  4434. // psf Shell folder relating to the pidl
  4435. // pidl Item whose icon is requested
  4436. // flags GIL_ flags
  4437. // pfn Function called back when the background task is done
  4438. // pvData User data passed back in the (*pfn) callback
  4439. // pvHint User data passed back in the (*pfn) callback
  4440. // piIndex Icon index returned. This is the temporary index if the function returns E_PENDING. The final index will be provided thru the callback
  4441. // piIndexSel Optional icon index for the open icon case (GIL_OPENICON).
  4442. //
  4443. // Returns S_OK if all the requested info was available. E_PENDING means that you get temporary icons, and will be called back
  4444. // asynchronously with the final icons. Other failure code means the function failed.
  4445. SHSTDAPI SHMapIDListToImageListIndexAsync(IShellTaskScheduler* pts, IShellFolder *psf, LPCITEMIDLIST pidl, UINT flags,
  4446. PFNASYNCICONTASKBALLBACK pfn, LPVOID pvData, LPVOID pvHint, int *piIndex, int *piIndexSel);
  4447. #endif // (_WIN32_IE >= 0x0600)
  4448. // A usefull function in Defview for mapping idlist into index into system
  4449. // image list. Optionally it can also look up the index of the selected
  4450. // icon.
  4451. SHSTDAPI_(int) SHMapPIDLToSystemImageListIndex(IShellFolder *pshf, LPCITEMIDLIST pidl, int *piIndexSel);
  4452. EXTERN_C WINSHELLAPI HRESULT STDAPICALLTYPE SHCLSIDFromString(LPCWSTR lpsz, LPCLSID lpclsid);
  4453. HANDLE _SHAllocShared(LPCVOID pvData, DWORD dwSize, DWORD dwDestinationProcessId);
  4454. BOOL _SHFreeShared(HANDLE hData, DWORD dwSourceProcessId);
  4455. void *_SHLockShared(HANDLE hData, DWORD dwSourceProcessId);
  4456. BOOL _SHUnlockShared(void * pvData);
  4457. STDAPI SHFlushClipboard(void);
  4458. STDAPI SHCreateQueryCancelAutoPlayMoniker(IMoniker** ppmoniker);
  4459. HINSTANCE WINAPI SHGetShellStyleHInstance(void);
  4460. STDAPI_(void) PerUserInit(void);
  4461. WINSHELLAPI BOOL WINAPI SHRunControlPanel(LPCWSTR lpcszCmdLine, HWND hwndMsgParent);
  4462. WINSHELLAPI int WINAPI PickIconDlg(HWND hwnd, LPWSTR pszIconPath, UINT cbIconPath, int *piIconIndex);
  4463. typedef struct tagAAMENUFILENAME
  4464. {
  4465. SHORT cbTotal;
  4466. BYTE rgbReserved[12];
  4467. WCHAR szFileName[1]; // variable length string
  4468. } AASHELLMENUFILENAME, *LPAASHELLMENUFILENAME;
  4469. typedef struct tagAASHELLMENUITEM
  4470. {
  4471. void* lpReserved1;
  4472. int iReserved;
  4473. UINT uiReserved;
  4474. LPAASHELLMENUFILENAME lpName; // name of file
  4475. LPWSTR psz; // text to use if no file
  4476. } AASHELLMENUITEM, *LPAASHELLMENUITEM;
  4477. STDAPI SHGetAttributesFromDataObject(IDataObject *pdo, DWORD dwAttributeMask, DWORD *pdwAttributes, UINT *pcItems);
  4478. #include <poppack.h> /* Return to byte packing */
  4479. #ifdef __cplusplus
  4480. }
  4481. #endif /* __cplusplus */
  4482. #include <poppack.h>
  4483. SHDOCAPI_(BOOL) ImportPrivacySettings( LPCWSTR szFilename,
  4484. IN OUT BOOL* pfParsePrivacyPreferences, IN OUT BOOL* pfParsePerSiteRules);
  4485. #ifndef IEnumPrivacyRecords
  4486. typedef interface IEnumPrivacyRecords IEnumPrivacyRecords;
  4487. #endif
  4488. SHDOCAPI DoPrivacyDlg( HWND hwndParent, LPOLESTR pszUrl, IEnumPrivacyRecords *pPrivacyEnum, BOOL fReportAllSites);
  4489. #endif // _SHLOBJ_H_