home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / shlobj.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  132KB  |  3,515 lines

  1. //===========================================================================
  2. //
  3. // Copyright (c) Microsoft Corporation 1991-1998
  4. //
  5. // File: shlobj.h
  6. //
  7. //===========================================================================
  8.  
  9. #ifndef _SHLOBJ_H_
  10. #define _SHLOBJ_H_
  11.  
  12. #ifndef SNDMSG
  13. #ifdef __cplusplus
  14. #define SNDMSG ::SendMessage
  15. #else
  16. #define SNDMSG SendMessage
  17. #endif
  18. #endif // ifndef SNDMSG
  19.  
  20. //
  21. // Define API decoration for direct importing of DLL references.
  22. //
  23. #ifndef WINSHELLAPI
  24. #if !defined(_SHELL32_)
  25. #define WINSHELLAPI       DECLSPEC_IMPORT
  26. #else
  27. #define WINSHELLAPI
  28. #endif
  29. #endif // WINSHELLAPI
  30.  
  31. #ifndef SHSTDAPI
  32. #if !defined(_SHELL32_)
  33. #define SHSTDAPI          EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  34. #define SHSTDAPI_(type)   EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  35. #else
  36. #define SHSTDAPI          STDAPI
  37. #define SHSTDAPI_(type)   STDAPI_(type)
  38. #endif
  39. #endif // SHSTDAPI
  40.  
  41. #ifndef SHDOCAPI
  42. #if !defined(_SHDOCVW_)
  43. #define SHDOCAPI          EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  44. #define SHDOCAPI_(type)   EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  45. #else
  46. #define SHDOCAPI          STDAPI
  47. #define SHDOCAPI_(type)   STDAPI_(type)
  48. #endif
  49. #endif // SHDOCAPI
  50.  
  51.  
  52. #include <ole2.h>
  53. #ifndef _PRSHT_H_
  54. #include <prsht.h>
  55. #endif
  56. #ifndef _INC_COMMCTRL
  57. #include <commctrl.h>   // for LPTBBUTTON
  58. #endif
  59.  
  60. #ifndef INITGUID
  61. #include <shlguid.h>
  62. #endif /* !INITGUID */
  63.  
  64. #ifndef RC_INVOKED
  65. #pragma pack(1)         /* Assume byte packing throughout */
  66. #endif /* !RC_INVOKED */
  67.  
  68. #ifdef __cplusplus
  69. extern "C" {            /* Assume C declarations for C++ */
  70. #endif /* __cplusplus */
  71.  
  72.  
  73. //===========================================================================
  74. //
  75. // Object identifiers in the explorer's name space (ItemID and IDList)
  76. //
  77. //  All the items that the user can browse with the explorer (such as files,
  78. // directories, servers, work-groups, etc.) has an identifier which is unique
  79. // among items within the parent folder. Those identifiers are called item
  80. // IDs (SHITEMID). Since all its parent folders have their own item IDs,
  81. // any items can be uniquely identified by a list of item IDs, which is called
  82. // an ID list (ITEMIDLIST).
  83. //
  84. //  ID lists are almost always allocated by the task allocator (see some
  85. // description below as well as OLE 2.0 SDK) and may be passed across
  86. // some of shell interfaces (such as IShellFolder). Each item ID in an ID list
  87. // is only meaningful to its parent folder (which has generated it), and all
  88. // the clients must treat it as an opaque binary data except the first two
  89. // bytes, which indicates the size of the item ID.
  90. //
  91. //  When a shell extension -- which implements the IShellFolder interace --
  92. // generates an item ID, it may put any information in it, not only the data
  93. // with that it needs to identifies the item, but also some additional
  94. // information, which would help implementing some other functions efficiently.
  95. // For example, the shell's IShellFolder implementation of file system items
  96. // stores the primary (long) name of a file or a directory as the item
  97. // identifier, but it also stores its alternative (short) name, size and date
  98. // etc.
  99. //
  100. //  When an ID list is passed to one of shell APIs (such as SHGetPathFromIDList),
  101. // it is always an absolute path -- relative from the root of the name space,
  102. // which is the desktop folder. When an ID list is passed to one of IShellFolder
  103. // member function, it is always a relative path from the folder (unless it
  104. // is explicitly specified).
  105. //
  106. //===========================================================================
  107.  
  108. //
  109. // SHITEMID -- Item ID
  110. //
  111. typedef struct _SHITEMID        // mkid
  112. {
  113.     USHORT      cb;             // Size of the ID (including cb itself)
  114.     BYTE        abID[1];        // The item ID (variable length)
  115. } SHITEMID;
  116. typedef UNALIGNED SHITEMID *LPSHITEMID;
  117. typedef const UNALIGNED SHITEMID *LPCSHITEMID;
  118.  
  119. //
  120. // ITEMIDLIST -- List if item IDs (combined with 0-terminator)
  121. //
  122. typedef struct _ITEMIDLIST      // idl
  123. {
  124.     SHITEMID    mkid;
  125. } ITEMIDLIST;
  126. typedef UNALIGNED ITEMIDLIST * LPITEMIDLIST;
  127. typedef const UNALIGNED ITEMIDLIST * LPCITEMIDLIST;
  128.  
  129.  
  130. //===========================================================================
  131. //
  132. // Task allocator API
  133. //
  134. //  All the shell extensions MUST use the task allocator (see OLE 2.0
  135. // programming guild for its definition) when they allocate or free
  136. // memory objects (mostly ITEMIDLIST) that are returned across any
  137. // shell interfaces. There are two ways to access the task allocator
  138. // from a shell extension depending on whether or not it is linked with
  139. // OLE32.DLL or not (purely for efficiency).
  140. //
  141. // (1) A shell extension which calls any OLE API (i.e., linked with
  142. //  OLE32.DLL) should call OLE's task allocator (by retrieving
  143. //  the task allocator by calling CoGetMalloc API).
  144. //
  145. // (2) A shell extension which does not call any OLE API (i.e., not linked
  146. //  with OLE32.DLL) should call the shell task allocator API (defined
  147. //  below), so that the shell can quickly loads it when OLE32.DLL is not
  148. //  loaded by any application at that point.
  149. //
  150. // Notes:
  151. //  In next version of Windowso release, SHGetMalloc will be replaced by
  152. // the following macro.
  153. //
  154. // #define SHGetMalloc(ppmem)   CoGetMalloc(MEMCTX_TASK, ppmem)
  155. //
  156. //===========================================================================
  157.  
  158. WINSHELLAPI HRESULT WINAPI SHGetMalloc(LPMALLOC * ppMalloc);
  159.  
  160.  
  161. //===========================================================================
  162. //
  163. // IContextMenu interface
  164. //
  165. // [OverView]
  166. //
  167. //  The shell uses the IContextMenu interface in following three cases.
  168. //
  169. // case-1: The shell is loading context menu extensions.
  170. //
  171. //   When the user clicks the right mouse button on an item within the shell's
  172. //  name space (i.g., file, directory, server, work-group, etc.), it creates
  173. //  the default context menu for its type, then loads context menu extensions
  174. //  that are registered for that type (and its base type) so that they can
  175. //  add extra menu items. Those context menu extensions are registered at
  176. //  HKCR\{ProgID}\shellex\ContextMenuHandlers.
  177. //
  178. // case-2: The shell is retrieving a context menu of sub-folders in extended
  179. //   name-space.
  180. //
  181. //   When the explorer's name space is extended by name space extensions,
  182. //  the shell calls their IShellFolder::GetUIObjectOf to get the IContextMenu
  183. //  objects when it creates context menus for folders under those extended
  184. //  name spaces.
  185. //
  186. // case-3: The shell is loading non-default drag and drop handler for directories.
  187. //
  188. //   When the user performed a non-default drag and drop onto one of file
  189. //  system folders (i.e., directories), it loads shell extensions that are
  190. //  registered at HKCR\{ProgID}\DragDropHandlers.
  191. //
  192. //
  193. // [Member functions]
  194. //
  195. //
  196. // IContextMenu::QueryContextMenu
  197. //
  198. //   This member function may insert one or more menuitems to the specified
  199. //  menu (hmenu) at the specified location (indexMenu which is never be -1).
  200. //  The IDs of those menuitem must be in the specified range (idCmdFirst and
  201. //  idCmdLast). It returns the maximum menuitem ID offset (ushort) in the
  202. //  'code' field (low word) of the scode.
  203. //
  204. //   The uFlags specify the context. It may have one or more of following
  205. //  flags.
  206. //
  207. //  CMF_DEFAULTONLY: This flag is passed if the user is invoking the default
  208. //   action (typically by double-clicking, case 1 and 2 only). Context menu
  209. //   extensions (case 1) should not add any menu items, and returns NOERROR.
  210. //
  211. //  CMF_VERBSONLY: The explorer passes this flag if it is constructing
  212. //   a context menu for a short-cut object (case 1 and case 2 only). If this
  213. //   flag is passed, it should not add any menu-items that is not appropriate
  214. //   from a short-cut.
  215. //    A good example is the "Delete" menuitem, which confuses the user
  216. //   because it is not clear whether it deletes the link source item or the
  217. //   link itself.
  218. //
  219. //  CMF_EXPLORER: The explorer passes this flag if it has the left-side pane
  220. //   (case 1 and 2 only). Context menu extensions should ignore this flag.
  221. //
  222. //   High word (16-bit) are reserved for context specific communications
  223. //  and the rest of flags (13-bit) are reserved by the system.
  224. //
  225. //
  226. // IContextMenu::InvokeCommand
  227. //
  228. //   This member is called when the user has selected one of menuitems that
  229. //  are inserted by previous QueryContextMenu member. In this case, the
  230. //  LOWORD(lpici->lpVerb) contains the menuitem ID offset (menuitem ID -
  231. //  idCmdFirst).
  232. //
  233. //   This member function may also be called programmatically. In such a case,
  234. //  lpici->lpVerb specifies the canonical name of the command to be invoked,
  235. //  which is typically retrieved by GetCommandString member previously.
  236. //
  237. //  Parameters in lpci:
  238. //    cbSize -- Specifies the size of this structure (sizeof(*lpci))
  239. //    hwnd   -- Specifies the owner window for any message/dialog box.
  240. //    fMask  -- Specifies whether or not dwHotkey/hIcon paramter is valid.
  241. //    lpVerb -- Specifies the command to be invoked.
  242. //    lpParameters -- Parameters (optional)
  243. //    lpDirectory  -- Working directory (optional)
  244. //    nShow -- Specifies the flag to be passed to ShowWindow (SW_*).
  245. //    dwHotKey -- Hot key to be assigned to the app after invoked (optional).
  246. //    hIcon -- Specifies the icon (optional).
  247. //    hMonitor -- Specifies the default monitor (optional).
  248. //
  249. //
  250. // IContextMenu::GetCommandString
  251. //
  252. //   This member function is called by the explorer either to get the
  253. //  canonical (language independent) command name (uFlags == GCS_VERB) or
  254. //  the help text ((uFlags & GCS_HELPTEXT) != 0) for the specified command.
  255. //  The retrieved canonical string may be passed to its InvokeCommand
  256. //  member function to invoke a command programmatically. The explorer
  257. //  displays the help texts in its status bar; therefore, the length of
  258. //  the help text should be reasonably short (<40 characters).
  259. //
  260. //  Parameters:
  261. //   idCmd -- Specifies menuitem ID offset (from idCmdFirst)
  262. //   uFlags -- Either GCS_VERB or GCS_HELPTEXT
  263. //   pwReserved -- Reserved (must pass NULL when calling, must ignore when called)
  264. //   pszName -- Specifies the string buffer.
  265. //   cchMax -- Specifies the size of the string buffer.
  266. //
  267. //===========================================================================
  268.  
  269. // QueryContextMenu uFlags
  270. #define CMF_NORMAL              0x00000000
  271. #define CMF_DEFAULTONLY         0x00000001
  272. #define CMF_VERBSONLY           0x00000002
  273. #define CMF_EXPLORE             0x00000004
  274. #define CMF_NOVERBS             0x00000008
  275. #define CMF_CANRENAME           0x00000010
  276. #define CMF_NODEFAULT           0x00000020
  277. #define CMF_INCLUDESTATIC       0x00000040
  278. #define CMF_RESERVED            0xffff0000      // View specific
  279.  
  280. // GetCommandString uFlags
  281. #define GCS_VERBA        0x00000000     // canonical verb
  282. #define GCS_HELPTEXTA    0x00000001     // help text (for status bar)
  283. #define GCS_VALIDATEA    0x00000002     // validate command exists
  284. #define GCS_VERBW        0x00000004     // canonical verb (unicode)
  285. #define GCS_HELPTEXTW    0x00000005     // help text (unicode version)
  286. #define GCS_VALIDATEW    0x00000006     // validate command exists (unicode)
  287. #define GCS_UNICODE      0x00000004     // for bit testing - Unicode string
  288.  
  289. #ifdef UNICODE
  290. #define GCS_VERB        GCS_VERBW
  291. #define GCS_HELPTEXT    GCS_HELPTEXTW
  292. #define GCS_VALIDATE    GCS_VALIDATEW
  293. #else
  294. #define GCS_VERB        GCS_VERBA
  295. #define GCS_HELPTEXT    GCS_HELPTEXTA
  296. #define GCS_VALIDATE    GCS_VALIDATEA
  297. #endif
  298.  
  299. #define CMDSTR_NEWFOLDERA   "NewFolder"
  300. #define CMDSTR_VIEWLISTA    "ViewList"
  301. #define CMDSTR_VIEWDETAILSA "ViewDetails"
  302. #define CMDSTR_NEWFOLDERW   L"NewFolder"
  303. #define CMDSTR_VIEWLISTW    L"ViewList"
  304. #define CMDSTR_VIEWDETAILSW L"ViewDetails"
  305.  
  306. #ifdef UNICODE
  307. #define CMDSTR_NEWFOLDER    CMDSTR_NEWFOLDERW
  308. #define CMDSTR_VIEWLIST     CMDSTR_VIEWLISTW
  309. #define CMDSTR_VIEWDETAILS  CMDSTR_VIEWDETAILSW
  310. #else
  311. #define CMDSTR_NEWFOLDER    CMDSTR_NEWFOLDERA
  312. #define CMDSTR_VIEWLIST     CMDSTR_VIEWLISTA
  313. #define CMDSTR_VIEWDETAILS  CMDSTR_VIEWDETAILSA
  314. #endif
  315.  
  316. #define CMIC_MASK_HOTKEY        SEE_MASK_HOTKEY
  317. #define CMIC_MASK_ICON          SEE_MASK_ICON
  318. #define CMIC_MASK_FLAG_NO_UI    SEE_MASK_FLAG_NO_UI
  319. #define CMIC_MASK_UNICODE       SEE_MASK_UNICODE
  320. #define CMIC_MASK_NO_CONSOLE    SEE_MASK_NO_CONSOLE
  321. #define CMIC_MASK_HASLINKNAME   SEE_MASK_HASLINKNAME
  322. #define CMIC_MASK_FLAG_SEP_VDM  SEE_MASK_FLAG_SEPVDM
  323. #define CMIC_MASK_HASTITLE      SEE_MASK_HASTITLE
  324. #define CMIC_MASK_ASYNCOK       SEE_MASK_ASYNCOK
  325.  
  326. #if (_WIN32_IE >= 0x0400)
  327. #define CMIC_MASK_PTINVOKE      0x20000000
  328. #endif
  329.  
  330.  
  331. //NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor 
  332. typedef struct _CMINVOKECOMMANDINFO {
  333.     DWORD cbSize;        // sizeof(CMINVOKECOMMANDINFO)
  334.     DWORD fMask;         // any combination of CMIC_MASK_*
  335.     HWND hwnd;           // might be NULL (indicating no owner window)
  336.     LPCSTR lpVerb;       // either a string or MAKEINTRESOURCE(idOffset)
  337.     LPCSTR lpParameters; // might be NULL (indicating no parameter)
  338.     LPCSTR lpDirectory;  // might be NULL (indicating no specific directory)
  339.     int nShow;           // one of SW_ values for ShowWindow() API
  340.  
  341.     DWORD dwHotKey;
  342.     HANDLE hIcon;
  343. } CMINVOKECOMMANDINFO,  *LPCMINVOKECOMMANDINFO;
  344.  
  345. typedef struct _CMInvokeCommandInfoEx {
  346.     DWORD cbSize;        // must be sizeof(CMINVOKECOMMANDINFOEX)
  347.     DWORD fMask;         // any combination of CMIC_MASK_*
  348.     HWND hwnd;           // might be NULL (indicating no owner window)
  349.     LPCSTR lpVerb;       // either a string or MAKEINTRESOURCE(idOffset)
  350.     LPCSTR lpParameters; // might be NULL (indicating no parameter)
  351.     LPCSTR lpDirectory;  // might be NULL (indicating no specific directory)
  352.     int nShow;           // one of SW_ values for ShowWindow() API
  353.  
  354.     DWORD dwHotKey;
  355.     
  356.     HANDLE hIcon;
  357.     LPCSTR lpTitle;      // For CreateProcess-StartupInfo.lpTitle
  358.     LPCWSTR lpVerbW;        // Unicode verb (for those who can use it)
  359.     LPCWSTR lpParametersW;  // Unicode parameters (for those who can use it)
  360.     LPCWSTR lpDirectoryW;   // Unicode directory (for those who can use it)
  361.     LPCWSTR lpTitleW;       // Unicode title (for those who can use it)
  362. #if (_WIN32_IE >= 0x0400)
  363.     POINT   ptInvoke;       // Point where it's invoked
  364. #endif
  365. } CMINVOKECOMMANDINFOEX,  *LPCMINVOKECOMMANDINFOEX;
  366.  
  367. #undef  INTERFACE
  368. #define INTERFACE   IContextMenu
  369.  
  370. DECLARE_INTERFACE_(IContextMenu, IUnknown)
  371. {
  372.     // *** IUnknown methods ***
  373.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  374.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  375.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  376.  
  377.     STDMETHOD(QueryContextMenu)(THIS_
  378.                                 HMENU hmenu,
  379.                                 UINT indexMenu,
  380.                                 UINT idCmdFirst,
  381.                                 UINT idCmdLast,
  382.                                 UINT uFlags) PURE;
  383.  
  384.     STDMETHOD(InvokeCommand)(THIS_
  385.                              LPCMINVOKECOMMANDINFO lpici) PURE;
  386.  
  387.     STDMETHOD(GetCommandString)(THIS_
  388.                                 UINT        idCmd,
  389.                                 UINT        uType,
  390.                                 UINT      * pwReserved,
  391.                                 LPSTR       pszName,
  392.                                 UINT        cchMax) PURE;
  393. };
  394.  
  395. typedef IContextMenu *  LPCONTEXTMENU;
  396.  
  397. //
  398. // IContextMenu2 (IContextMenu with one new member)
  399. //
  400. // IContextMenu2::HandleMenuMsg
  401. //
  402. //  This function is called, if the client of IContextMenu is aware of
  403. // IContextMenu2 interface and receives one of following messages while
  404. // it is calling TrackPopupMenu (in the window proc of hwndOwner):
  405. //      WM_INITPOPUP, WM_DRAWITEM and WM_MEASUREITEM
  406. //  The callee may handle these messages to draw owner draw menuitems.
  407. //
  408.  
  409. #undef  INTERFACE
  410. #define INTERFACE   IContextMenu2
  411.  
  412. DECLARE_INTERFACE_(IContextMenu2, IContextMenu)
  413. {
  414.     // *** IUnknown methods ***
  415.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  416.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  417.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  418.  
  419.     // *** IContextMenu methods ***
  420.     
  421.     STDMETHOD(QueryContextMenu)(THIS_
  422.                                 HMENU hmenu,
  423.                                 UINT indexMenu,
  424.                                 UINT idCmdFirst,
  425.                                 UINT idCmdLast,
  426.                                 UINT uFlags) PURE;
  427.  
  428.     STDMETHOD(InvokeCommand)(THIS_
  429.                              LPCMINVOKECOMMANDINFO lpici) PURE;
  430.  
  431.     STDMETHOD(GetCommandString)(THIS_
  432.                                 UINT        idCmd,
  433.                                 UINT        uType,
  434.                                 UINT      * pwReserved,
  435.                                 LPSTR       pszName,
  436.                                 UINT        cchMax) PURE;
  437.  
  438.     // *** IContextMenu2 methods ***
  439.     
  440.     STDMETHOD(HandleMenuMsg)(THIS_
  441.                              UINT uMsg,
  442.                              WPARAM wParam,
  443.                              LPARAM lParam) PURE;
  444. };
  445.  
  446. typedef IContextMenu2 * LPCONTEXTMENU2;
  447.  
  448. //
  449. // IContextMenu3 (IContextMenu with one new member)
  450. //
  451. // IContextMenu3::HandleMenuMsg2
  452. //
  453. //  This function is called, if the client of IContextMenu is aware of
  454. // IContextMenu3 interface and receives a menu message while
  455. // it is calling TrackPopupMenu (in the window proc of hwndOwner):
  456. //
  457.  
  458. #undef  INTERFACE
  459. #define INTERFACE   IContextMenu3
  460.  
  461. DECLARE_INTERFACE_(IContextMenu3, IContextMenu2)
  462. {
  463.     // *** IUnknown methods ***
  464.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  465.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  466.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  467.  
  468.     // *** IContextMenu methods ***
  469.     
  470.     STDMETHOD(QueryContextMenu)(THIS_
  471.                                 HMENU hmenu,
  472.                                 UINT indexMenu,
  473.                                 UINT idCmdFirst,
  474.                                 UINT idCmdLast,
  475.                                 UINT uFlags) PURE;
  476.  
  477.     STDMETHOD(InvokeCommand)(THIS_
  478.                              LPCMINVOKECOMMANDINFO lpici) PURE;
  479.  
  480.     STDMETHOD(GetCommandString)(THIS_
  481.                                 UINT        idCmd,
  482.                                 UINT        uType,
  483.                                 UINT      * pwReserved,
  484.                                 LPSTR       pszName,
  485.                                 UINT        cchMax) PURE;
  486.  
  487.     // *** IContextMenu2 methods ***
  488.     
  489.     STDMETHOD(HandleMenuMsg)(THIS_
  490.                              UINT uMsg,
  491.                              WPARAM wParam,
  492.                              LPARAM lParam) PURE;
  493.  
  494.     // *** IContextMenu3 methods ***
  495.     
  496.     STDMETHOD(HandleMenuMsg2)(THIS_
  497.                              UINT uMsg,
  498.                              WPARAM wParam,
  499.                              LPARAM lParam,
  500.                              LRESULT* plResult) PURE;
  501. };
  502.  
  503. typedef IContextMenu3 * LPCONTEXTMENU3;
  504.  
  505.  
  506. //===========================================================================
  507. //
  508. // Interface: IShellExtInit
  509. //
  510. //  The IShellExtInit interface is used by the explorer to initialize shell
  511. // extension objects. The explorer (1) calls CoCreateInstance (or equivalent)
  512. // with the registered CLSID and IID_IShellExtInit, (2) calls its Initialize
  513. // member, then (3) calls its QueryInterface to a particular interface (such
  514. // as IContextMenu or IPropSheetExt and (4) performs the rest of operation.
  515. //
  516. //
  517. // [Member functions]
  518. //
  519. // IShellExtInit::Initialize
  520. //
  521. //  This member function is called when the explorer is initializing either
  522. // context menu extension, property sheet extension or non-default drag-drop
  523. // extension.
  524. //
  525. //  Parameters: (context menu or property sheet extension)
  526. //   pidlFolder -- Specifies the parent folder
  527. //   lpdobj -- Spefifies the set of items selected in that folder.
  528. //   hkeyProgID -- Specifies the type of the focused item in the selection.
  529. //
  530. //  Parameters: (non-default drag-and-drop extension)
  531. //   pidlFolder -- Specifies the target (destination) folder
  532. //   lpdobj -- Specifies the items that are dropped (see the description
  533. //    about shell's clipboard below for clipboard formats).
  534. //   hkeyProgID -- Specifies the folder type.
  535. //
  536. //===========================================================================
  537.  
  538. #undef  INTERFACE
  539. #define INTERFACE   IShellExtInit
  540.  
  541. DECLARE_INTERFACE_(IShellExtInit, IUnknown)
  542. {
  543.     // *** IUnknown methods ***
  544.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  545.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  546.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  547.  
  548.     // *** IShellExtInit methods ***
  549.     STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidlFolder,
  550.                           LPDATAOBJECT lpdobj, HKEY hkeyProgID) PURE;
  551. };
  552.  
  553. typedef IShellExtInit * LPSHELLEXTINIT;
  554.  
  555.  
  556. //===========================================================================
  557. //
  558. // Interface: IShellPropSheetExt
  559. //
  560. //  The explorer uses the IShellPropSheetExt to allow property sheet
  561. // extensions or control panel extensions to add additional property
  562. // sheet pages.
  563. //
  564. //
  565. // [Member functions]
  566. //
  567. // IShellPropSheetExt::AddPages
  568. //
  569. //  The explorer calls this member function when it finds a registered
  570. // property sheet extension for a particular type of object. For each
  571. // additional page, the extension creates a page object by calling
  572. // CreatePropertySheetPage API and calls lpfnAddPage.
  573. //
  574. //  Parameters:
  575. //   lpfnAddPage -- Specifies the callback function.
  576. //   lParam -- Specifies the opaque handle to be passed to the callback function.
  577. //
  578. //
  579. // IShellPropSheetExt::ReplacePage
  580. //
  581. //  The explorer never calls this member of property sheet extensions. The
  582. // explorer calls this member of control panel extensions, so that they
  583. // can replace some of default control panel pages (such as a page of
  584. // mouse control panel).
  585. //
  586. //  Parameters:
  587. //   uPageID -- Specifies the page to be replaced.
  588. //   lpfnReplace Specifies the callback function.
  589. //   lParam -- Specifies the opaque handle to be passed to the callback function.
  590. //
  591. //===========================================================================
  592.  
  593. #undef  INTERFACE
  594. #define INTERFACE   IShellPropSheetExt
  595.  
  596. DECLARE_INTERFACE_(IShellPropSheetExt, IUnknown)
  597. {
  598.     // *** IUnknown methods ***
  599.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  600.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  601.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  602.  
  603.     // *** IShellPropSheetExt methods ***
  604.     STDMETHOD(AddPages)(THIS_ LPFNADDPROPSHEETPAGE lpfnAddPage, LPARAM lParam) PURE;
  605.     STDMETHOD(ReplacePage)(THIS_ UINT uPageID, LPFNADDPROPSHEETPAGE lpfnReplaceWith, LPARAM lParam) PURE;
  606. };
  607.  
  608. typedef IShellPropSheetExt * LPSHELLPROPSHEETEXT;
  609.  
  610.  
  611. //===========================================================================
  612. //
  613. // IPersistFolder Interface
  614. //
  615. //  The IPersistFolder interface is used by the file system implementation of
  616. // IShellFolder::BindToObject when it is initializing a shell folder object.
  617. //
  618. //
  619. // [Member functions]
  620. //
  621. // IPersistFolder::Initialize
  622. //
  623. //  This member function is called when the explorer is initializing a
  624. // shell folder object.
  625. //
  626. //  Parameters:
  627. //   pidl -- Specifies the absolute location of the folder.
  628. //
  629. //===========================================================================
  630.  
  631. #undef  INTERFACE
  632. #define INTERFACE   IPersistFolder
  633.  
  634. DECLARE_INTERFACE_(IPersistFolder, IPersist)    // fld
  635. {
  636.     // *** IUnknown methods ***
  637.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  638.     STDMETHOD_(ULONG,AddRef)(THIS)  PURE;
  639.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  640.  
  641.     // *** IPersist methods ***
  642.     STDMETHOD(GetClassID)(THIS_ LPCLSID lpClassID) PURE;
  643.  
  644.     // *** IPersistFolder methods ***
  645.     STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidl) PURE;
  646. };
  647.  
  648. typedef IPersistFolder *LPPERSISTFOLDER;
  649.  
  650. #if (_WIN32_IE >= 0x0400)
  651.  
  652. #undef  INTERFACE
  653. #define INTERFACE   IPersistFolder2
  654.  
  655. DECLARE_INTERFACE_(IPersistFolder2, IPersistFolder)
  656. {
  657.     // *** IUnknown methods ***
  658.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  659.     STDMETHOD_(ULONG,AddRef)(THIS)  PURE;
  660.     STDMETHOD_(ULONG,Release)(THIS) PURE;
  661.  
  662.     // *** IPersist methods ***
  663.     STDMETHOD(GetClassID)(THIS_ LPCLSID lpClassID) PURE;
  664.  
  665.     // *** IPersistFolder methods ***
  666.     STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidl) PURE;
  667.  
  668.     // *** IPersistFolder2 methods ***
  669.     STDMETHOD(GetCurFolder)(THIS_ LPITEMIDLIST *ppidl) PURE;
  670. };
  671.  
  672. #if (_WIN32_IE >= 0x0401)
  673. typedef IPersistFolder2 *LPPERSISTFOLDER2;
  674. #endif
  675.  
  676. #endif
  677.  
  678.  
  679. //===========================================================================
  680. //
  681. // IExtractIcon interface
  682. //
  683. //  This interface is used in two different places in the shell.
  684. //
  685. // Case-1: Icons of sub-folders for the scope-pane of the explorer.
  686. //
  687. //  It is used by the explorer to get the "icon location" of
  688. // sub-folders from each shell folders. When the user expands a folder
  689. // in the scope pane of the explorer, the explorer does following:
  690. //  (1) binds to the folder (gets IShellFolder),
  691. //  (2) enumerates its sub-folders by calling its EnumObjects member,
  692. //  (3) calls its GetUIObjectOf member to get IExtractIcon interface
  693. //     for each sub-folders.
  694. //  In this case, the explorer uses only IExtractIcon::GetIconLocation
  695. // member to get the location of the appropriate icon. An icon location
  696. // always consists of a file name (typically DLL or EXE) and either an icon
  697. // resource or an icon index.
  698. //
  699. //
  700. // Case-2: Extracting an icon image from a file
  701. //
  702. //  It is used by the shell when it extracts an icon image
  703. // from a file. When the shell is extracting an icon from a file,
  704. // it does following:
  705. //  (1) creates the icon extraction handler object (by getting its CLSID
  706. //     under the {ProgID}\shell\ExtractIconHanler key and calling
  707. //     CoCreateInstance requesting for IExtractIcon interface).
  708. //  (2) Calls IExtractIcon::GetIconLocation.
  709. //  (3) Then, calls IExtractIcon::ExtractIcon with the location/index pair.
  710. //  (4) If (3) returns NOERROR, it uses the returned icon.
  711. //  (5) Otherwise, it recursively calls this logic with new location
  712. //     assuming that the location string contains a fully qualified path name.
  713. //
  714. //  From extension programmer's point of view, there are only two cases
  715. // where they provide implementations of IExtractIcon:
  716. //  Case-1) providing explorer extensions (i.e., IShellFolder).
  717. //  Case-2) providing per-instance icons for some types of files.
  718. //
  719. // Because Case-1 is described above, we'll explain only Case-2 here.
  720. //
  721. // When the shell is about display an icon for a file, it does following:
  722. //  (1) Finds its ProgID and ClassID.
  723. //  (2) If the file has a ClassID, it gets the icon location string from the
  724. //    "DefaultIcon" key under it. The string indicates either per-class
  725. //    icon (e.g., "FOOBAR.DLL,2") or per-instance icon (e.g., "%1,1").
  726. //  (3) If a per-instance icon is specified, the shell creates an icon
  727. //    extraction handler object for it, and extracts the icon from it
  728. //    (which is described above).
  729. //
  730. //  It is important to note that the shell calls IExtractIcon::GetIconLocation
  731. // first, then calls IExtractIcon::Extract. Most application programs
  732. // that support per-instance icons will probably store an icon location
  733. // (DLL/EXE name and index/id) rather than an icon image in each file.
  734. // In those cases, a programmer needs to implement only the GetIconLocation
  735. // member and it Extract member simply returns S_FALSE. They need to
  736. // implement Extract member only if they decided to store the icon images
  737. // within files themselved or some other database (which is very rare).
  738. //
  739. //
  740. //
  741. // [Member functions]
  742. //
  743. //
  744. // IExtractIcon::GetIconLocation
  745. //
  746. //  This function returns an icon location.
  747. //
  748. //  Parameters:
  749. //   uFlags     [in]  -- Specifies if it is opened or not (GIL_OPENICON or 0)
  750. //   szIconFile [out] -- Specifies the string buffer buffer for a location name.
  751. //   cchMax     [in]  -- Specifies the size of szIconFile (almost always MAX_PATH)
  752. //   piIndex    [out] -- Sepcifies the address of UINT for the index.
  753. //   pwFlags    [out] -- Returns GIL_* flags
  754. //  Returns:
  755. //   NOERROR, if it returns a valid location; S_FALSE, if the shell use a
  756. //   default icon.
  757. //
  758. //  Notes: The location may or may not be a path to a file. The caller can
  759. //   not assume anything unless the subsequent Extract member call returns
  760. //   S_FALSE.
  761. //
  762. //   if the returned location is not a path to a file, GIL_NOTFILENAME should
  763. //   be set in the returned flags.
  764. //
  765. // IExtractIcon::Extract
  766. //
  767. //  This function extracts an icon image from a specified file.
  768. //
  769. //  Parameters:
  770. //   pszFile [in] -- Specifies the icon location (typically a path to a file).
  771. //   nIconIndex [in] -- Specifies the icon index.
  772. //   phiconLarge [out] -- Specifies the HICON variable for large icon.
  773. //   phiconSmall [out] -- Specifies the HICON variable for small icon.
  774. //   nIconSize [in] -- Specifies the size icon required (size of large icon)
  775. //                     LOWORD is the requested large icon size
  776. //                     HIWORD is the requested small icon size
  777. //  Returns:
  778. //   NOERROR, if it extracted the from the file.
  779. //   S_FALSE, if the caller should extract from the file specified in the
  780. //           location.
  781. //
  782. //===========================================================================
  783.  
  784. // GetIconLocation() input flags
  785.  
  786. #define GIL_OPENICON     0x0001      // allows containers to specify an "open" look
  787. #define GIL_FORSHELL     0x0002      // icon is to be displayed in a ShellFolder
  788. #define GIL_ASYNC        0x0020      // this is an async extract, return E_ASYNC
  789.  
  790. // GetIconLocation() return flags
  791.  
  792. #define GIL_SIMULATEDOC  0x0001      // simulate this document icon for this
  793. #define GIL_PERINSTANCE  0x0002      // icons from this class are per instance (each file has its own)
  794. #define GIL_PERCLASS     0x0004      // icons from this class per class (shared for all files of this type)
  795. #define GIL_NOTFILENAME  0x0008      // location is not a filename, must call ::ExtractIcon
  796. #define GIL_DONTCACHE    0x0010      // this icon should not be cached
  797.  
  798. #undef  INTERFACE
  799. #define INTERFACE   IExtractIconA
  800.  
  801. DECLARE_INTERFACE_(IExtractIconA, IUnknown)     // exic
  802. {
  803.     // *** IUnknown methods ***
  804.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  805.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  806.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  807.  
  808.     // *** IExtractIcon methods ***
  809.     STDMETHOD(GetIconLocation)(THIS_
  810.                          UINT   uFlags,
  811.                          LPSTR  szIconFile,
  812.                          UINT   cchMax,
  813.                          int   * piIndex,
  814.                          UINT  * pwFlags) PURE;
  815.  
  816.     STDMETHOD(Extract)(THIS_
  817.                            LPCSTR pszFile,
  818.                            UINT   nIconIndex,
  819.                            HICON   *phiconLarge,
  820.                            HICON   *phiconSmall,
  821.                            UINT    nIconSize) PURE;
  822. };
  823.  
  824. typedef IExtractIconA * LPEXTRACTICONA;
  825.  
  826. #undef  INTERFACE
  827. #define INTERFACE   IExtractIconW
  828.  
  829. DECLARE_INTERFACE_(IExtractIconW, IUnknown)     // exic
  830. {
  831.     // *** IUnknown methods ***
  832.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  833.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  834.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  835.  
  836.     // *** IExtractIcon methods ***
  837.     STDMETHOD(GetIconLocation)(THIS_
  838.                          UINT   uFlags,
  839.                          LPWSTR szIconFile,
  840.                          UINT   cchMax,
  841.                          int   * piIndex,
  842.                          UINT  * pwFlags) PURE;
  843.  
  844.     STDMETHOD(Extract)(THIS_
  845.                            LPCWSTR pszFile,
  846.                            UINT   nIconIndex,
  847.                            HICON   *phiconLarge,
  848.                            HICON   *phiconSmall,
  849.                            UINT    nIconSize) PURE;
  850. };
  851.  
  852. typedef IExtractIconW * LPEXTRACTICONW;
  853.  
  854. #ifdef UNICODE
  855. #define IExtractIcon        IExtractIconW
  856. #define IExtractIconVtbl    IExtractIconWVtbl
  857. #define LPEXTRACTICON       LPEXTRACTICONW
  858. #else
  859. #define IExtractIcon        IExtractIconA
  860. #define IExtractIconVtbl    IExtractIconAVtbl
  861. #define LPEXTRACTICON       LPEXTRACTICONA
  862. #endif
  863.  
  864. //===========================================================================
  865. //
  866. // IShellIcon Interface
  867. //
  868. // used to get a icon index for a IShellFolder object.
  869. //
  870. // this interface can be implemented by a IShellFolder, as a quick way to
  871. // return the icon for a object in the folder.
  872. //
  873. // a instance of this interface is only created once for the folder, unlike
  874. // IExtractIcon witch is created once for each object.
  875. //
  876. // if a ShellFolder does not implement this interface, the standard
  877. // GetUIObject(....IExtractIcon) method will be used to get a icon
  878. // for all objects.
  879. //
  880. // the following standard imagelist indexs can be returned:
  881. //
  882. //      0   document (blank page) (not associated)
  883. //      1   document (with stuff on the page)
  884. //      2   application (exe, com, bat)
  885. //      3   folder (plain)
  886. //      4   folder (open)
  887. //
  888. // IShellIcon:GetIconOf(pidl, flags, lpIconIndex)
  889. //
  890. //      pidl            object to get icon for.
  891. //      flags           GIL_* input flags (GIL_OPEN, ...)
  892. //      lpIconIndex     place to return icon index.
  893. //
  894. //  returns:
  895. //      NOERROR, if lpIconIndex contains the correct system imagelist index.
  896. //      S_FALSE, if unable to get icon for this object, go through
  897. //               GetUIObject, IExtractIcon, methods.
  898. //
  899. //===========================================================================
  900.  
  901. #undef  INTERFACE
  902. #define INTERFACE   IShellIcon
  903.  
  904. DECLARE_INTERFACE_(IShellIcon, IUnknown)      // shi
  905. {
  906.     // *** IUnknown methods ***
  907.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  908.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  909.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  910.  
  911.     // *** IShellIcon methods ***
  912.     STDMETHOD(GetIconOf)(THIS_ LPCITEMIDLIST pidl, UINT flags,
  913.                     LPINT lpIconIndex) PURE;
  914. };
  915.  
  916. typedef IShellIcon *LPSHELLICON;
  917.  
  918. //===========================================================================
  919. //
  920. // IShellIconOverlayIdentifier
  921. //
  922. // Used to identify a file as a member of the group of files that have this specific 
  923. // icon overlay
  924. //
  925. // Users can create new IconOverlayIdentifiers and place them in the following registry
  926. // location together with the Icon overlay image and their priority. 
  927. // HKEY_LOCAL_MACHINE "Software\\Microsoft\\Windows\\CurrentVersion\\ShellIconOverlayIdentifiers"
  928. // 
  929. // The shell will enumerate through all IconOverlayIdentifiers at start, and prioritize 
  930. // them according to internal rules, in case the internal rules don't apply, we use their 
  931. // input priority
  932. //
  933. // IShellIconOverlayIdentifier:IsMemberOf(LPCWSTR pwszPath, DWORD dwAttrib)
  934. //      pwszPath        full path of the file
  935. //      dwAttrib        attribute of this file 
  936. //
  937. //  returns:
  938. //      S_OK,    if the file is a member
  939. //      S_FALSE, if the file is not a member
  940. //      E_FAIL,  if the operation failed due to bad WIN32_FIND_DATA
  941. //
  942. // IShellIconOverlayIdentifier::GetOverlayInfo(LPWSTR pwszIconFile, int * pIndex, DWORD * dwFlags) PURE;
  943. //      pszIconFile    the path of the icon file
  944. //      pIndex         Depend on the flags, this could contain the IconIndex or the Sytem Imagelist Index
  945. //      dwFlags        defined below
  946. //
  947. // IShellIconOverlayIdentifier::GetPriority(int * pIPriority) PURE;
  948. //      pIPriority     the priority of this Overlay Identifier
  949. //
  950. //===========================================================================
  951.  
  952. #undef  INTERFACE
  953. #define INTERFACE   IShellIconOverlayIdentifier
  954.  
  955. DECLARE_INTERFACE_(IShellIconOverlayIdentifier, IUnknown)
  956. {
  957.     // *** IUnknown methods ***
  958.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  959.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  960.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  961.  
  962.     // *** IShellIconOverlayIdentifier methods ***
  963.     STDMETHOD (IsMemberOf)(THIS_ LPCWSTR pwszPath, DWORD dwAttrib) PURE;  
  964.     STDMETHOD (GetOverlayInfo)(THIS_ LPWSTR pwszIconFile, int cchMax, int * pIndex, DWORD * pdwFlags) PURE;  
  965.     STDMETHOD (GetPriority)(THIS_ int * pIPriority) PURE;
  966. };
  967.  
  968. #define ISIOI_ICONFILE            0x00000001          // path is returned through pwszIconFile
  969. #define ISIOI_ICONINDEX           0x00000002          // icon index in pwszIconFile is returned through pIndex 
  970. #define ISIOI_SYSIMAGELISTINDEX   0x00000004          // system imagelist icon index is returned through pIndex
  971.  
  972.  
  973. //===========================================================================
  974. //
  975. // IShellIconOverlay
  976. //
  977. // Used to return the icon overlay index or its icon index for an IShellFolder object, 
  978. // this is always implemented with IShellFolder 
  979. //
  980. // IShellIconOverlay:GetOverlayIndex(LPCITEMIDLIST pidl, DWORD * pdwIndex)
  981. //      pidl            object to identify icon overlay for.
  982. //      pdwIndex        the Overlay Index in the system image list
  983. //
  984. // IShellIconOverlay:GetOverlayIconIndex(LPCITEMIDLIST pidl, DWORD * pdwIndex)
  985. //      pdwIconIndex    the Overlay Icon index in the system image list 
  986. // This method is only used for those who are interested in seeing the real bits 
  987. // of the Overlay Icon
  988. //
  989. //  returns:
  990. //      S_OK,  if the index of an Overlay is found
  991. //      S_FALSE, if no Overlay exists for this file
  992. //      E_FAIL, if pidl is bad 
  993. //
  994. //===========================================================================
  995.  
  996. #undef  INTERFACE
  997. #define INTERFACE   IShellIconOverlay
  998.  
  999. DECLARE_INTERFACE_(IShellIconOverlay, IUnknown)
  1000. {
  1001.     // *** IUnknown methods ***
  1002.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1003.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1004.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1005.  
  1006.     // *** IShellIconOverlay methods ***
  1007.     STDMETHOD(GetOverlayIndex)(THIS_ LPCITEMIDLIST pidl, int * pIndex) PURE;
  1008.     STDMETHOD(GetOverlayIconIndex)(THIS_ LPCITEMIDLIST pidl, int * pIconIndex) PURE;
  1009. };
  1010.  
  1011. //===========================================================================
  1012. //
  1013. // IShellLink Interface
  1014. //
  1015. //===========================================================================
  1016.  
  1017. #ifdef UNICODE
  1018. #define IShellLink      IShellLinkW
  1019. #define IShellLinkVtbl  IShellLinkWVtbl
  1020. #else
  1021. #define IShellLink      IShellLinkA
  1022. #define IShellLinkVtbl  IShellLinkAVtbl
  1023. #endif
  1024.  
  1025. // IShellLink::Resolve fFlags
  1026. typedef enum {
  1027.     SLR_NO_UI           = 0x0001,
  1028.     SLR_ANY_MATCH       = 0x0002,
  1029.     SLR_UPDATE          = 0x0004,
  1030.     SLR_NOUPDATE        = 0x0008,
  1031. } SLR_FLAGS;
  1032.  
  1033. // IShellLink::GetPath fFlags
  1034. typedef enum {
  1035.     SLGP_SHORTPATH      = 0x0001,
  1036.     SLGP_UNCPRIORITY    = 0x0002,
  1037.     SLGP_RAWPATH        = 0x0004,
  1038. } SLGP_FLAGS;
  1039.  
  1040. #undef  INTERFACE
  1041. #define INTERFACE   IShellLinkA
  1042.  
  1043. DECLARE_INTERFACE_(IShellLinkA, IUnknown)       // sl
  1044. {
  1045.     // *** IUnknown methods ***
  1046.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1047.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1048.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1049.  
  1050.     // *** IShellLink methods ***
  1051.     STDMETHOD(GetPath)(THIS_ LPSTR pszFile, int cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags) PURE;
  1052.  
  1053.     STDMETHOD(GetIDList)(THIS_ LPITEMIDLIST * ppidl) PURE;
  1054.     STDMETHOD(SetIDList)(THIS_ LPCITEMIDLIST pidl) PURE;
  1055.  
  1056.     STDMETHOD(GetDescription)(THIS_ LPSTR pszName, int cchMaxName) PURE;
  1057.     STDMETHOD(SetDescription)(THIS_ LPCSTR pszName) PURE;
  1058.  
  1059.     STDMETHOD(GetWorkingDirectory)(THIS_ LPSTR pszDir, int cchMaxPath) PURE;
  1060.     STDMETHOD(SetWorkingDirectory)(THIS_ LPCSTR pszDir) PURE;
  1061.  
  1062.     STDMETHOD(GetArguments)(THIS_ LPSTR pszArgs, int cchMaxPath) PURE;
  1063.     STDMETHOD(SetArguments)(THIS_ LPCSTR pszArgs) PURE;
  1064.  
  1065.     STDMETHOD(GetHotkey)(THIS_ WORD *pwHotkey) PURE;
  1066.     STDMETHOD(SetHotkey)(THIS_ WORD wHotkey) PURE;
  1067.  
  1068.     STDMETHOD(GetShowCmd)(THIS_ int *piShowCmd) PURE;
  1069.     STDMETHOD(SetShowCmd)(THIS_ int iShowCmd) PURE;
  1070.  
  1071.     STDMETHOD(GetIconLocation)(THIS_ LPSTR pszIconPath, int cchIconPath, int *piIcon) PURE;
  1072.     STDMETHOD(SetIconLocation)(THIS_ LPCSTR pszIconPath, int iIcon) PURE;
  1073.  
  1074.     STDMETHOD(SetRelativePath)(THIS_ LPCSTR pszPathRel, DWORD dwReserved) PURE;
  1075.  
  1076.     STDMETHOD(Resolve)(THIS_ HWND hwnd, DWORD fFlags) PURE;
  1077.  
  1078.     STDMETHOD(SetPath)(THIS_ LPCSTR pszFile) PURE;
  1079. };
  1080.  
  1081. #undef  INTERFACE
  1082. #define INTERFACE   IShellLinkW
  1083.  
  1084. DECLARE_INTERFACE_(IShellLinkW, IUnknown)       // sl
  1085. {
  1086.     // *** IUnknown methods ***
  1087.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1088.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1089.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1090.  
  1091.     // *** IShellLink methods ***
  1092.     STDMETHOD(GetPath)(THIS_ LPWSTR pszFile, int cchMaxPath, WIN32_FIND_DATAW *pfd, DWORD fFlags) PURE;
  1093.  
  1094.     STDMETHOD(GetIDList)(THIS_ LPITEMIDLIST * ppidl) PURE;
  1095.     STDMETHOD(SetIDList)(THIS_ LPCITEMIDLIST pidl) PURE;
  1096.  
  1097.     STDMETHOD(GetDescription)(THIS_ LPWSTR pszName, int cchMaxName) PURE;
  1098.     STDMETHOD(SetDescription)(THIS_ LPCWSTR pszName) PURE;
  1099.  
  1100.     STDMETHOD(GetWorkingDirectory)(THIS_ LPWSTR pszDir, int cchMaxPath) PURE;
  1101.     STDMETHOD(SetWorkingDirectory)(THIS_ LPCWSTR pszDir) PURE;
  1102.  
  1103.     STDMETHOD(GetArguments)(THIS_ LPWSTR pszArgs, int cchMaxPath) PURE;
  1104.     STDMETHOD(SetArguments)(THIS_ LPCWSTR pszArgs) PURE;
  1105.  
  1106.     STDMETHOD(GetHotkey)(THIS_ WORD *pwHotkey) PURE;
  1107.     STDMETHOD(SetHotkey)(THIS_ WORD wHotkey) PURE;
  1108.  
  1109.     STDMETHOD(GetShowCmd)(THIS_ int *piShowCmd) PURE;
  1110.     STDMETHOD(SetShowCmd)(THIS_ int iShowCmd) PURE;
  1111.  
  1112.     STDMETHOD(GetIconLocation)(THIS_ LPWSTR pszIconPath, int cchIconPath, int *piIcon) PURE;
  1113.     STDMETHOD(SetIconLocation)(THIS_ LPCWSTR pszIconPath, int iIcon) PURE;
  1114.  
  1115.     STDMETHOD(SetRelativePath)(THIS_ LPCWSTR pszPathRel, DWORD dwReserved) PURE;
  1116.  
  1117.     STDMETHOD(Resolve)(THIS_ HWND hwnd, DWORD fFlags) PURE;
  1118.  
  1119.     STDMETHOD(SetPath)(THIS_ LPCWSTR pszFile) PURE;
  1120. };
  1121.  
  1122.  
  1123. #ifdef _INC_SHELLAPI    /* for LPSHELLEXECUTEINFO */
  1124. //===========================================================================
  1125. //
  1126. // IShellExecuteHook Interface
  1127. //
  1128. //===========================================================================
  1129.  
  1130. #undef  INTERFACE
  1131. #define INTERFACE   IShellExecuteHookA
  1132.  
  1133. DECLARE_INTERFACE_(IShellExecuteHookA, IUnknown) // shexhk
  1134. {
  1135.     // *** IUnknown methods ***
  1136.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1137.     STDMETHOD_(ULONG, AddRef) (THIS)  PURE;
  1138.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  1139.  
  1140.     // *** IShellExecuteHookA methods ***
  1141.     STDMETHOD(Execute)(THIS_ LPSHELLEXECUTEINFOA pei) PURE;
  1142. };
  1143.  
  1144. #undef  INTERFACE
  1145. #define INTERFACE   IShellExecuteHookW
  1146.  
  1147. DECLARE_INTERFACE_(IShellExecuteHookW, IUnknown) // shexhk
  1148. {
  1149.     // *** IUnknown methods ***
  1150.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1151.     STDMETHOD_(ULONG, AddRef) (THIS)  PURE;
  1152.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  1153.  
  1154.     // *** IShellExecuteHookW methods ***
  1155.     STDMETHOD(Execute)(THIS_ LPSHELLEXECUTEINFOW pei) PURE;
  1156. };
  1157.  
  1158. #ifdef UNICODE
  1159. #define IShellExecuteHook       IShellExecuteHookW
  1160. #define IShellExecuteHookVtbl   IShellExecuteHookWVtbl
  1161. #else
  1162. #define IShellExecuteHook       IShellExecuteHookA
  1163. #define IShellExecuteHookVtbl   IShellExecuteHookAVtbl
  1164. #endif
  1165. #endif
  1166.  
  1167. //===========================================================================
  1168. //
  1169. // IURLSearchHook Interface
  1170. //
  1171. //===========================================================================
  1172.  
  1173. #undef  INTERFACE
  1174. #define INTERFACE   IURLSearchHook
  1175.  
  1176. DECLARE_INTERFACE_(IURLSearchHook, IUnknown)
  1177. {
  1178.     // *** IUnknown methods ***
  1179.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1180.     STDMETHOD_(ULONG, AddRef) (THIS)  PURE;
  1181.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  1182.  
  1183.     // *** IURLSearchHook methods ***
  1184.     STDMETHOD(Translate)(THIS_ LPWSTR lpwszSearchURL, DWORD cchBufferSize) PURE;
  1185. };
  1186.  
  1187. //===========================================================================
  1188. //
  1189. // INewShortcutHook Interface
  1190. //
  1191. //===========================================================================
  1192.  
  1193. #undef  INTERFACE
  1194. #define INTERFACE   INewShortcutHookA
  1195.  
  1196. DECLARE_INTERFACE_(INewShortcutHookA, IUnknown) // nshhk
  1197. {
  1198.     // *** IUnknown methods ***
  1199.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1200.     STDMETHOD_(ULONG, AddRef) (THIS)  PURE;
  1201.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  1202.  
  1203.     // *** INewShortcutHook methods ***
  1204.     STDMETHOD(SetReferent)(THIS_ LPCSTR pcszReferent, HWND hwnd) PURE;
  1205.     STDMETHOD(GetReferent)(THIS_ LPSTR pszReferent, int cchReferent) PURE;
  1206.     STDMETHOD(SetFolder)(THIS_ LPCSTR pcszFolder) PURE;
  1207.     STDMETHOD(GetFolder)(THIS_ LPSTR pszFolder, int cchFolder) PURE;
  1208.     STDMETHOD(GetName)(THIS_ LPSTR pszName, int cchName) PURE;
  1209.     STDMETHOD(GetExtension)(THIS_ LPSTR pszExtension, int cchExtension) PURE;
  1210. };
  1211.  
  1212. #undef  INTERFACE
  1213. #define INTERFACE   INewShortcutHookW
  1214.  
  1215. DECLARE_INTERFACE_(INewShortcutHookW, IUnknown) // nshhk
  1216. {
  1217.     // *** IUnknown methods ***
  1218.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1219.     STDMETHOD_(ULONG, AddRef) (THIS)  PURE;
  1220.     STDMETHOD_(ULONG, Release) (THIS) PURE;
  1221.  
  1222.     // *** INewShortcutHook methods ***
  1223.     STDMETHOD(SetReferent)(THIS_ LPCWSTR pcszReferent, HWND hwnd) PURE;
  1224.     STDMETHOD(GetReferent)(THIS_ LPWSTR pszReferent, int cchReferent) PURE;
  1225.     STDMETHOD(SetFolder)(THIS_ LPCWSTR pcszFolder) PURE;
  1226.     STDMETHOD(GetFolder)(THIS_ LPWSTR pszFolder, int cchFolder) PURE;
  1227.     STDMETHOD(GetName)(THIS_ LPWSTR pszName, int cchName) PURE;
  1228.     STDMETHOD(GetExtension)(THIS_ LPWSTR pszExtension, int cchExtension) PURE;
  1229. };
  1230.  
  1231. #ifdef UNICODE
  1232. #define INewShortcutHook        INewShortcutHookW
  1233. #define INewShortcutHookVtbl    INewShortcutHookWVtbl
  1234. #else
  1235. #define INewShortcutHook        INewShortcutHookA
  1236. #define INewShortcutHookVtbl    INewShortcutHookAVtbl
  1237. #endif
  1238.  
  1239. //===========================================================================
  1240. //
  1241. // ICopyHook Interface
  1242. //
  1243. //  The copy hook is called whenever file system directories are
  1244. //  copy/moved/deleted/renamed via the shell.  It is also called by the shell
  1245. //  on changes of status of printers.
  1246. //
  1247. //  Clients register their id under STRREG_SHEX_COPYHOOK for file system hooks
  1248. //  and STRREG_SHEx_PRNCOPYHOOK for printer hooks.
  1249. //  the CopyCallback is called prior to the action, so the hook has the chance
  1250. //  to allow, deny or cancel the operation by returning the falues:
  1251. //     IDYES  -  means allow the operation
  1252. //     IDNO   -  means disallow the operation on this file, but continue with
  1253. //              any other operations (eg. batch copy)
  1254. //     IDCANCEL - means disallow the current operation and cancel any pending
  1255. //              operations
  1256. //
  1257. //   arguments to the CopyCallback
  1258. //      hwnd - window to use for any UI
  1259. //      wFunc - what operation is being done
  1260. //      wFlags - and flags (FOF_*) set in the initial call to the file operation
  1261. //      pszSrcFile - name of the source file
  1262. //      dwSrcAttribs - file attributes of the source file
  1263. //      pszDestFile - name of the destiation file (for move and renames)
  1264. //      dwDestAttribs - file attributes of the destination file
  1265. //
  1266. //
  1267. //===========================================================================
  1268.  
  1269. #ifndef FO_MOVE //these need to be kept in sync with the ones in shellapi.h
  1270.  
  1271. // file operations
  1272.  
  1273. #define FO_MOVE           0x0001
  1274. #define FO_COPY           0x0002
  1275. #define FO_DELETE         0x0003
  1276. #define FO_RENAME         0x0004
  1277.  
  1278. #define FOF_MULTIDESTFILES         0x0001
  1279. #define FOF_CONFIRMMOUSE           0x0002
  1280. #define FOF_SILENT                 0x0004  // don't create progress/report
  1281. #define FOF_RENAMEONCOLLISION      0x0008
  1282. #define FOF_NOCONFIRMATION         0x0010  // Don't prompt the user.
  1283. #define FOF_WANTMAPPINGHANDLE      0x0020  // Fill in SHFILEOPSTRUCT.hNameMappings
  1284.                                       // Must be freed using SHFreeNameMappings
  1285. #define FOF_ALLOWUNDO              0x0040
  1286. #define FOF_FILESONLY              0x0080  // on *.*, do only files
  1287. #define FOF_SIMPLEPROGRESS         0x0100  // means don't show names of files
  1288. #define FOF_NOCONFIRMMKDIR         0x0200  // don't confirm making any needed dirs
  1289. #define FOF_NOERRORUI              0x0400  // don't put up error UI
  1290. #define FOF_NOCOPYSECURITYATTRIBS  0x0800  // dont copy NT file Security Attributes
  1291.  
  1292. typedef UINT FILEOP_FLAGS;
  1293.  
  1294. // printer operations
  1295.  
  1296. #define PO_DELETE       0x0013  // printer is being deleted
  1297. #define PO_RENAME       0x0014  // printer is being renamed
  1298. #define PO_PORTCHANGE   0x0020  // port this printer connected to is being changed
  1299.                                 // if this id is set, the strings received by
  1300.                                 // the copyhook are a doubly-null terminated
  1301.                                 // list of strings.  The first is the printer
  1302.                                 // name and the second is the printer port.
  1303. #define PO_REN_PORT     0x0034  // PO_RENAME and PO_PORTCHANGE at same time.
  1304.  
  1305. // no POF_ flags currently defined
  1306.  
  1307. typedef UINT PRINTEROP_FLAGS;
  1308.  
  1309. #endif // FO_MOVE
  1310.  
  1311. #undef  INTERFACE
  1312. #define INTERFACE   ICopyHookA
  1313.  
  1314. DECLARE_INTERFACE_(ICopyHookA, IUnknown)        // sl
  1315. {
  1316.     // *** IUnknown methods ***
  1317.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1318.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1319.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1320.  
  1321.     // *** ICopyHook methods ***
  1322.     STDMETHOD_(UINT,CopyCallback) (THIS_ HWND hwnd, UINT wFunc, UINT wFlags, LPCSTR pszSrcFile, DWORD dwSrcAttribs,
  1323.                                    LPCSTR pszDestFile, DWORD dwDestAttribs) PURE;
  1324. };
  1325.  
  1326. typedef ICopyHookA *    LPCOPYHOOKA;
  1327.  
  1328. #undef  INTERFACE
  1329. #define INTERFACE   ICopyHookW
  1330.  
  1331. DECLARE_INTERFACE_(ICopyHookW, IUnknown)        // sl
  1332. {
  1333.     // *** IUnknown methods ***
  1334.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1335.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1336.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1337.  
  1338.     // *** ICopyHook methods ***
  1339.     STDMETHOD_(UINT,CopyCallback) (THIS_ HWND hwnd, UINT wFunc, UINT wFlags, LPCWSTR pszSrcFile, DWORD dwSrcAttribs,
  1340.                                    LPCWSTR pszDestFile, DWORD dwDestAttribs) PURE;
  1341. };
  1342.  
  1343. typedef ICopyHookW *    LPCOPYHOOKW;
  1344.  
  1345. #ifdef UNICODE
  1346. #define ICopyHook       ICopyHookW
  1347. #define ICopyHookVtbl   ICopyHookWVtbl
  1348. #define LPCOPYHOOK      LPCOPYHOOKW
  1349. #else
  1350. #define ICopyHook       ICopyHookA
  1351. #define ICopyHookVtbl   ICopyHookAVtbl
  1352. #define LPCOPYHOOK      LPCOPYHOOKA
  1353. #endif
  1354.  
  1355. //===========================================================================
  1356. //
  1357. // IFileViewerSite Interface
  1358. //
  1359. //===========================================================================
  1360.  
  1361. #undef  INTERFACE
  1362. #define INTERFACE   IFileViewerSite
  1363.  
  1364. DECLARE_INTERFACE_(IFileViewerSite, IUnknown)
  1365. {
  1366.     // *** IUnknown methods ***
  1367.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1368.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1369.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1370.  
  1371.     // *** IFileViewerSite methods ***
  1372.     STDMETHOD(SetPinnedWindow) (THIS_ HWND hwnd) PURE;
  1373.     STDMETHOD(GetPinnedWindow) (THIS_ HWND *phwnd) PURE;
  1374. };
  1375.  
  1376. typedef IFileViewerSite * LPFILEVIEWERSITE;
  1377.  
  1378.  
  1379. //===========================================================================
  1380. //
  1381. // IFileViewer Interface
  1382. //
  1383. // Implemented in a FileViewer component object.  Used to tell a
  1384. // FileViewer to PrintTo or to view, the latter happening though
  1385. // ShowInitialize and Show.  The filename is always given to the
  1386. // viewer through IPersistFile.
  1387. //
  1388. //===========================================================================
  1389.  
  1390. typedef struct
  1391. {
  1392.     // Stuff passed into viewer (in)
  1393.     DWORD cbSize;           // Size of structure for future expansion...
  1394.     HWND hwndOwner;         // who is the owner window.
  1395.     int iShow;              // The show command
  1396.  
  1397.     // Passed in and updated  (in/Out)
  1398.     DWORD dwFlags;          // flags
  1399.     RECT rect;              // Where to create the window may have defaults
  1400.     LPUNKNOWN punkRel;      // Relese this interface when window is visible
  1401.  
  1402.     // Stuff that might be returned from viewer (out)
  1403.     OLECHAR strNewFile[MAX_PATH];   // New File to view.
  1404.  
  1405. } FVSHOWINFO, *LPFVSHOWINFO;
  1406.  
  1407.     // Define File View Show Info Flags.
  1408. #define FVSIF_RECT      0x00000001      // The rect variable has valid data.
  1409. #define FVSIF_PINNED    0x00000002      // We should Initialize pinned
  1410.  
  1411. #define FVSIF_NEWFAILED 0x08000000      // The new file passed back failed
  1412.                                         // to be viewed.
  1413.  
  1414. #define FVSIF_NEWFILE   0x80000000      // A new file to view has been returned
  1415. #define FVSIF_CANVIEWIT 0x40000000      // The viewer can view it.
  1416.  
  1417. #undef  INTERFACE
  1418. #define INTERFACE   IFileViewerA
  1419.  
  1420. DECLARE_INTERFACE(IFileViewerA)
  1421. {
  1422.     // *** IUnknown methods ***
  1423.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1424.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1425.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1426.  
  1427.     // *** IFileViewer methods ***
  1428.     STDMETHOD(ShowInitialize) (THIS_ LPFILEVIEWERSITE lpfsi) PURE;
  1429.     STDMETHOD(Show) (THIS_ LPFVSHOWINFO pvsi) PURE;
  1430.     STDMETHOD(PrintTo) (THIS_ LPSTR pszDriver, BOOL fSuppressUI) PURE;
  1431. };
  1432.  
  1433. typedef IFileViewerA * LPFILEVIEWERA;
  1434.  
  1435. #undef  INTERFACE
  1436. #define INTERFACE   IFileViewerW
  1437.  
  1438. DECLARE_INTERFACE(IFileViewerW)
  1439. {
  1440.     // *** IUnknown methods ***
  1441.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1442.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1443.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1444.  
  1445.     // *** IFileViewer methods ***
  1446.     STDMETHOD(ShowInitialize) (THIS_ LPFILEVIEWERSITE lpfsi) PURE;
  1447.     STDMETHOD(Show) (THIS_ LPFVSHOWINFO pvsi) PURE;
  1448.     STDMETHOD(PrintTo) (THIS_ LPWSTR pszDriver, BOOL fSuppressUI) PURE;
  1449. };
  1450.  
  1451. typedef IFileViewerW * LPFILEVIEWERW;
  1452.  
  1453. #ifdef UNICODE
  1454. #define IFileViewer IFileViewerW
  1455. #define LPFILEVIEWER LPFILEVIEWERW
  1456. #else
  1457. #define IFileViewer IFileViewerA
  1458. #define LPFILEVIEWER LPFILEVIEWERA
  1459. #endif
  1460.  
  1461.  
  1462.  
  1463. //==========================================================================
  1464. //
  1465. // IShellBrowser/IShellView/IShellFolder interface
  1466. //
  1467. //  These three interfaces are used when the shell communicates with
  1468. // name space extensions. The shell (explorer) provides IShellBrowser
  1469. // interface, and extensions implements IShellFolder and IShellView
  1470. // interfaces.
  1471. //
  1472. //==========================================================================
  1473.  
  1474.  
  1475. //--------------------------------------------------------------------------
  1476. //
  1477. // Command/menuitem IDs
  1478. //
  1479. //  The explorer dispatches WM_COMMAND messages based on the range of
  1480. // command/menuitem IDs. All the IDs of menuitems that the view (right
  1481. // pane) inserts must be in FCIDM_SHVIEWFIRST/LAST (otherwise, the explorer
  1482. // won't dispatch them). The view should not deal with any menuitems
  1483. // in FCIDM_BROWSERFIRST/LAST (otherwise, it won't work with the future
  1484. // version of the shell).
  1485. //
  1486. //  FCIDM_SHVIEWFIRST/LAST      for the right pane (IShellView)
  1487. //  FCIDM_BROWSERFIRST/LAST     for the explorer frame (IShellBrowser)
  1488. //  FCIDM_GLOBAL/LAST           for the explorer's submenu IDs
  1489. //
  1490. //--------------------------------------------------------------------------
  1491.  
  1492. #define FCIDM_SHVIEWFIRST           0x0000
  1493. #define FCIDM_SHVIEWLAST            0x7fff
  1494. #define FCIDM_BROWSERFIRST          0xa000
  1495. #define FCIDM_BROWSERLAST           0xbf00
  1496. #define FCIDM_GLOBALFIRST           0x8000
  1497. #define FCIDM_GLOBALLAST            0x9fff
  1498.  
  1499. //
  1500. // Global submenu IDs and separator IDs
  1501. //
  1502. #define FCIDM_MENU_FILE             (FCIDM_GLOBALFIRST+0x0000)
  1503. #define FCIDM_MENU_EDIT             (FCIDM_GLOBALFIRST+0x0040)
  1504. #define FCIDM_MENU_VIEW             (FCIDM_GLOBALFIRST+0x0080)
  1505. #define FCIDM_MENU_VIEW_SEP_OPTIONS (FCIDM_GLOBALFIRST+0x0081)
  1506. #define FCIDM_MENU_TOOLS            (FCIDM_GLOBALFIRST+0x00c0)
  1507. #define FCIDM_MENU_TOOLS_SEP_GOTO   (FCIDM_GLOBALFIRST+0x00c1)
  1508. #define FCIDM_MENU_HELP             (FCIDM_GLOBALFIRST+0x0100)
  1509. #define FCIDM_MENU_FIND             (FCIDM_GLOBALFIRST+0x0140)
  1510. #define FCIDM_MENU_EXPLORE          (FCIDM_GLOBALFIRST+0x0150)
  1511. #define FCIDM_MENU_FAVORITES        (FCIDM_GLOBALFIRST+0x0170)
  1512.  
  1513. //--------------------------------------------------------------------------
  1514. // control IDs known to the view
  1515. //--------------------------------------------------------------------------
  1516.  
  1517. #define FCIDM_TOOLBAR      (FCIDM_BROWSERFIRST + 0)
  1518. #define FCIDM_STATUS       (FCIDM_BROWSERFIRST + 1)
  1519.  
  1520. #if (_WIN32_IE >= 0x0400)
  1521. //--------------------------------------------------------------------------
  1522. //
  1523. // The resource id of the offline cursor
  1524. // This cursor is avaialble in shdocvw.dll 
  1525. #define IDC_OFFLINE_HAND        103
  1526. //
  1527. //--------------------------------------------------------------------------
  1528. #endif
  1529.  
  1530. //--------------------------------------------------------------------------
  1531. //
  1532. // FOLDERSETTINGS
  1533. //
  1534. //  FOLDERSETTINGS is a data structure that explorer passes from one folder
  1535. // view to another, when the user is browsing. It calls ISV::GetCurrentInfo
  1536. // member to get the current settings and pass it to ISV::CreateViewWindow
  1537. // to allow the next folder view "inherit" it. These settings assumes a
  1538. // particular UI (which the shell's folder view has), and shell extensions
  1539. // may or may not use those settings.
  1540. //
  1541. //--------------------------------------------------------------------------
  1542.  
  1543. typedef LPBYTE LPVIEWSETTINGS;
  1544.  
  1545. // NB Bitfields.
  1546. // FWF_DESKTOP implies FWF_TRANSPARENT/NOCLIENTEDGE/NOSCROLL
  1547. typedef enum
  1548.     {
  1549.     FWF_AUTOARRANGE =       0x0001,
  1550.     FWF_ABBREVIATEDNAMES =  0x0002,
  1551.     FWF_SNAPTOGRID =        0x0004,
  1552.     FWF_OWNERDATA =         0x0008,
  1553.     FWF_BESTFITWINDOW =     0x0010,
  1554.     FWF_DESKTOP =           0x0020,
  1555.     FWF_SINGLESEL =         0x0040,
  1556.     FWF_NOSUBFOLDERS =      0x0080,
  1557.     FWF_TRANSPARENT  =      0x0100,
  1558.     FWF_NOCLIENTEDGE =      0x0200,
  1559.     FWF_NOSCROLL     =      0x0400,
  1560.     FWF_ALIGNLEFT    =      0x0800,
  1561.     FWF_NOICONS      =      0x1000,
  1562.     FWF_SINGLECLICKACTIVATE=0x8000  // TEMPORARY -- NO UI FOR THIS
  1563.     } FOLDERFLAGS;
  1564.  
  1565. typedef enum
  1566.     {
  1567.     FVM_ICON =              1,
  1568.     FVM_SMALLICON =         2,
  1569.     FVM_LIST =              3,
  1570.     FVM_DETAILS =           4,
  1571.     } FOLDERVIEWMODE;
  1572.  
  1573. typedef struct
  1574.     {
  1575.     UINT ViewMode;       // View mode (FOLDERVIEWMODE values)
  1576.     UINT fFlags;         // View options (FOLDERFLAGS bits)
  1577.     } FOLDERSETTINGS, *LPFOLDERSETTINGS;
  1578.  
  1579. typedef const FOLDERSETTINGS * LPCFOLDERSETTINGS;
  1580.  
  1581. //--------------------------------------------------------------------------
  1582. //
  1583. // Interface:   IShellBrowser
  1584. //
  1585. //  IShellBrowser interface is the interface that is provided by the shell
  1586. // explorer/folder frame window. When it creates the "contents pane" of
  1587. // a shell folder (which provides IShellFolder interface), it calls its
  1588. // CreateViewObject member function to create an IShellView object. Then,
  1589. // it calls its CreateViewWindow member to create the "contents pane"
  1590. // window. The pointer to the IShellBrowser interface is passed to
  1591. // the IShellView object as a parameter to this CreateViewWindow member
  1592. // function call.
  1593. //
  1594. //    +--------------------------+  <-- Explorer window
  1595. //    | [] Explorer              |
  1596. //    |--------------------------+       IShellBrowser
  1597. //    | File Edit View ..        |
  1598. //    |--------------------------|
  1599. //    |        |                 |
  1600. //    |        |              <-------- Content pane
  1601. //    |        |                 |
  1602. //    |        |                 |       IShellView
  1603. //    |        |                 |
  1604. //    |        |                 |
  1605. //    +--------------------------+
  1606. //
  1607. //
  1608. //
  1609. // [Member functions]
  1610. //
  1611. //
  1612. // IShellBrowser::GetWindow(phwnd)
  1613. //
  1614. //   Inherited from IOleWindow::GetWindow.
  1615. //
  1616. //
  1617. // IShellBrowser::ContextSensitiveHelp(fEnterMode)
  1618. //
  1619. //   Inherited from IOleWindow::ContextSensitiveHelp.
  1620. //
  1621. //
  1622. // IShellBrowser::InsertMenusSB(hmenuShared, lpMenuWidths)
  1623. //
  1624. //   Similar to the IOleInPlaceFrame::InsertMenus. The explorer will put
  1625. //  "File" and "Edit" pulldown in the File menu group, "View" and "Tools"
  1626. //  in the Container menu group and "Help" in the Window menu group. Each
  1627. //  pulldown menu will have a uniqu ID, FCIDM_MENU_FILE/EDIT/VIEW/TOOLS/HELP.
  1628. //  The view is allowed to insert menuitems into those sub-menus by those
  1629. //  IDs must be between FCIDM_SHVIEWFIRST and FCIDM_SHVIEWLAST.
  1630. //
  1631. //
  1632. // IShellBrowser::SetMenuSB(hmenuShared, holemenu, hwndActiveObject)
  1633. //
  1634. //   Similar to the IOleInPlaceFrame::SetMenu. The explorer ignores the
  1635. //  holemenu parameter (reserved for future enhancement)  and performs
  1636. //  menu-dispatch based on the menuitem IDs (see the description above).
  1637. //  It is important to note that the explorer will add different
  1638. //  set of menuitems depending on whether the view has a focus or not.
  1639. //  Therefore, it is very important to call ISB::OnViewWindowActivate
  1640. //  whenever the view window (or its children) gets the focus.
  1641. //
  1642. //
  1643. // IShellBrowser::RemoveMenusSB(hmenuShared)
  1644. //
  1645. //   Same as the IOleInPlaceFrame::RemoveMenus.
  1646. //
  1647. //
  1648. // IShellBrowser::SetStatusTextSB(lpszStatusText)
  1649. //
  1650. //   Same as the IOleInPlaceFrame::SetStatusText. It is also possible to
  1651. //  send messages directly to the status window via SendControlMsg.
  1652. //
  1653. //
  1654. // IShellBrowser::EnableModelessSB(fEnable)
  1655. //
  1656. //   Same as the IOleInPlaceFrame::EnableModeless.
  1657. //
  1658. //
  1659. // IShellBrowser::TranslateAcceleratorSB(lpmsg, wID)
  1660. //
  1661. //   Same as the IOleInPlaceFrame::TranslateAccelerator, but will be
  1662. //  never called because we don't support EXEs (i.e., the explorer has
  1663. //  the message loop). This member function is defined here for possible
  1664. //  future enhancement.
  1665. //
  1666. //
  1667. // IShellBrowser::BrowseObject(pidl, wFlags)
  1668. //
  1669. //   The view calls this member to let shell explorer browse to another
  1670. //  folder. The pidl and wFlags specifies the folder to be browsed.
  1671. //
  1672. //  Following three flags specifies whether it creates another window or not.
  1673. //   SBSP_SAMEBROWSER  -- Browse to another folder with the same window.
  1674. //   SBSP_NEWBROWSER   -- Creates another window for the specified folder.
  1675. //   SBSP_DEFBROWSER   -- Default behavior (respects the view option).
  1676. //
  1677. //  Following three flags specifies open, explore, or default mode. These   .
  1678. //  are ignored if SBSP_SAMEBROWSER or (SBSP_DEFBROWSER && (single window   .
  1679. //  browser || explorer)).                                                  .
  1680. //   SBSP_OPENMODE     -- Use a normal folder window
  1681. //   SBSP_EXPLOREMODE  -- Use an explorer window
  1682. //   SBSP_DEFMODE      -- Use the same as the current window
  1683. //
  1684. //  Following three flags specifies the pidl.
  1685. //   SBSP_ABSOLUTE -- pidl is an absolute pidl (relative from desktop)
  1686. //   SBSP_RELATIVE -- pidl is relative from the current folder.
  1687. //   SBSP_PARENT   -- Browse the parent folder (ignores the pidl)
  1688. //   SBSP_NAVIGATEBACK    -- Navigate back (ignores the pidl)
  1689. //   SBSP_NAVIGATEFORWARD -- Navigate forward (ignores the pidl)
  1690. //
  1691. //  Following two flags control history manipulation as result of navigate
  1692. //   SBSP_WRITENOHISTORY -- write no history (shell folder) entry
  1693. //   SBSP_NOAUTOSELECT -- suppress selection in history pane
  1694. //
  1695. // IShellBrowser::GetViewStateStream(grfMode, ppstm)
  1696. //
  1697. //   The browser returns an IStream interface as the storage for view
  1698. //  specific state information.
  1699. //
  1700. //   grfMode -- Specifies the read/write access (STGM_READ/WRITE/READWRITE)
  1701. //   ppstm   -- Specifies the LPSTREAM variable to be filled.
  1702. //
  1703. //
  1704. // IShellBrowser::GetControlWindow(id, phwnd)
  1705. //
  1706. //   The shell view may call this member function to get the window handle
  1707. //  of Explorer controls (toolbar or status winodw -- FCW_TOOLBAR or
  1708. //  FCW_STATUS).
  1709. //
  1710. //
  1711. // IShellBrowser::SendControlMsg(id, uMsg, wParam, lParam, pret)
  1712. //
  1713. //   The shell view calls this member function to send control messages to
  1714. //  one of Explorer controls (toolbar or status window -- FCW_TOOLBAR or
  1715. //  FCW_STATUS).
  1716. //
  1717. //
  1718. // IShellBrowser::QueryActiveShellView(IShellView * ppshv)
  1719. //
  1720. //   This member returns currently activated (displayed) shellview object.
  1721. //  A shellview never need to call this member function.
  1722. //
  1723. //
  1724. // IShellBrowser::OnViewWindowActive(pshv)
  1725. //
  1726. //   The shell view window calls this member function when the view window
  1727. //  (or one of its children) got the focus. It MUST call this member before
  1728. //  calling IShellBrowser::InsertMenus, because it will insert different
  1729. //  set of menu items depending on whether the view has the focus or not.
  1730. //
  1731. //
  1732. // IShellBrowser::SetToolbarItems(lpButtons, nButtons, uFlags)
  1733. //
  1734. //   The view calls this function to add toolbar items to the exporer's
  1735. //  toolbar. "lpButtons" and "nButtons" specifies the array of toolbar
  1736. //  items. "uFlags" must be one of FCT_MERGE, FCT_CONFIGABLE, FCT_ADDTOEND.
  1737. //
  1738. //-------------------------------------------------------------------------
  1739.  
  1740. //
  1741. // Values for wFlags parameter of ISB::BrowseObject() member.
  1742. //
  1743. #define SBSP_DEFBROWSER         0x0000
  1744. #define SBSP_SAMEBROWSER        0x0001
  1745. #define SBSP_NEWBROWSER         0x0002
  1746.  
  1747. #define SBSP_DEFMODE            0x0000
  1748. #define SBSP_OPENMODE           0x0010
  1749. #define SBSP_EXPLOREMODE        0x0020
  1750.  
  1751. #define SBSP_ABSOLUTE           0x0000
  1752. #define SBSP_RELATIVE           0x1000
  1753. #define SBSP_PARENT             0x2000
  1754. #define SBSP_NAVIGATEBACK       0x4000
  1755. #define SBSP_NAVIGATEFORWARD    0x8000
  1756.  
  1757. #define SBSP_ALLOW_AUTONAVIGATE 0x10000
  1758.  
  1759. #define SBSP_INITIATEDBYHLINKFRAME        0x80000000
  1760. #define SBSP_REDIRECT                     0x40000000
  1761.  
  1762. #define SBSP_WRITENOHISTORY     0x08000000
  1763. #define SBSP_NOAUTOSELECT       0x04000000
  1764.  
  1765.  
  1766. //
  1767. // Values for id parameter of ISB::GetWindow/SendControlMsg members.
  1768. //
  1769. // WARNING:
  1770. //  Any shell extensions which sends messages to those control windows
  1771. // might not work in the future version of windows. If you really need
  1772. // to send messages to them, (1) don't assume that those control window
  1773. // always exist (i.e. GetControlWindow may fail) and (2) verify the window
  1774. // class of the window before sending any messages.
  1775. //
  1776. #define FCW_STATUS      0x0001
  1777. #define FCW_TOOLBAR     0x0002
  1778. #define FCW_TREE        0x0003
  1779. #define FCW_INTERNETBAR 0x0006
  1780. #define FCW_PROGRESS    0x0008
  1781.  
  1782. #if (_WIN32_IE >= 0x0400)
  1783. #endif
  1784.  
  1785. //
  1786. // Values for uFlags paremeter of ISB::SetToolbarItems member.
  1787. //
  1788. #define FCT_MERGE       0x0001
  1789. #define FCT_CONFIGABLE  0x0002
  1790. #define FCT_ADDTOEND    0x0004
  1791.  
  1792.  
  1793. #undef  INTERFACE
  1794. #define INTERFACE   IShellBrowser
  1795.  
  1796. DECLARE_INTERFACE_(IShellBrowser, IOleWindow)
  1797. {
  1798.     // *** IUnknown methods ***
  1799.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1800.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1801.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1802.  
  1803.     // *** IOleWindow methods ***
  1804.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  1805.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  1806.  
  1807.     // *** IShellBrowser methods *** (same as IOleInPlaceFrame)
  1808.     STDMETHOD(InsertMenusSB) (THIS_ HMENU hmenuShared,
  1809.                                 LPOLEMENUGROUPWIDTHS lpMenuWidths) PURE;
  1810.     STDMETHOD(SetMenuSB) (THIS_ HMENU hmenuShared, HOLEMENU holemenuReserved,
  1811.                 HWND hwndActiveObject) PURE;
  1812.     STDMETHOD(RemoveMenusSB) (THIS_ HMENU hmenuShared) PURE;
  1813.     STDMETHOD(SetStatusTextSB) (THIS_ LPCOLESTR lpszStatusText) PURE;
  1814.     STDMETHOD(EnableModelessSB) (THIS_ BOOL fEnable) PURE;
  1815.     STDMETHOD(TranslateAcceleratorSB) (THIS_ LPMSG lpmsg, WORD wID) PURE;
  1816.  
  1817.     // *** IShellBrowser methods ***
  1818.     STDMETHOD(BrowseObject)(THIS_ LPCITEMIDLIST pidl, UINT wFlags) PURE;
  1819.     STDMETHOD(GetViewStateStream)(THIS_ DWORD grfMode,
  1820.                 LPSTREAM  *ppStrm) PURE;
  1821.     STDMETHOD(GetControlWindow)(THIS_ UINT id, HWND * lphwnd) PURE;
  1822.     STDMETHOD(SendControlMsg)(THIS_ UINT id, UINT uMsg, WPARAM wParam,
  1823.                 LPARAM lParam, LRESULT * pret) PURE;
  1824.     STDMETHOD(QueryActiveShellView)(THIS_ struct IShellView ** ppshv) PURE;
  1825.     STDMETHOD(OnViewWindowActive)(THIS_ struct IShellView * ppshv) PURE;
  1826.     STDMETHOD(SetToolbarItems)(THIS_ LPTBBUTTON lpButtons, UINT nButtons,
  1827.                 UINT uFlags) PURE;
  1828. };
  1829. #define __IShellBrowser_INTERFACE_DEFINED__
  1830.  
  1831. typedef IShellBrowser * LPSHELLBROWSER;
  1832.  
  1833. enum {
  1834.     SBSC_HIDE = 0,
  1835.     SBSC_SHOW = 1,
  1836.     SBSC_TOGGLE = 2,
  1837.     SBSC_QUERY =  3
  1838. };
  1839.  
  1840. enum {
  1841.         SBO_DEFAULT = 0 ,
  1842.         SBO_NOBROWSERPAGES = 1
  1843. };
  1844.  
  1845.  
  1846. #if (_WIN32_IE >= 0x0400)
  1847. #endif
  1848.  
  1849. //-------------------------------------------------------------------------
  1850. // ICommDlgBrowser interface
  1851. //
  1852. //  ICommDlgBrowser interface is the interface that is provided by the new
  1853. // common dialog window to hook and modify the behavior of IShellView.  When
  1854. // a default view is created, it queries its parent IShellBrowser for the
  1855. // ICommDlgBrowser interface.  If supported, it calls out to that interface
  1856. // in several cases that need to behave differently in a dialog.
  1857. //
  1858. // Member functions:
  1859. //
  1860. //  ICommDlgBrowser::OnDefaultCommand()
  1861. //    Called when the user double-clicks in the view or presses Enter.  The
  1862. //   browser should return S_OK if it processed the action itself, S_FALSE
  1863. //   to let the view perform the default action.
  1864. //
  1865. //  ICommDlgBrowser::OnStateChange(ULONG uChange)
  1866. //    Called when some states in the view change.  'uChange' is one of the
  1867. //   CDBOSC_* values.  This call is made after the state (selection, focus,
  1868. //   etc) has changed.  There is no return value.
  1869. //
  1870. //  ICommDlgBrowser::IncludeObject(LPCITEMIDLIST pidl)
  1871. //    Called when the view is enumerating objects.  'pidl' is a relative
  1872. //   IDLIST.  The browser should return S_OK to include the object in the
  1873. //   view, S_FALSE to hide it
  1874. //
  1875. //-------------------------------------------------------------------------
  1876.  
  1877. #define CDBOSC_SETFOCUS     0x00000000
  1878. #define CDBOSC_KILLFOCUS    0x00000001
  1879. #define CDBOSC_SELCHANGE    0x00000002
  1880. #define CDBOSC_RENAME       0x00000003
  1881.  
  1882. #undef  INTERFACE
  1883. #define INTERFACE   ICommDlgBrowser
  1884.  
  1885. DECLARE_INTERFACE_(ICommDlgBrowser, IUnknown)
  1886. {
  1887.     // *** IUnknown methods ***
  1888.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  1889.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  1890.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  1891.  
  1892.     // *** ICommDlgBrowser methods ***
  1893.     STDMETHOD(OnDefaultCommand) (THIS_ struct IShellView * ppshv) PURE;
  1894.     STDMETHOD(OnStateChange) (THIS_ struct IShellView * ppshv,
  1895.                 ULONG uChange) PURE;
  1896.     STDMETHOD(IncludeObject) (THIS_ struct IShellView * ppshv,
  1897.                 LPCITEMIDLIST pidl) PURE;
  1898. };
  1899.  
  1900. typedef ICommDlgBrowser * LPCOMMDLGBROWSER;
  1901.  
  1902.  
  1903. //==========================================================================
  1904. //
  1905. // Interface:   IShellView
  1906. //
  1907. // IShellView::GetWindow(phwnd)
  1908. //
  1909. //   Inherited from IOleWindow::GetWindow.
  1910. //
  1911. //
  1912. // IShellView::ContextSensitiveHelp(fEnterMode)
  1913. //
  1914. //   Inherited from IOleWindow::ContextSensitiveHelp.
  1915. //
  1916. //
  1917. // IShellView::TranslateAccelerator(lpmsg)
  1918. //
  1919. //   Similar to IOleInPlaceActiveObject::TranlateAccelerator. The explorer
  1920. //  calls this function BEFORE any other translation. Returning S_OK
  1921. //  indicates that the message was translated (eaten) and should not be
  1922. //  translated or dispatched by the explorer.
  1923. //
  1924. //
  1925. // IShellView::EnableModeless(fEnable)
  1926. //   Similar to IOleInPlaceActiveObject::EnableModeless.
  1927. //
  1928. //
  1929. // IShellView::UIActivate(uState)
  1930. //
  1931. //   The explorer calls this member function whenever the activation
  1932. //  state of the view window is changed by a certain event that is
  1933. //  NOT caused by the shell view itself.
  1934. //
  1935. //   SVUIA_DEACTIVATE will be passed when the explorer is about to
  1936. //  destroy the shell view window; the shell view is supposed to remove
  1937. //  all the extended UIs (typically merged menu and modeless popup windows).
  1938. //
  1939. //   SVUIA_ACTIVATE_NOFOCUS will be passsed when the shell view is losing
  1940. //  the input focus or the shell view has been just created without the
  1941. //  input focus; the shell view is supposed to set menuitems appropriate
  1942. //  for non-focused state (no selection specific items should be added).
  1943. //
  1944. //   SVUIA_ACTIVATE_FOCUS will be passed when the explorer has just
  1945. //  created the view window with the input focus; the shell view is
  1946. //  supposed to set menuitems appropriate for focused state.
  1947. //
  1948. //   SVUIA_INPLACEACTIVATE(new) will be passed when the shell view is opened
  1949. //  within an ActiveX control, which is not a UI active. In this case,
  1950. //  the shell view should not merge menus or put toolbas. To be compatible
  1951. //  with Win95 client, we don't pass this value unless the view supports
  1952. //  IShellView2.
  1953. //
  1954. //   The shell view should not change focus within this member function.
  1955. //  The shell view should not hook the WM_KILLFOCUS message to remerge
  1956. //  menuitems. However, the shell view typically hook the WM_SETFOCUS
  1957. //  message, and re-merge the menu after calling IShellBrowser::
  1958. //  OnViewWindowActivated.
  1959. //
  1960. //
  1961. // IShellView::Refresh()
  1962. //
  1963. //   The explorer calls this member when the view needs to refresh its
  1964. //  contents (such as when the user hits F5 key).
  1965. //
  1966. //
  1967. // IShellView::CreateViewWindow
  1968. //
  1969. //   This member creates the view window (right-pane of the explorer or the
  1970. //  client window of the folder window).
  1971. //
  1972. //
  1973. // IShellView::DestroyViewWindow
  1974. //
  1975. //   This member destroys the view window.
  1976. //
  1977. //
  1978. // IShellView::GetCurrentInfo
  1979. //
  1980. //   This member returns the folder settings.
  1981. //
  1982. //
  1983. // IShellView::AddPropertySHeetPages
  1984. //
  1985. //   The explorer calls this member when it is opening the option property
  1986. //  sheet. This allows the view to add additional pages to it.
  1987. //
  1988. //
  1989. // IShellView::SaveViewState()
  1990. //
  1991. //   The explorer calls this member when the shell view is supposed to
  1992. //  store its view settings. The shell view is supposed to get a view
  1993. //  stream by calling IShellBrowser::GetViewStateStream and store the
  1994. //  current view state into that stream.
  1995. //
  1996. //
  1997. // IShellView::SelectItem(pidlItem, uFlags)
  1998. //
  1999. //   The explorer calls this member to change the selection state of
  2000. //  item(s) within the shell view window.  If pidlItem is NULL and uFlags
  2001. //  is SVSI_DESELECTOTHERS, all items should be deselected.
  2002. //
  2003. //-------------------------------------------------------------------------
  2004.  
  2005. //
  2006. // shellview select item flags
  2007. //
  2008. #define SVSI_DESELECT   0x0000
  2009. #define SVSI_SELECT     0x0001
  2010. #define SVSI_EDIT       0x0003  // includes select
  2011. #define SVSI_DESELECTOTHERS 0x0004
  2012. #define SVSI_ENSUREVISIBLE  0x0008
  2013. #define SVSI_FOCUSED        0x0010
  2014. #define SVSI_TRANSLATEPT    0x0020
  2015.  
  2016. //
  2017. // shellview get item object flags
  2018. //
  2019. #define SVGIO_BACKGROUND    0x00000000
  2020. #define SVGIO_SELECTION     0x00000001
  2021. #define SVGIO_ALLVIEW       0x00000002
  2022.  
  2023. //
  2024. // uState values for IShellView::UIActivate
  2025. //
  2026. typedef enum {
  2027.     SVUIA_DEACTIVATE       = 0,
  2028.     SVUIA_ACTIVATE_NOFOCUS = 1,
  2029.     SVUIA_ACTIVATE_FOCUS   = 2,
  2030.     SVUIA_INPLACEACTIVATE  = 3          // new flag for IShellView2
  2031. } SVUIA_STATUS;
  2032.  
  2033. #undef  INTERFACE
  2034. #define INTERFACE   IShellView
  2035.  
  2036. DECLARE_INTERFACE_(IShellView, IOleWindow)
  2037. {
  2038.     // *** IUnknown methods ***
  2039.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2040.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2041.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2042.  
  2043.     // *** IOleWindow methods ***
  2044.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2045.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2046.  
  2047.     // *** IShellView methods ***
  2048.     STDMETHOD(TranslateAccelerator) (THIS_ LPMSG lpmsg) PURE;
  2049. #ifdef _FIX_ENABLEMODELESS_CONFLICT
  2050.     STDMETHOD(EnableModelessSV) (THIS_ BOOL fEnable) PURE;
  2051. #else
  2052.     STDMETHOD(EnableModeless) (THIS_ BOOL fEnable) PURE;
  2053. #endif
  2054.     STDMETHOD(UIActivate) (THIS_ UINT uState) PURE;
  2055.     STDMETHOD(Refresh) (THIS) PURE;
  2056.  
  2057.     STDMETHOD(CreateViewWindow)(THIS_ IShellView  *lpPrevView,
  2058.                     LPCFOLDERSETTINGS lpfs, IShellBrowser  * psb,
  2059.                     RECT * prcView, HWND  *phWnd) PURE;
  2060.     STDMETHOD(DestroyViewWindow)(THIS) PURE;
  2061.     STDMETHOD(GetCurrentInfo)(THIS_ LPFOLDERSETTINGS lpfs) PURE;
  2062.     STDMETHOD(AddPropertySheetPages)(THIS_ DWORD dwReserved,
  2063.                     LPFNADDPROPSHEETPAGE lpfn, LPARAM lparam) PURE;
  2064.     STDMETHOD(SaveViewState)(THIS) PURE;
  2065.     STDMETHOD(SelectItem)(THIS_ LPCITEMIDLIST pidlItem, UINT uFlags) PURE;
  2066.     STDMETHOD(GetItemObject)(THIS_ UINT uItem, REFIID riid,
  2067.                     LPVOID *ppv) PURE;
  2068. };
  2069.  
  2070. typedef IShellView *    LPSHELLVIEW;
  2071.  
  2072. typedef GUID SHELLVIEWID;
  2073.  
  2074. #define SV2GV_CURRENTVIEW ((UINT)-1)
  2075. #define SV2GV_DEFAULTVIEW ((UINT)-2)
  2076.  
  2077. typedef struct _SV2CVW2_PARAMS
  2078. {
  2079.     DWORD cbSize;
  2080.  
  2081.     IShellView *psvPrev;
  2082.     FOLDERSETTINGS const *pfs;
  2083.     IShellBrowser *psbOwner;
  2084.     RECT *prcView;
  2085.     SHELLVIEWID const *pvid;
  2086.  
  2087.     HWND hwndView;
  2088. } SV2CVW2_PARAMS;
  2089. typedef SV2CVW2_PARAMS *LPSV2CVW2_PARAMS;
  2090.  
  2091. #undef  INTERFACE
  2092. #define INTERFACE   IShellView2
  2093.  
  2094. DECLARE_INTERFACE_(IShellView2, IShellView)
  2095. {
  2096.     // *** IUnknown methods ***
  2097.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2098.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2099.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2100.  
  2101.     // *** IOleWindow methods ***
  2102.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2103.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2104.  
  2105.     // *** IShellView methods ***
  2106.     STDMETHOD(TranslateAccelerator) (THIS_ LPMSG lpmsg) PURE;
  2107. #ifdef _FIX_ENABLEMODELESS_CONFLICT
  2108.     STDMETHOD(EnableModelessSV) (THIS_ BOOL fEnable) PURE;
  2109. #else
  2110.     STDMETHOD(EnableModeless) (THIS_ BOOL fEnable) PURE;
  2111. #endif
  2112.     STDMETHOD(UIActivate) (THIS_ UINT uState) PURE;
  2113.     STDMETHOD(Refresh) (THIS) PURE;
  2114.  
  2115.     STDMETHOD(CreateViewWindow)(THIS_ IShellView  *lpPrevView,
  2116.                     LPCFOLDERSETTINGS lpfs, IShellBrowser  * psb,
  2117.                     RECT * prcView, HWND  *phWnd) PURE;
  2118.     STDMETHOD(DestroyViewWindow)(THIS) PURE;
  2119.     STDMETHOD(GetCurrentInfo)(THIS_ LPFOLDERSETTINGS lpfs) PURE;
  2120.     STDMETHOD(AddPropertySheetPages)(THIS_ DWORD dwReserved,
  2121.                     LPFNADDPROPSHEETPAGE lpfn, LPARAM lparam) PURE;
  2122.     STDMETHOD(SaveViewState)(THIS) PURE;
  2123.     STDMETHOD(SelectItem)(THIS_ LPCITEMIDLIST pidlItem, UINT uFlags) PURE;
  2124.     STDMETHOD(GetItemObject)(THIS_ UINT uItem, REFIID riid,
  2125.                     LPVOID *ppv) PURE;
  2126.  
  2127.     // *** IShellView2 methods ***
  2128.     STDMETHOD(GetView)(THIS_ SHELLVIEWID* pvid, ULONG uView) PURE;
  2129.     STDMETHOD(CreateViewWindow2)(THIS_ LPSV2CVW2_PARAMS lpParams) PURE;
  2130.     STDMETHOD(HandleRename)(THIS_ LPCITEMIDLIST pidlNew) PURE;
  2131.     STDMETHOD(SelectAndPositionItem) (THIS_ LPCITEMIDLIST pidlItem,
  2132.         UINT uFlags,POINT* point) PURE; 
  2133. };
  2134.  
  2135. //-------------------------------------------------------------------------
  2136. //
  2137. // struct STRRET
  2138. //
  2139. // structure for returning strings from IShellFolder member functions
  2140. //
  2141. //-------------------------------------------------------------------------
  2142. #define STRRET_WSTR     0x0000          // Use STRRET.pOleStr
  2143. #define STRRET_OFFSET   0x0001          // Use STRRET.uOffset to Ansi
  2144. #define STRRET_CSTR     0x0002          // Use STRRET.cStr
  2145.  
  2146.  
  2147. typedef struct _STRRET
  2148. {
  2149.     UINT uType; // One of the STRRET_* values
  2150.     union
  2151.     {
  2152.         LPWSTR          pOleStr;        // must be freed by caller of GetDisplayNameOf
  2153.         LPSTR           pStr;           // NOT USED
  2154.         UINT            uOffset;        // Offset into SHITEMID
  2155.         char            cStr[MAX_PATH]; // Buffer to fill in (ANSI)
  2156.     } DUMMYUNIONNAME;
  2157. } STRRET, *LPSTRRET;
  2158.  
  2159.  
  2160. //-------------------------------------------------------------------------
  2161. //
  2162. // SHGetPathFromIDList
  2163. //
  2164. //  This function assumes the size of the buffer (MAX_PATH). The pidl
  2165. // should point to a file system object.
  2166. //
  2167. //-------------------------------------------------------------------------
  2168.  
  2169. WINSHELLAPI BOOL WINAPI SHGetPathFromIDListA(LPCITEMIDLIST pidl, LPSTR pszPath);
  2170. WINSHELLAPI BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath);
  2171.  
  2172. #ifdef UNICODE
  2173. #define SHGetPathFromIDList SHGetPathFromIDListW
  2174. #else
  2175. #define SHGetPathFromIDList SHGetPathFromIDListA
  2176. #endif
  2177.  
  2178.  
  2179. //-------------------------------------------------------------------------
  2180. //
  2181. // SHGetSpecialFolderLocation
  2182. //
  2183. //  Caller should use SHGetMalloc to obtain an allocator that can free the pidl
  2184. //  
  2185. //
  2186. //-------------------------------------------------------------------------
  2187. //
  2188. // registry entries for special paths are kept in :
  2189. #define REGSTR_PATH_SPECIAL_FOLDERS    REGSTR_PATH_EXPLORER TEXT("\\Shell Folders")
  2190.  
  2191.  
  2192. #define CSIDL_DESKTOP                   0x0000
  2193. #define CSIDL_INTERNET                  0x0001
  2194. #define CSIDL_PROGRAMS                  0x0002
  2195. #define CSIDL_CONTROLS                  0x0003
  2196. #define CSIDL_PRINTERS                  0x0004
  2197. #define CSIDL_PERSONAL                  0x0005
  2198. #define CSIDL_FAVORITES                 0x0006
  2199. #define CSIDL_STARTUP                   0x0007
  2200. #define CSIDL_RECENT                    0x0008
  2201. #define CSIDL_SENDTO                    0x0009
  2202. #define CSIDL_BITBUCKET                 0x000a
  2203. #define CSIDL_STARTMENU                 0x000b
  2204. #define CSIDL_DESKTOPDIRECTORY          0x0010
  2205. #define CSIDL_DRIVES                    0x0011
  2206. #define CSIDL_NETWORK                   0x0012
  2207. #define CSIDL_NETHOOD                   0x0013
  2208. #define CSIDL_FONTS                     0x0014
  2209. #define CSIDL_TEMPLATES                 0x0015
  2210. #define CSIDL_COMMON_STARTMENU          0x0016
  2211. #define CSIDL_COMMON_PROGRAMS           0X0017
  2212. #define CSIDL_COMMON_STARTUP            0x0018
  2213. #define CSIDL_COMMON_DESKTOPDIRECTORY   0x0019
  2214. #define CSIDL_APPDATA                   0x001a
  2215. #define CSIDL_PRINTHOOD                 0x001b
  2216. #define CSIDL_ALTSTARTUP                0x001d         // DBCS
  2217. #define CSIDL_COMMON_ALTSTARTUP         0x001e         // DBCS
  2218. #define CSIDL_COMMON_FAVORITES          0x001f
  2219. #define CSIDL_INTERNET_CACHE            0x0020
  2220. #define CSIDL_COOKIES                   0x0021
  2221. #define CSIDL_HISTORY                   0x0022
  2222.  
  2223. WINSHELLAPI HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, int nFolder, LPITEMIDLIST * ppidl);
  2224.  
  2225. #if (_WIN32_IE >= 0x0400)
  2226.  
  2227. WINSHELLAPI BOOL WINAPI SHGetSpecialFolderPathA(HWND hwndOwner, LPSTR lpszPath, int nFolder, BOOL fCreate);
  2228. WINSHELLAPI BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR lpszPath, int nFolder, BOOL fCreate);
  2229. #ifdef UNICODE
  2230. #define SHGetSpecialFolderPath  SHGetSpecialFolderPathW
  2231. #else
  2232. #define SHGetSpecialFolderPath  SHGetSpecialFolderPathA
  2233. #endif
  2234.  
  2235. #endif      // _WIN32_IE >= 0x0400
  2236.  
  2237. //-------------------------------------------------------------------------
  2238. //
  2239. // SHBrowseForFolder API
  2240. //
  2241. //-------------------------------------------------------------------------
  2242.  
  2243. typedef int (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
  2244.  
  2245. typedef struct _browseinfoA {
  2246.     HWND        hwndOwner;
  2247.     LPCITEMIDLIST pidlRoot;
  2248.     LPSTR        pszDisplayName;// Return display name of item selected.
  2249.     LPCSTR       lpszTitle;      // text to go in the banner over the tree.
  2250.     UINT         ulFlags;       // Flags that control the return stuff
  2251.     BFFCALLBACK  lpfn;
  2252.     LPARAM      lParam;         // extra info that's passed back in callbacks
  2253.  
  2254.     int          iImage;      // output var: where to return the Image index.
  2255. } BROWSEINFOA, *PBROWSEINFOA, *LPBROWSEINFOA;
  2256.  
  2257. typedef struct _browseinfoW {
  2258.     HWND        hwndOwner;
  2259.     LPCITEMIDLIST pidlRoot;
  2260.     LPWSTR       pszDisplayName;// Return display name of item selected.
  2261.     LPCWSTR      lpszTitle;      // text to go in the banner over the tree.
  2262.     UINT         ulFlags;       // Flags that control the return stuff
  2263.     BFFCALLBACK  lpfn;
  2264.     LPARAM      lParam;         // extra info that's passed back in callbacks
  2265.  
  2266.     int          iImage;      // output var: where to return the Image index.
  2267. } BROWSEINFOW, *PBROWSEINFOW, *LPBROWSEINFOW;
  2268.  
  2269. #ifdef UNICODE
  2270. #define BROWSEINFO      BROWSEINFOW
  2271. #define PBROWSEINFO     PBROWSEINFOW
  2272. #define LPBROWSEINFO    LPBROWSEINFOW
  2273. #else
  2274. #define BROWSEINFO      BROWSEINFOA
  2275. #define PBROWSEINFO     PBROWSEINFOA
  2276. #define LPBROWSEINFO    LPBROWSEINFOA
  2277. #endif
  2278.  
  2279. // Browsing for directory.
  2280. #define BIF_RETURNONLYFSDIRS   0x0001  // For finding a folder to start document searching
  2281. #define BIF_DONTGOBELOWDOMAIN  0x0002  // For starting the Find Computer
  2282. #define BIF_STATUSTEXT         0x0004
  2283. #define BIF_RETURNFSANCESTORS  0x0008
  2284. #define BIF_EDITBOX            0x0010
  2285. #define BIF_VALIDATE           0x0020   // insist on valid result (or CANCEL)
  2286.  
  2287. #define BIF_BROWSEFORCOMPUTER  0x1000  // Browsing for Computers.
  2288. #define BIF_BROWSEFORPRINTER   0x2000  // Browsing for Printers
  2289. #define BIF_BROWSEINCLUDEFILES 0x4000  // Browsing for Everything
  2290.  
  2291. // message from browser
  2292. #define BFFM_INITIALIZED        1
  2293. #define BFFM_SELCHANGED         2
  2294. #define BFFM_VALIDATEFAILEDA    3   // lParam:szPath ret:1(cont),0(EndDialog)
  2295. #define BFFM_VALIDATEFAILEDW    4   // lParam:wzPath ret:1(cont),0(EndDialog)
  2296.  
  2297. // messages to browser
  2298. #define BFFM_SETSTATUSTEXTA     (WM_USER + 100)
  2299. #define BFFM_ENABLEOK           (WM_USER + 101)
  2300. #define BFFM_SETSELECTIONA      (WM_USER + 102)
  2301. #define BFFM_SETSELECTIONW      (WM_USER + 103)
  2302. #define BFFM_SETSTATUSTEXTW     (WM_USER + 104)
  2303.  
  2304. WINSHELLAPI LPITEMIDLIST WINAPI SHBrowseForFolderA(LPBROWSEINFOA lpbi);
  2305. WINSHELLAPI LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi);
  2306.  
  2307. #ifdef UNICODE
  2308. #define SHBrowseForFolder   SHBrowseForFolderW
  2309. #define BFFM_SETSTATUSTEXT  BFFM_SETSTATUSTEXTW
  2310. #define BFFM_SETSELECTION   BFFM_SETSELECTIONW
  2311.  
  2312. #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
  2313. #else
  2314. #define SHBrowseForFolder   SHBrowseForFolderA
  2315. #define BFFM_SETSTATUSTEXT  BFFM_SETSTATUSTEXTA
  2316. #define BFFM_SETSELECTION   BFFM_SETSELECTIONA
  2317.  
  2318. #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA
  2319. #endif
  2320.  
  2321. //-------------------------------------------------------------------------
  2322. //
  2323. // SHLoadInProc
  2324. //
  2325. //   When this function is called, the shell calls CoCreateInstance
  2326. //  (or equivalent) with CLSCTX_INPROC_SERVER and the specified CLSID
  2327. //  from within the shell's process and release it immediately.
  2328. //
  2329. //-------------------------------------------------------------------------
  2330.  
  2331. WINSHELLAPI HRESULT WINAPI SHLoadInProc(REFCLSID rclsid);
  2332.  
  2333.  
  2334. //-------------------------------------------------------------------------
  2335. //
  2336. // IEnumIDList interface
  2337. //
  2338. //  IShellFolder::EnumObjects member returns an IEnumIDList object.
  2339. //
  2340. //-------------------------------------------------------------------------
  2341.  
  2342. typedef struct IEnumIDList      *LPENUMIDLIST;
  2343.  
  2344. #undef  INTERFACE
  2345. #define INTERFACE       IEnumIDList
  2346.  
  2347. DECLARE_INTERFACE_(IEnumIDList, IUnknown)
  2348. {
  2349.     // *** IUnknown methods ***
  2350.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2351.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2352.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2353.  
  2354.     // *** IEnumIDList methods ***
  2355.     STDMETHOD(Next)  (THIS_ ULONG celt,
  2356.                       LPITEMIDLIST *rgelt,
  2357.                       ULONG *pceltFetched) PURE;
  2358.     STDMETHOD(Skip)  (THIS_ ULONG celt) PURE;
  2359.     STDMETHOD(Reset) (THIS) PURE;
  2360.     STDMETHOD(Clone) (THIS_ IEnumIDList **ppenum) PURE;
  2361. };
  2362.  
  2363.  
  2364. //-------------------------------------------------------------------------
  2365. //
  2366. // IShellFolder interface
  2367. //
  2368. //
  2369. // [Member functions]
  2370. //
  2371. // IShellFolder::BindToObject(pidl, pbc, riid, ppvOut)
  2372. //   This function returns an instance of a sub-folder which is specified
  2373. //  by the IDList (pidl).
  2374. //
  2375. // IShellFolder::BindToStorage(pidl, pbc, riid, ppvObj)
  2376. //   This function returns a storage instance of a sub-folder which is
  2377. //  specified by the IDList (pidl). The shell never calls this member
  2378. //  function in the first release of Win95.
  2379. //
  2380. // IShellFolder::CompareIDs(lParam, pidl1, pidl2)
  2381. //   This function compares two IDLists and returns the result. The shell
  2382. //  explorer always passes 0 as lParam, which indicates "sort by name".
  2383. //  It should return 0 (as CODE of the scode), if two id indicates the
  2384. //  same object; negative value if pidl1 should be placed before pidl2;
  2385. //  positive value if pidl2 should be placed before pidl1.
  2386. //
  2387. // IShellFolder::CreateViewObject(hwndOwner, riid, ppvOut)
  2388. //   This function creates a view object of the folder itself. The view
  2389. //  object is a difference instance from the shell folder object.
  2390. //   "hwndOwner" can be used  as the owner window of its dialog box or
  2391. //  menu during the lifetime of the view object.
  2392. //  instance which has only one reference count. The explorer may create
  2393. //  more than one instances of view object from one shell folder object
  2394. //  and treat them as separate instances.
  2395. //
  2396. // IShellFolder::GetAttributesOf(cidl, apidl, prgfInOut)
  2397. //   This function returns the attributes of specified objects in that
  2398. //  folder. "cidl" and "apidl" specifies objects. "apidl" contains only
  2399. //  simple IDLists. The explorer initializes *prgfInOut with a set of
  2400. //  flags to be evaluated. The shell folder may optimize the operation
  2401. //  by not returning unspecified flags.
  2402. //
  2403. // IShellFolder::GetUIObjectOf(hwndOwner, cidl, apidl, riid, prgfInOut, ppvOut)
  2404. //   This function creates a UI object to be used for specified objects.
  2405. //  The shell explorer passes either IID_IDataObject (for transfer operation)
  2406. //  or IID_IContextMenu (for context menu operation) as riid.
  2407. //
  2408. // IShellFolder::GetDisplayNameOf
  2409. //   This function returns the display name of the specified object.
  2410. //  If the ID contains the display name (in the locale character set),
  2411. //  it returns the offset to the name. Otherwise, it returns a pointer
  2412. //  to the display name string (UNICODE), which is allocated by the
  2413. //  task allocator, or fills in a buffer.
  2414. //
  2415. // IShellFolder::SetNameOf
  2416. //   This function sets the display name of the specified object.
  2417. //  If it changes the ID as well, it returns the new ID which is
  2418. //  alocated by the task allocator.
  2419. //
  2420. //-------------------------------------------------------------------------
  2421.  
  2422. // IShellFolder::GetDisplayNameOf/SetNameOf uFlags
  2423. typedef enum tagSHGDN
  2424. {
  2425.     SHGDN_NORMAL            = 0,        // default (display purpose)
  2426.     SHGDN_INFOLDER          = 1,        // displayed under a folder (relative)
  2427.     SHGDN_INCLUDE_NONFILESYS = 0x2000,   // if not set, display names for shell name space items that are not in the file system will fail.
  2428.     SHGDN_FORADDRESSBAR     = 0x4000,   // for displaying in the address (drives dropdown) bar
  2429.     SHGDN_FORPARSING        = 0x8000,   // for ParseDisplayName or path
  2430. } SHGNO;
  2431.  
  2432. // IShellFolder::EnumObjects
  2433. typedef enum tagSHCONTF
  2434. {
  2435.     SHCONTF_FOLDERS         = 32,       // for shell browser
  2436.     SHCONTF_NONFOLDERS      = 64,       // for default view
  2437.     SHCONTF_INCLUDEHIDDEN   = 128,      // for hidden/system objects
  2438. } SHCONTF;
  2439.  
  2440. // IShellFolder::GetAttributesOf flags
  2441. #define SFGAO_CANCOPY           DROPEFFECT_COPY // Objects can be copied
  2442. #define SFGAO_CANMOVE           DROPEFFECT_MOVE // Objects can be moved
  2443. #define SFGAO_CANLINK           DROPEFFECT_LINK // Objects can be linked
  2444. #define SFGAO_CANRENAME         0x00000010L     // Objects can be renamed
  2445. #define SFGAO_CANDELETE         0x00000020L     // Objects can be deleted
  2446. #define SFGAO_HASPROPSHEET      0x00000040L     // Objects have property sheets
  2447. #define SFGAO_DROPTARGET        0x00000100L     // Objects are drop target
  2448. #define SFGAO_CAPABILITYMASK    0x00000177L
  2449. #define SFGAO_LINK              0x00010000L     // Shortcut (link)
  2450. #define SFGAO_SHARE             0x00020000L     // shared
  2451. #define SFGAO_READONLY          0x00040000L     // read-only
  2452. #define SFGAO_GHOSTED           0x00080000L     // ghosted icon
  2453. #define SFGAO_HIDDEN            0x00080000L     // hidden object
  2454. #define SFGAO_DISPLAYATTRMASK   0x000F0000L
  2455. #define SFGAO_FILESYSANCESTOR   0x10000000L     // It contains file system folder
  2456. #define SFGAO_FOLDER            0x20000000L     // It's a folder.
  2457. #define SFGAO_FILESYSTEM        0x40000000L     // is a file system thing (file/folder/root)
  2458. #define SFGAO_HASSUBFOLDER      0x80000000L     // Expandable in the map pane
  2459. #define SFGAO_CONTENTSMASK      0x80000000L
  2460. #define SFGAO_VALIDATE          0x01000000L     // invalidate cached information
  2461. #define SFGAO_REMOVABLE         0x02000000L     // is this removeable media?
  2462. #define SFGAO_COMPRESSED        0x04000000L     // Object is compressed (use alt color)
  2463. #define SFGAO_BROWSABLE         0x08000000L     // is in-place browsable
  2464. #define SFGAO_NONENUMERATED     0x00100000L     // is a non-enumerated object
  2465. #define SFGAO_NEWCONTENT        0x00200000L     // should show bold in explorer tree
  2466.  
  2467. #undef  INTERFACE
  2468. #define INTERFACE       IShellFolder
  2469.  
  2470. DECLARE_INTERFACE_(IShellFolder, IUnknown)
  2471. {
  2472.     // *** IUnknown methods ***
  2473.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2474.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2475.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2476.  
  2477.     // *** IShellFolder methods ***
  2478.     STDMETHOD(ParseDisplayName) (THIS_ HWND hwndOwner,
  2479.         LPBC pbcReserved, LPOLESTR lpszDisplayName,
  2480.         ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
  2481.  
  2482.     STDMETHOD(EnumObjects) ( THIS_ HWND hwndOwner, DWORD grfFlags, LPENUMIDLIST * ppenumIDList) PURE;
  2483.  
  2484.     STDMETHOD(BindToObject)     (THIS_ LPCITEMIDLIST pidl, LPBC pbcReserved,
  2485.                                  REFIID riid, LPVOID * ppvOut) PURE;
  2486.     STDMETHOD(BindToStorage)    (THIS_ LPCITEMIDLIST pidl, LPBC pbcReserved,
  2487.                                  REFIID riid, LPVOID * ppvObj) PURE;
  2488.     STDMETHOD(CompareIDs)       (THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  2489.     STDMETHOD(CreateViewObject) (THIS_ HWND hwndOwner, REFIID riid, LPVOID * ppvOut) PURE;
  2490.     STDMETHOD(GetAttributesOf)  (THIS_ UINT cidl, LPCITEMIDLIST * apidl,
  2491.                                     ULONG * rgfInOut) PURE;
  2492.     STDMETHOD(GetUIObjectOf)    (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  2493.                                  REFIID riid, UINT * prgfInOut, LPVOID * ppvOut) PURE;
  2494.     STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
  2495.     STDMETHOD(SetNameOf)        (THIS_ HWND hwndOwner, LPCITEMIDLIST pidl,
  2496.                                  LPCOLESTR lpszName, DWORD uFlags,
  2497.                                  LPITEMIDLIST * ppidlOut) PURE;
  2498. };
  2499.  
  2500. typedef IShellFolder * LPSHELLFOLDER;
  2501.  
  2502. //
  2503. //  Helper function which returns a IShellFolder interface to the desktop
  2504. // folder. This is equivalent to call CoCreateInstance with CLSID_ShellDesktop.
  2505. //
  2506. //  CoCreateInstance(CLSID_Desktop, NULL,
  2507. //                   CLSCTX_INPROC, IID_IShellFolder, &pshf);
  2508. //
  2509. WINSHELLAPI HRESULT WINAPI SHGetDesktopFolder(LPSHELLFOLDER *ppshf);
  2510.  
  2511.  
  2512. //==========================================================================
  2513. // IInputObjectSite/IInputObject interfaces
  2514. //
  2515. //  These interfaces allow us (or ISVs) to install/update external Internet
  2516. // Toolbar for IE and the shell. The frame will simply get the CLSID from
  2517. // registry (to be defined) and CoCreateInstance it.
  2518. //
  2519. //==========================================================================
  2520.  
  2521. //-------------------------------------------------------------------------
  2522. //
  2523. // IInputObjectSite interface
  2524. //
  2525. //   A site implements this interface so the object can communicate
  2526. // focus change to it.
  2527. //
  2528. // [Member functions]
  2529. //
  2530. // IInputObjectSite::OnFocusChangeIS(punkObj, fSetFocus)
  2531. //   Object (punkObj) is getting or losing the focus.  
  2532. //
  2533. //-------------------------------------------------------------------------
  2534.  
  2535.  
  2536. #undef  INTERFACE
  2537. #define INTERFACE   IInputObjectSite
  2538.  
  2539. DECLARE_INTERFACE_(IInputObjectSite, IUnknown)
  2540. {
  2541.     // *** IUnknown methods ***
  2542.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2543.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2544.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2545.  
  2546.     // *** IInputObjectSite specific methods ***
  2547.     STDMETHOD(OnFocusChangeIS)(THIS_ IUnknown* punkObj, BOOL fSetFocus) PURE;
  2548. };
  2549.  
  2550.  
  2551. //-------------------------------------------------------------------------
  2552. //
  2553. // IInputObject interface
  2554. //
  2555. //   An object implements this interface so the site can communicate
  2556. // activation and accelerator events to it.
  2557. //
  2558. // [Member functions]
  2559. //
  2560. // IInputObject::UIActivateIO(fActivate, lpMsg)
  2561. //   Activates or deactivates the object.  lpMsg may be NULL.  Returns
  2562. //   S_OK if the activation succeeded.
  2563. //
  2564. // IInputObject::HasFocusIO()
  2565. //   Returns S_OK if the object has the focus, S_FALSE if not.
  2566. //
  2567. // IInputObject::TranslateAcceleratorIO(lpMsg)
  2568. //   Allow the object to process the message.  Returns S_OK if the 
  2569. //   message was processed (eaten).
  2570. //
  2571. //-------------------------------------------------------------------------
  2572.  
  2573.  
  2574. #undef  INTERFACE
  2575. #define INTERFACE   IInputObject
  2576.  
  2577. DECLARE_INTERFACE_(IInputObject, IUnknown)
  2578. {
  2579.     // *** IUnknown methods ***
  2580.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2581.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2582.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2583.  
  2584.     // *** IInputObject specific methods ***
  2585.     STDMETHOD(UIActivateIO)(THIS_ BOOL fActivate, LPMSG lpMsg) PURE;
  2586.     STDMETHOD(HasFocusIO)(THIS) PURE;
  2587.     STDMETHOD(TranslateAcceleratorIO)(THIS_ LPMSG lpMsg) PURE;
  2588. };
  2589.  
  2590.  
  2591. //==========================================================================
  2592. // IDockingWindowSite/IDockingWindow/IDockingWindowFrame interfaces
  2593. // IInputObjectSite/IInputObject interfaces
  2594. //
  2595. //  These interfaces allow us (or ISVs) to install/update external Internet
  2596. // Toolbar for IE and the shell. The frame will simply get the CLSID from
  2597. // registry (to be defined) and CoCreateInstance it.
  2598. //
  2599. //==========================================================================
  2600.  
  2601.  
  2602. //-------------------------------------------------------------------------
  2603. //
  2604. // IDockingWindowSite interface
  2605. //
  2606. //   A site implements this interface so the object can negotiate for
  2607. // and inquire about real estate on the site.
  2608. //
  2609. // [Member functions]
  2610. //
  2611. // IDockingWindowSite::GetBorderDW(punkObj, prcBorder)
  2612. //   Site returns the bounding rectangle of the given source object 
  2613. //   (punkObj).
  2614. //
  2615. // IDockingWindowSite::RequestBorderSpaceDW(punkObj, pbw)
  2616. //   Object requests that the site makes room for it, as specified in
  2617. //   *pbw.
  2618. //
  2619. // IDockingWindowSite::SetBorderSpaceDW(punkObj, pbw)
  2620. //   Object requests that the site set the border spacing to the size 
  2621. //   specified in *pbw.
  2622. //
  2623. //-------------------------------------------------------------------------
  2624.  
  2625.  
  2626. #undef  INTERFACE
  2627. #define INTERFACE   IDockingWindowSite
  2628.  
  2629. DECLARE_INTERFACE_(IDockingWindowSite, IOleWindow)
  2630. {
  2631.     // *** IUnknown methods ***
  2632.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2633.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2634.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2635.  
  2636.     // *** IOleWindow methods ***
  2637.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2638.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2639.  
  2640.     // *** IDockingWindowSite methods ***
  2641.     STDMETHOD(GetBorderDW) (THIS_ IUnknown* punkObj, LPRECT prcBorder) PURE;
  2642.     STDMETHOD(RequestBorderSpaceDW) (THIS_ IUnknown* punkObj, LPCBORDERWIDTHS pbw) PURE;
  2643.     STDMETHOD(SetBorderSpaceDW) (THIS_ IUnknown* punkObj, LPCBORDERWIDTHS pbw) PURE;
  2644. };
  2645.  
  2646.  
  2647.  
  2648. //-------------------------------------------------------------------------
  2649. //
  2650. // IDockingWindowFrame interface
  2651. //
  2652. //
  2653. // [Member functions]
  2654. //
  2655. // IDockingWindowFrame::AddToolbar(punkSrc, pwszItem, dwReserved)
  2656. //
  2657. // IDockingWindowFrame::RemoveToolbar(punkSrc, dwRemoveFlags)
  2658. //
  2659. // IDockingWindowFrame::FindToolbar(pwszItem, riid, ppvObj)
  2660. //
  2661. //-------------------------------------------------------------------------
  2662.  
  2663.  
  2664. // flags for RemoveToolbar
  2665. #define DWFRF_NORMAL            0x0000
  2666. #define DWFRF_DELETECONFIGDATA  0x0001
  2667.  
  2668.  
  2669. // flags for AddToolbar
  2670. #define DWFAF_HIDDEN  0x0001   // add hidden
  2671.  
  2672. #undef  INTERFACE
  2673. #define INTERFACE   IDockingWindowFrame
  2674.  
  2675. DECLARE_INTERFACE_(IDockingWindowFrame, IOleWindow)
  2676. {
  2677.     // *** IUnknown methods ***
  2678.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2679.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2680.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2681.  
  2682.     // *** IOleWindow methods ***
  2683.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2684.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2685.  
  2686.     // *** IDockingWindowFrame methods ***
  2687.     STDMETHOD(AddToolbar) (THIS_ IUnknown* punkSrc, LPCWSTR pwszItem, DWORD dwAddFlags) PURE;
  2688.     STDMETHOD(RemoveToolbar) (THIS_ IUnknown* punkSrc, DWORD dwRemoveFlags) PURE;
  2689.     STDMETHOD(FindToolbar) (THIS_ LPCWSTR pwszItem, REFIID riid, LPVOID* ppvObj) PURE;
  2690. };
  2691.  
  2692.  
  2693.  
  2694. //-------------------------------------------------------------------------
  2695. //
  2696. // IDockingWindow interface
  2697. //
  2698. //   An object (docking window) implements this interface so the site can 
  2699. // communicate with it.  An example of a docking window is a toolbar.
  2700. //
  2701. // [Member functions]
  2702. //
  2703. // IDockingWindow::ShowDW(fShow)
  2704. //   Shows or hides the docking window.
  2705. //
  2706. // IDockingWindow::CloseDW(dwReserved)
  2707. //   Closes the docking window.  dwReserved must be 0.
  2708. //
  2709. // IDockingWindow::ResizeBorderDW(prcBorder, punkToolbarSite, fReserved)
  2710. //   Resizes the docking window's border to *prcBorder.  fReserved must
  2711. //   be 0.
  2712. // IObjectWithSite::SetSite(punkSite)
  2713. //   IDockingWindow usually paired with IObjectWithSite.
  2714. //   Provides the IUnknown pointer of the site to the docking window.
  2715. //
  2716. //
  2717. //-------------------------------------------------------------------------
  2718.  
  2719.  
  2720. #undef  INTERFACE
  2721. #define INTERFACE   IDockingWindow
  2722.  
  2723. DECLARE_INTERFACE_(IDockingWindow, IOleWindow)
  2724. {
  2725.     // *** IUnknown methods ***
  2726.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2727.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2728.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2729.  
  2730.     // *** IOleWindow methods ***
  2731.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2732.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2733.  
  2734.     // *** IDockingWindow methods ***
  2735.     STDMETHOD(ShowDW)         (THIS_ BOOL fShow) PURE;
  2736.     STDMETHOD(CloseDW)        (THIS_ DWORD dwReserved) PURE;
  2737.     STDMETHOD(ResizeBorderDW) (THIS_ LPCRECT   prcBorder,
  2738.                                      IUnknown* punkToolbarSite,
  2739.                                      BOOL      fReserved) PURE;
  2740. };
  2741.  
  2742.  
  2743. //-------------------------------------------------------------------------
  2744. //
  2745. // IDeskBand interface
  2746. //
  2747. //
  2748. // [Member functions]
  2749. //
  2750. // IDeskBand::GetBandInfo(dwBandID, dwViewMode, pdbi)
  2751. //   Returns info on the given band in *pdbi, according to the mask
  2752. //   field in the DESKBANDINFO structure and the given viewmode.
  2753. //
  2754. //-------------------------------------------------------------------------
  2755.  
  2756.  
  2757. // Mask values for DESKBANDINFO
  2758. #define DBIM_MINSIZE    0x0001
  2759. #define DBIM_MAXSIZE    0x0002
  2760. #define DBIM_INTEGRAL   0x0004
  2761. #define DBIM_ACTUAL     0x0008
  2762. #define DBIM_TITLE      0x0010
  2763. #define DBIM_MODEFLAGS  0x0020
  2764. #define DBIM_BKCOLOR    0x0040
  2765.  
  2766. typedef struct {
  2767.     DWORD       dwMask;
  2768.     POINTL      ptMinSize;
  2769.     POINTL      ptMaxSize;
  2770.     POINTL      ptIntegral;
  2771.     POINTL      ptActual;
  2772.     WCHAR       wszTitle[256];
  2773.     DWORD       dwModeFlags;
  2774.     COLORREF    crBkgnd;
  2775. } DESKBANDINFO;
  2776.  
  2777. // DESKBANDINFO dwModeFlags values
  2778. #define DBIMF_NORMAL            0x0000
  2779. #define DBIMF_VARIABLEHEIGHT    0x0008
  2780. #define DBIMF_DEBOSSED          0x0020
  2781. #define DBIMF_BKCOLOR           0x0040
  2782.  
  2783. // GetBandInfo view mode values 
  2784. #define DBIF_VIEWMODE_NORMAL         0x0000
  2785. #define DBIF_VIEWMODE_VERTICAL       0x0001
  2786. #define DBIF_VIEWMODE_FLOATING       0x0002
  2787. #define DBIF_VIEWMODE_TRANSPARENT    0x0004
  2788.  
  2789.  
  2790. #undef  INTERFACE
  2791. #define INTERFACE   IDeskBand
  2792.  
  2793. DECLARE_INTERFACE_(IDeskBand, IDockingWindow)
  2794. {
  2795.     // *** IUnknown methods ***
  2796.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  2797.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  2798.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  2799.  
  2800.     // *** IOleWindow methods ***
  2801.     STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  2802.     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  2803.  
  2804.     // *** IDockingWindow methods ***
  2805.     STDMETHOD(ShowDW)         (THIS_ BOOL fShow) PURE;
  2806.     STDMETHOD(CloseDW)        (THIS_ DWORD dwReserved) PURE;
  2807.     STDMETHOD(ResizeBorderDW) (THIS_ LPCRECT   prcBorder,
  2808.                                      IUnknown* punkToolbarSite,
  2809.                                      BOOL      fReserved) PURE;
  2810.     // *** IDeskBand methods ***
  2811.     STDMETHOD(GetBandInfo)    (THIS_ DWORD dwBandID, DWORD dwViewMode, 
  2812.                                 DESKBANDINFO* pdbi) PURE;
  2813.  
  2814. };
  2815.  
  2816. // Command Target IDs
  2817. enum {
  2818.     DBID_BANDINFOCHANGED = 0,
  2819.     //  tmp! replace w/ cbs::Select
  2820.     DBID_SHOWONLY = 1,         
  2821.     DBID_MAXIMIZEBAND,      // Maximize the specified band (VT_UI4 == dwID)
  2822. };
  2823.  
  2824.  
  2825.  
  2826. #if (_WIN32_IE >= 0x400)
  2827. //
  2828. // We need to make sure that WININET.H is included before this interface is
  2829. // used because the COMPONENT structure uses INTERNET_MAX_URL_LENGTH
  2830. //
  2831. #ifdef _WININET_
  2832. //
  2833. //  Flags and structures used by IActiveDesktop
  2834. //
  2835.  
  2836. typedef struct _tagWALLPAPEROPT
  2837. {
  2838.     DWORD   dwSize;     // size of this Structure.
  2839.     DWORD   dwStyle;    // WPSTYLE_* mentioned above
  2840. }
  2841. WALLPAPEROPT;
  2842.  
  2843. typedef WALLPAPEROPT  *LPWALLPAPEROPT;
  2844. typedef const WALLPAPEROPT *LPCWALLPAPEROPT;
  2845.  
  2846. typedef struct _tagCOMPONENTSOPT
  2847. {
  2848.     DWORD   dwSize;             //Size of this structure
  2849.     BOOL    fEnableComponents;  //Enable components?
  2850.     BOOL    fActiveDesktop;     // Active desktop enabled ?
  2851. }
  2852. COMPONENTSOPT;
  2853.  
  2854. typedef COMPONENTSOPT   *LPCOMPONENTSOPT;
  2855. typedef const COMPONENTSOPT   *LPCCOMPONENTSOPT;
  2856.  
  2857. typedef struct _tagCOMPPOS
  2858. {
  2859.     DWORD   dwSize;             //Size of this structure
  2860.     int     iLeft;              //Left of top-left corner in screen co-ordinates.
  2861.     int     iTop;               //Top of top-left corner in screen co-ordinates.
  2862.     DWORD   dwWidth;            // Width in pixels.
  2863.     DWORD   dwHeight;           // Height in pixels.
  2864.     int     izIndex;            // Indicates the Z-order of the component.
  2865.     BOOL    fCanResize;         // Is the component resizeable?
  2866.     BOOL    fCanResizeX;        // Resizeable in X-direction?
  2867.     BOOL    fCanResizeY;        // Resizeable in Y-direction?
  2868.     int     iPreferredLeftPercent;    //Left of top-left corner as percent of screen width
  2869.     int     iPreferredTopPercent;     //Top of top-left corner as percent of screen height
  2870. }
  2871. COMPPOS;
  2872.  
  2873. typedef COMPPOS *LPCOMPPOS;
  2874. typedef const COMPPOS *LPCCOMPPOS;
  2875.  
  2876.  
  2877.  
  2878.  
  2879. #define COMPONENT_TOP (0x7fffffff)  // izOrder value meaning component is at the top
  2880.  
  2881.  
  2882. // iCompType values
  2883. #define COMP_TYPE_HTMLDOC       0
  2884. #define COMP_TYPE_PICTURE       1
  2885. #define COMP_TYPE_WEBSITE       2
  2886. #define COMP_TYPE_CONTROL       3
  2887. #define COMP_TYPE_CFHTML        4
  2888. #define COMP_TYPE_MAX           4
  2889.  
  2890. typedef struct _tagCOMPONENT
  2891. {
  2892.     DWORD   dwSize;             //Size of this structure
  2893.     DWORD   dwID;               //Reserved: Set it always to zero.
  2894.     int     iComponentType;     //One of COMP_TYPE_*
  2895.     BOOL    fChecked;           // Is this component enabled? 
  2896.     BOOL    fDirty;             // Had the component been modified and not yet saved to disk?
  2897.     BOOL    fNoScroll;          // Is the component scrollable?
  2898.     COMPPOS cpPos;              // Width, height etc.,
  2899.     WCHAR   wszFriendlyName[MAX_PATH];          // Friendly name of component.
  2900.     WCHAR   wszSource[INTERNET_MAX_URL_LENGTH]; //URL of the component.
  2901.     WCHAR   wszSubscribedURL[INTERNET_MAX_URL_LENGTH]; //Subscrined URL
  2902. }
  2903. COMPONENT;
  2904.  
  2905. typedef COMPONENT *LPCOMPONENT;
  2906. typedef const COMPONENT *LPCCOMPONENT;
  2907.  
  2908.  
  2909.  
  2910.  
  2911. ////////////////////////////////////////////
  2912. // Flags for IActiveDesktop::ApplyChanges()
  2913. #define AD_APPLY_SAVE         0x00000001
  2914. #define AD_APPLY_HTMLGEN      0x00000002
  2915. #define AD_APPLY_REFRESH      0x00000004
  2916. #define AD_APPLY_ALL     (AD_APPLY_SAVE | AD_APPLY_HTMLGEN | AD_APPLY_REFRESH)
  2917. #define AD_APPLY_FORCE        0x00000008
  2918. #define AD_APPLY_BUFFERED_REFRESH 0x00000010
  2919.  
  2920. ////////////////////////////////////////////
  2921. // Flags for IActiveDesktop::GetWallpaperOptions()
  2922. //           IActiveDesktop::SetWallpaperOptions()
  2923. #define WPSTYLE_CENTER      0
  2924. #define WPSTYLE_TILE        1
  2925. #define WPSTYLE_STRETCH     2
  2926. #define WPSTYLE_MAX         3
  2927.  
  2928.  
  2929. ////////////////////////////////////////////
  2930. // Flags for IActiveDesktop::ModifyComponent()
  2931.  
  2932. #define COMP_ELEM_TYPE          0x00000001
  2933. #define COMP_ELEM_CHECKED       0x00000002
  2934. #define COMP_ELEM_DIRTY         0x00000004
  2935. #define COMP_ELEM_NOSCROLL      0x00000008
  2936. #define COMP_ELEM_POS_LEFT      0x00000010
  2937. #define COMP_ELEM_POS_TOP       0x00000020
  2938. #define COMP_ELEM_SIZE_WIDTH    0x00000040
  2939. #define COMP_ELEM_SIZE_HEIGHT   0x00000080
  2940. #define COMP_ELEM_POS_ZINDEX    0x00000100
  2941. #define COMP_ELEM_SOURCE        0x00000200
  2942. #define COMP_ELEM_FRIENDLYNAME  0x00000400
  2943. #define COMP_ELEM_SUBSCRIBEDURL 0x00000800
  2944.  
  2945. #define COMP_ELEM_ALL   (COMP_ELEM_TYPE | COMP_ELEM_CHECKED | COMP_ELEM_DIRTY |          \
  2946.                          COMP_ELEM_NOSCROLL | COMP_ELEM_POS_LEFT | COMP_ELEM_SIZE_WIDTH  \
  2947.                          COMP_ELEM_SIZE_HEIGHT | COMP_ELEM_POS_ZINDEX | COMP_ELEM_SOURCE \
  2948.                          COMP_ELEM_FRIENDLYNAME )
  2949.  
  2950.  
  2951. ////////////////////////////////////////////
  2952. // Flags for IActiveDesktop::AddDesktopItemWithUI()
  2953. typedef enum tagDTI_ADTIWUI
  2954. {
  2955.     DTI_ADDUI_DEFAULT               = 0x00000000,
  2956.     DTI_ADDUI_DISPSUBWIZARD         = 0x00000001,
  2957. };
  2958.  
  2959.  
  2960. ////////////////////////////////////////////
  2961. // Flags for IActiveDesktop::AddUrl()
  2962. #define ADDURL_SILENT           0X0001
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968. //
  2969. //  Interface for manipulating the Active Desktop.
  2970. //
  2971.  
  2972. #undef INTERFACE
  2973. #define INTERFACE IActiveDesktop
  2974.  
  2975. DECLARE_INTERFACE_( IActiveDesktop, IUnknown )
  2976. {
  2977.     // IUnknown methods
  2978.     STDMETHOD (QueryInterface)(THIS_ REFIID riid, void ** ppv) PURE;
  2979.     STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  2980.     STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  2981.  
  2982.     // IActiveDesktop methods
  2983.     STDMETHOD (ApplyChanges)(THIS_ DWORD dwFlags) PURE;
  2984.     STDMETHOD (GetWallpaper)(THIS_ LPWSTR pwszWallpaper, UINT cchWallpaper, DWORD dwReserved) PURE;
  2985.     STDMETHOD (SetWallpaper)(THIS_ LPCWSTR pwszWallpaper, DWORD dwReserved) PURE;
  2986.     STDMETHOD (GetWallpaperOptions)(THIS_ LPWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
  2987.     STDMETHOD (SetWallpaperOptions)(THIS_ LPCWALLPAPEROPT pwpo, DWORD dwReserved) PURE;
  2988.     STDMETHOD (GetPattern)(THIS_ LPWSTR pwszPattern, UINT cchPattern, DWORD dwReserved) PURE;
  2989.     STDMETHOD (SetPattern)(THIS_ LPCWSTR pwszPattern, DWORD dwReserved) PURE;
  2990.     STDMETHOD (GetDesktopItemOptions)(THIS_ LPCOMPONENTSOPT pco, DWORD dwReserved) PURE;
  2991.     STDMETHOD (SetDesktopItemOptions)(THIS_ LPCCOMPONENTSOPT pco, DWORD dwReserved) PURE;
  2992.     STDMETHOD (AddDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
  2993.     STDMETHOD (AddDesktopItemWithUI)(THIS_ HWND hwnd, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2994.     STDMETHOD (ModifyDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwFlags) PURE;
  2995.     STDMETHOD (RemoveDesktopItem)(THIS_ LPCCOMPONENT pcomp, DWORD dwReserved) PURE;
  2996.     STDMETHOD (GetDesktopItemCount)(THIS_ LPINT lpiCount, DWORD dwReserved) PURE;
  2997.     STDMETHOD (GetDesktopItem)(THIS_ int nComponent, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2998.     STDMETHOD (GetDesktopItemByID)(THIS_ DWORD dwID, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  2999.     STDMETHOD (GenerateDesktopItemHtml)(THIS_ LPCWSTR pwszFileName, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  3000.     STDMETHOD (AddUrl)(THIS_ HWND hwnd, LPCWSTR pszSource, LPCOMPONENT pcomp, DWORD dwFlags) PURE;
  3001.     STDMETHOD (GetDesktopItemBySource)(THIS_ LPCWSTR pwszSource, LPCOMPONENT pcomp, DWORD dwReserved) PURE;
  3002. };
  3003.  
  3004. typedef IActiveDesktop * LPACTIVEDESKTOP;
  3005.  
  3006.  
  3007. #endif // _WININET_
  3008.  
  3009. #endif // _WIN32_IE
  3010.  
  3011. //==========================================================================
  3012. // Clipboard format which may be supported by IDataObject from system
  3013. // defined shell folders (such as directories, network, ...).
  3014. //==========================================================================
  3015.  
  3016. #define CFSTR_SHELLIDLIST       TEXT("Shell IDList Array")      // CF_IDLIST
  3017. #define CFSTR_SHELLIDLISTOFFSET TEXT("Shell Object Offsets")    // CF_OBJECTPOSITIONS
  3018. #define CFSTR_NETRESOURCES      TEXT("Net Resource")            // CF_NETRESOURCE
  3019. #define CFSTR_FILEDESCRIPTORA   TEXT("FileGroupDescriptor")     // CF_FILEGROUPDESCRIPTORA
  3020. #define CFSTR_FILEDESCRIPTORW   TEXT("FileGroupDescriptorW")    // CF_FILEGROUPDESCRIPTORW
  3021. #define CFSTR_FILECONTENTS      TEXT("FileContents")            // CF_FILECONTENTS
  3022. #define CFSTR_FILENAMEA         TEXT("FileName")                // CF_FILENAMEA
  3023. #define CFSTR_FILENAMEW         TEXT("FileNameW")               // CF_FILENAMEW
  3024. #define CFSTR_PRINTERGROUP      TEXT("PrinterFriendlyName")     // CF_PRINTERS
  3025. #define CFSTR_FILENAMEMAPA      TEXT("FileNameMap")             // CF_FILENAMEMAPA
  3026. #define CFSTR_FILENAMEMAPW      TEXT("FileNameMapW")            // CF_FILENAMEMAPW
  3027. #define CFSTR_SHELLURL          TEXT("UniformResourceLocator")
  3028. #define CFSTR_PREFERREDDROPEFFECT TEXT("Preferred DropEffect")
  3029. #define CFSTR_PERFORMEDDROPEFFECT TEXT("Performed DropEffect") 
  3030. #define CFSTR_PASTESUCCEEDED    TEXT("Paste Succeeded")
  3031. #define CFSTR_INDRAGLOOP        TEXT("InShellDragLoop")
  3032.  
  3033. #ifdef UNICODE
  3034. #define CFSTR_FILEDESCRIPTOR    CFSTR_FILEDESCRIPTORW
  3035. #define CFSTR_FILENAME          CFSTR_FILENAMEW
  3036. #define CFSTR_FILENAMEMAP       CFSTR_FILENAMEMAPW
  3037. #else
  3038. #define CFSTR_FILEDESCRIPTOR    CFSTR_FILEDESCRIPTORA
  3039. #define CFSTR_FILENAME          CFSTR_FILENAMEA
  3040. #define CFSTR_FILENAMEMAP       CFSTR_FILENAMEMAPA
  3041. #endif
  3042.  
  3043. //
  3044. // CF_OBJECTPOSITIONS
  3045. //
  3046. //
  3047.  
  3048.  
  3049.  
  3050. #define DVASPECT_SHORTNAME      2 // use for CF_HDROP to get short name version
  3051. //
  3052. // format of CF_NETRESOURCE
  3053. //
  3054. typedef struct _NRESARRAY {     // anr
  3055.     UINT cItems;
  3056.     NETRESOURCE nr[1];
  3057. } NRESARRAY, * LPNRESARRAY;
  3058.  
  3059. //
  3060. // format of CF_IDLIST
  3061. //
  3062. typedef struct _IDA {
  3063.     UINT cidl;          // number of relative IDList
  3064.     UINT aoffset[1];    // [0]: folder IDList, [1]-[cidl]: item IDList
  3065. } CIDA, * LPIDA;
  3066.  
  3067. //
  3068. // FILEDESCRIPTOR.dwFlags field indicate which fields are to be used
  3069. //
  3070. typedef enum {
  3071.     FD_CLSID            = 0x0001,
  3072.     FD_SIZEPOINT        = 0x0002,
  3073.     FD_ATTRIBUTES       = 0x0004,
  3074.     FD_CREATETIME       = 0x0008,
  3075.     FD_ACCESSTIME       = 0x0010,
  3076.     FD_WRITESTIME       = 0x0020,
  3077.     FD_FILESIZE         = 0x0040,
  3078.     FD_LINKUI           = 0x8000,       // 'link' UI is prefered
  3079. } FD_FLAGS;
  3080.  
  3081. typedef struct _FILEDESCRIPTORA { // fod
  3082.     DWORD dwFlags;
  3083.  
  3084.     CLSID clsid;
  3085.     SIZEL sizel;
  3086.     POINTL pointl;
  3087.  
  3088.     DWORD dwFileAttributes;
  3089.     FILETIME ftCreationTime;
  3090.     FILETIME ftLastAccessTime;
  3091.     FILETIME ftLastWriteTime;
  3092.     DWORD nFileSizeHigh;
  3093.     DWORD nFileSizeLow;
  3094.     CHAR   cFileName[ MAX_PATH ];
  3095. } FILEDESCRIPTORA, *LPFILEDESCRIPTORA;
  3096.  
  3097. typedef struct _FILEDESCRIPTORW { // fod
  3098.     DWORD dwFlags;
  3099.  
  3100.     CLSID clsid;
  3101.     SIZEL sizel;
  3102.     POINTL pointl;
  3103.  
  3104.     DWORD dwFileAttributes;
  3105.     FILETIME ftCreationTime;
  3106.     FILETIME ftLastAccessTime;
  3107.     FILETIME ftLastWriteTime;
  3108.     DWORD nFileSizeHigh;
  3109.     DWORD nFileSizeLow;
  3110.     WCHAR  cFileName[ MAX_PATH ];
  3111. } FILEDESCRIPTORW, *LPFILEDESCRIPTORW;
  3112.  
  3113. #ifdef UNICODE
  3114. #define FILEDESCRIPTOR      FILEDESCRIPTORW
  3115. #define LPFILEDESCRIPTOR    LPFILEDESCRIPTORW
  3116. #else
  3117. #define FILEDESCRIPTOR      FILEDESCRIPTORA
  3118. #define LPFILEDESCRIPTOR    LPFILEDESCRIPTORA
  3119. #endif
  3120.  
  3121. //
  3122. // format of CF_FILEGROUPDESCRIPTOR
  3123. //
  3124. typedef struct _FILEGROUPDESCRIPTORA { // fgd
  3125.      UINT cItems;
  3126.      FILEDESCRIPTORA fgd[1];
  3127. } FILEGROUPDESCRIPTORA, * LPFILEGROUPDESCRIPTORA;
  3128.  
  3129. typedef struct _FILEGROUPDESCRIPTORW { // fgd
  3130.      UINT cItems;
  3131.      FILEDESCRIPTORW fgd[1];
  3132. } FILEGROUPDESCRIPTORW, * LPFILEGROUPDESCRIPTORW;
  3133.  
  3134. #ifdef UNICODE
  3135. #define FILEGROUPDESCRIPTOR     FILEGROUPDESCRIPTORW
  3136. #define LPFILEGROUPDESCRIPTOR   LPFILEGROUPDESCRIPTORW
  3137. #else
  3138. #define FILEGROUPDESCRIPTOR     FILEGROUPDESCRIPTORA
  3139. #define LPFILEGROUPDESCRIPTOR   LPFILEGROUPDESCRIPTORA
  3140. #endif
  3141.  
  3142. //
  3143. // format of CF_HDROP and CF_PRINTERS, in the HDROP case the data that follows
  3144. // is a double null terinated list of file names, for printers they are printer
  3145. // friendly names
  3146. //
  3147. typedef struct _DROPFILES {
  3148.    DWORD pFiles;                       // offset of file list
  3149.    POINT pt;                           // drop point (client coords)
  3150.    BOOL fNC;                           // is it on NonClient area
  3151.                                        // and pt is in screen coords
  3152.    BOOL fWide;                         // WIDE character switch
  3153. } DROPFILES, FAR * LPDROPFILES;
  3154.  
  3155.  
  3156. //====== File System Notification APIs ===============================
  3157. //
  3158.  
  3159. //
  3160. //  File System Notification flags
  3161. //
  3162.  
  3163. #define SHCNE_RENAMEITEM          0x00000001L
  3164. #define SHCNE_CREATE              0x00000002L
  3165. #define SHCNE_DELETE              0x00000004L
  3166. #define SHCNE_MKDIR               0x00000008L
  3167. #define SHCNE_RMDIR               0x00000010L
  3168. #define SHCNE_MEDIAINSERTED       0x00000020L
  3169. #define SHCNE_MEDIAREMOVED        0x00000040L
  3170. #define SHCNE_DRIVEREMOVED        0x00000080L
  3171. #define SHCNE_DRIVEADD            0x00000100L
  3172. #define SHCNE_NETSHARE            0x00000200L
  3173. #define SHCNE_NETUNSHARE          0x00000400L
  3174. #define SHCNE_ATTRIBUTES          0x00000800L
  3175. #define SHCNE_UPDATEDIR           0x00001000L
  3176. #define SHCNE_UPDATEITEM          0x00002000L
  3177. #define SHCNE_SERVERDISCONNECT    0x00004000L
  3178. #define SHCNE_UPDATEIMAGE         0x00008000L
  3179. #define SHCNE_DRIVEADDGUI         0x00010000L
  3180. #define SHCNE_RENAMEFOLDER        0x00020000L
  3181. #define SHCNE_FREESPACE           0x00040000L
  3182.  
  3183. #if (_WIN32_IE >= 0x0400)
  3184. #define SHCNE_EXTENDED_EVENT      0x04000000L
  3185. #endif      // _WIN32_IE >= 0x0400
  3186.  
  3187. #define SHCNE_ASSOCCHANGED        0x08000000L
  3188.  
  3189. #define SHCNE_DISKEVENTS          0x0002381FL
  3190. #define SHCNE_GLOBALEVENTS        0x0C0581E0L // Events that dont match pidls first
  3191. #define SHCNE_ALLEVENTS           0x7FFFFFFFL
  3192. #define SHCNE_INTERRUPT           0x80000000L // The presence of this flag indicates
  3193.                                             // that the event was generated by an
  3194.                                             // interrupt.  It is stripped out before
  3195.                                             // the clients of SHCNNotify_ see it.
  3196.  
  3197. #if (_WIN32_IE >= 0x0400)
  3198. #define SHCNEE_ORDERCHANGED       0x00000002L  // dwItem2 is the pidl of the changed folder
  3199. #endif
  3200.  
  3201.  
  3202. // Flags
  3203. // uFlags & SHCNF_TYPE is an ID which indicates what dwItem1 and dwItem2 mean
  3204. #define SHCNF_IDLIST      0x0000        // LPITEMIDLIST
  3205. #define SHCNF_PATHA       0x0001        // path name
  3206. #define SHCNF_PRINTERA    0x0002        // printer friendly name
  3207. #define SHCNF_DWORD       0x0003        // DWORD
  3208. #define SHCNF_PATHW       0x0005        // path name
  3209. #define SHCNF_PRINTERW    0x0006        // printer friendly name
  3210. #define SHCNF_TYPE        0x00FF
  3211. #define SHCNF_FLUSH       0x1000
  3212. #define SHCNF_FLUSHNOWAIT 0x2000
  3213.  
  3214. #ifdef UNICODE
  3215. #define SHCNF_PATH      SHCNF_PATHW
  3216. #define SHCNF_PRINTER   SHCNF_PRINTERW
  3217. #else
  3218. #define SHCNF_PATH      SHCNF_PATHA
  3219. #define SHCNF_PRINTER   SHCNF_PRINTERA
  3220. #endif
  3221.  
  3222.  
  3223. //
  3224. //  APIs
  3225. //
  3226. WINSHELLAPI void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags,
  3227.                                 LPCVOID dwItem1, LPCVOID dwItem2);
  3228.  
  3229. //
  3230. // IShellChangeNotify
  3231. //
  3232. #undef  INTERFACE
  3233. #define INTERFACE  IShellChangeNotify
  3234.  
  3235. DECLARE_INTERFACE_(IShellChangeNotify, IUnknown)
  3236. {
  3237.     // *** IUnknown methods ***
  3238.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  3239.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  3240.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  3241.  
  3242.     // *** IShellChangeNotify methods ***
  3243.     STDMETHOD(OnChange) (THIS_ LONG lEvent, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  3244. } ;
  3245.  
  3246. //
  3247. // IQueryInfo
  3248. //
  3249. #undef  INTERFACE
  3250. #define INTERFACE  IQueryInfo
  3251.  
  3252. DECLARE_INTERFACE_(IQueryInfo, IUnknown)
  3253. {
  3254.     // *** IUnknown methods ***
  3255.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  3256.     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
  3257.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  3258.  
  3259.     // *** IQueryInfo methods ***
  3260.     STDMETHOD(GetInfoTip)(THIS_ DWORD dwFlags, WCHAR **ppwszTip) PURE;
  3261.     STDMETHOD(GetInfoFlags)(THIS_ DWORD *pdwFlags) PURE;
  3262. } ;
  3263.  
  3264.  
  3265. #define QIF_CACHED           0x00000001
  3266. #define QIF_DONTEXPANDFOLDER 0x00000002
  3267.  
  3268.  
  3269. //
  3270. // SHAddToRecentDocs
  3271. //
  3272. #define SHARD_PIDL      0x00000001L
  3273. #define SHARD_PATHA     0x00000002L
  3274. #define SHARD_PATHW     0x00000003L
  3275.  
  3276. #ifdef UNICODE
  3277. #define SHARD_PATH  SHARD_PATHW
  3278. #else
  3279. #define SHARD_PATH  SHARD_PATHA
  3280. #endif
  3281.  
  3282. WINSHELLAPI void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv);
  3283.  
  3284. WINSHELLAPI HRESULT WINAPI SHGetInstanceExplorer(IUnknown **ppunk);
  3285.  
  3286. //
  3287. // SHGetDataFromIDListA/W
  3288. //
  3289. #define SHGDFIL_FINDDATA        1
  3290. #define SHGDFIL_NETRESOURCE     2
  3291. #define SHGDFIL_DESCRIPTIONID   3
  3292.  
  3293. #define SHDID_ROOT_REGITEM          1
  3294. #define SHDID_FS_FILE               2
  3295. #define SHDID_FS_DIRECTORY          3
  3296. #define SHDID_FS_OTHER              4
  3297. #define SHDID_COMPUTER_DRIVE35      5
  3298. #define SHDID_COMPUTER_DRIVE525     6
  3299. #define SHDID_COMPUTER_REMOVABLE    7
  3300. #define SHDID_COMPUTER_FIXED        8
  3301. #define SHDID_COMPUTER_NETDRIVE     9
  3302. #define SHDID_COMPUTER_CDROM        10
  3303. #define SHDID_COMPUTER_RAMDISK      11
  3304. #define SHDID_COMPUTER_OTHER        12
  3305. #define SHDID_NET_DOMAIN            13
  3306. #define SHDID_NET_SERVER            14
  3307. #define SHDID_NET_SHARE             15
  3308. #define SHDID_NET_RESTOFNET         16
  3309. #define SHDID_NET_OTHER             17
  3310.  
  3311. typedef struct _SHDESCRIPTIONID {
  3312.     DWORD   dwDescriptionId;
  3313.     CLSID   clsid;
  3314. } SHDESCRIPTIONID, *LPSHDESCRIPTIONID;
  3315.  
  3316. WINSHELLAPI HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl,
  3317.         int nFormat, PVOID pv, int cb);
  3318. WINSHELLAPI HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl,
  3319.         int nFormat, PVOID pv, int cb);
  3320.  
  3321. #ifdef UNICODE
  3322. #define SHGetDataFromIDList SHGetDataFromIDListW
  3323. #else
  3324. #define SHGetDataFromIDList SHGetDataFromIDListA
  3325. #endif
  3326.  
  3327.  
  3328. //===========================================================================
  3329.  
  3330.  
  3331. //
  3332. // PROPIDs for Internet Shortcuts (FMTID_Intshcut) to be used with 
  3333. // IPropertySetStorage/IPropertyStorage
  3334. //
  3335. // The known property ids and their variant types are:
  3336. //      PID_IS_URL          [VT_LPWSTR]   URL
  3337. //      PID_IS_NAME         [VT_LPWSTR]   Name of the internet shortcut
  3338. //      PID_IS_WORKINGDIR   [VT_LPWSTR]   Working directory for the shortcut
  3339. //      PID_IS_HOTKEY       [VT_UI2]      Hotkey for the shortcut
  3340. //      PID_IS_SHOWCMD      [VT_I4]       Show command for shortcut
  3341. //      PID_IS_ICONINDEX    [VT_I4]       Index into file that has icon
  3342. //      PID_IS_ICONFILE     [VT_LPWSTR]   File that has the icon
  3343. //      PID_IS_WHATSNEW     [VT_LPWSTR]   What's New text
  3344. //      PID_IS_AUTHOR       [VT_LPWSTR]   Author
  3345. //      PID_IS_DESCRIPTION  [VT_LPWSTR]   Description text of site
  3346. //      PID_IS_COMMENT      [VT_LPWSTR]   User annotated comment
  3347. //
  3348.  
  3349. #define PID_IS_URL           2
  3350. #define PID_IS_NAME          4
  3351. #define PID_IS_WORKINGDIR    5
  3352. #define PID_IS_HOTKEY        6
  3353. #define PID_IS_SHOWCMD       7
  3354. #define PID_IS_ICONINDEX     8
  3355. #define PID_IS_ICONFILE      9
  3356. #define PID_IS_WHATSNEW      10
  3357. #define PID_IS_AUTHOR        11
  3358. #define PID_IS_DESCRIPTION   12
  3359. #define PID_IS_COMMENT       13
  3360.  
  3361. //
  3362. // PROPIDs for Internet Sites (FMTID_InternetSite) to be used with 
  3363. // IPropertySetStorage/IPropertyStorage
  3364. //
  3365. // The known property ids and their variant types are:
  3366. //      PID_INTSITE_WHATSNEW     [VT_LPWSTR]   What's New text
  3367. //      PID_INTSITE_AUTHOR       [VT_LPWSTR]   Author
  3368. //      PID_INTSITE_LASTVISIT    [VT_FILETIME] Time site was last visited
  3369. //      PID_INTSITE_LASTMOD      [VT_FILETIME] Time site was last modified
  3370. //      PID_INTSITE_VISITCOUNT   [VT_UI4]      Number of times user has visited
  3371. //      PID_INTSITE_DESCRIPTION  [VT_LPWSTR]   Description text of site
  3372. //      PID_INTSITE_COMMENT      [VT_LPWSTR]   User annotated comment
  3373. //      PID_INTSITE_RECURSE      [VT_UI4]      Levels to recurse (0-3)
  3374. //      PID_INTSITE_WATCH        [VT_UI4]      PIDISM_ flags
  3375. //      PID_INTSITE_SUBSCRIPTION [VT_UI8]      Subscription cookie
  3376. //      PID_INTSITE_URL          [VT_LPWSTR]   URL
  3377. //      PID_INTSITE_TITLE        [VT_LPWSTR]   Title
  3378. //      PID_INTSITE_CODEPAGE     [VT_UI4]      Codepage of the document
  3379. //      PID_INTSITE_TRACKING     [VT_UI4]      Tracking
  3380. //
  3381.  
  3382.  
  3383. #define PID_INTSITE_WHATSNEW      2
  3384. #define PID_INTSITE_AUTHOR        3
  3385. #define PID_INTSITE_LASTVISIT     4
  3386. #define PID_INTSITE_LASTMOD       5
  3387. #define PID_INTSITE_VISITCOUNT    6
  3388. #define PID_INTSITE_DESCRIPTION   7
  3389. #define PID_INTSITE_COMMENT       8
  3390. #define PID_INTSITE_FLAGS         9                         
  3391. #define PID_INTSITE_CONTENTLEN    10                        
  3392. #define PID_INTSITE_CONTENTCODE   11                        
  3393. #define PID_INTSITE_RECURSE       12
  3394. #define PID_INTSITE_WATCH         13
  3395. #define PID_INTSITE_SUBSCRIPTION  14
  3396. #define PID_INTSITE_URL           15
  3397. #define PID_INTSITE_TITLE         16
  3398. #define PID_INTSITE_CODEPAGE      18
  3399. #define PID_INTSITE_TRACKING      19
  3400.  
  3401. // Flags for PID_IS_FLAGS                               
  3402. #define PIDISF_RECENTLYCHANGED  0x00000001              
  3403. #define PIDISF_CACHEDSTICKY     0x00000002              
  3404. #define PIDISF_CACHEIMAGES      0x00000010              
  3405. #define PIDISF_FOLLOWALLLINKS   0x00000020              
  3406.  
  3407. // Values for PID_INTSITE_WATCH
  3408. #define PIDISM_GLOBAL           0       // Monitor based on global setting
  3409. #define PIDISM_WATCH            1       // User says watch
  3410. #define PIDISM_DONTWATCH        2       // User says don't watch
  3411.  
  3412.  
  3413. ////////////////////////////////////////////////////////////////////
  3414. //
  3415. // The shell keeps track of some per-user state to handle display
  3416. // options that is of major interest to ISVs.
  3417. // The key one requested right now is "DoubleClickInWebView".
  3418. typedef struct {
  3419.     BOOL fShowAllObjects : 1;
  3420.     BOOL fShowExtensions : 1;
  3421.     BOOL fNoConfirmRecycle : 1;
  3422.     BOOL fShowSysFiles : 1;
  3423.     BOOL fShowCompColor : 1;
  3424.     BOOL fDoubleClickInWebView : 1;
  3425.     BOOL fDesktopHTML : 1;
  3426.     BOOL fWin95Classic : 1;
  3427.     BOOL fDontPrettyPath : 1;
  3428.     BOOL fShowAttribCol : 1;
  3429.     BOOL fMapNetDrvBtn : 1;
  3430.     BOOL fShowInfoTip : 1;
  3431.     BOOL fHideIcons : 1;
  3432.     UINT fRestFlags : 3;
  3433. } SHELLFLAGSTATE, * LPSHELLFLAGSTATE;
  3434.  
  3435. #define SSF_SHOWALLOBJECTS          0x0001
  3436. #define SSF_SHOWEXTENSIONS          0x0002
  3437. #define SSF_SHOWCOMPCOLOR           0x0008
  3438. #define SSF_SHOWSYSFILES            0x0020
  3439. #define SSF_DOUBLECLICKINWEBVIEW    0x0080
  3440. #define SSF_SHOWATTRIBCOL           0x0100
  3441. #define SSF_DESKTOPHTML             0x0200
  3442. #define SSF_WIN95CLASSIC            0x0400
  3443. #define SSF_DONTPRETTYPATH          0x0800
  3444. #define SSF_SHOWINFOTIP             0x2000
  3445. #define SSF_MAPNETDRVBUTTON         0x1000
  3446. #define SSF_NOCONFIRMRECYCLE        0x8000
  3447. #define SSF_HIDEICONS               0x4000
  3448.  
  3449.  
  3450. // SHGetSettings(LPSHELLFLAGSTATE lpss, DWORD dwMask)
  3451. //
  3452. // Specify the bits you are interested in in dwMask and they will be
  3453. // filled out in the lpss structure.
  3454. //
  3455. // When these settings change, a WM_SETTINGCHANGE message is sent
  3456. // with the string lParam value of "ShellState".
  3457. //
  3458. void WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask);
  3459.  
  3460. #ifdef __urlmon_h__
  3461. //    NOTE: urlmon.h must be included before shlobj.h to access this function.
  3462. //
  3463. //    SoftwareUpdateMessageBox
  3464. //
  3465. //    Provides a standard message box for the alerting the user that a software
  3466. //    update is available or installed. No UI will be displayed if there is no
  3467. //    update available or if the available update version is less than or equal
  3468. //    to the Advertised update version.
  3469. //
  3470. //    hWnd                - [in] Handle of owner window
  3471. //    szDistUnit          - [in] Unique identifier string for a code distribution unit. For
  3472. //                               ActiveX controls and Active Setup installed components, this
  3473. //                               is typically a GUID string.
  3474. //    dwFlags             - [in] Must be 0.
  3475. //    psdi                - [in,out] Pointer to SOFTDISTINFO ( see URLMon.h ). May be NULL.
  3476. //                                cbSize should be initialized
  3477. //                                by the caller to sizeof(SOFTDISTINFO), dwReserved should be set to 0.
  3478. //
  3479. //    RETURNS:
  3480. //
  3481. //    IDNO     - The user chose cancel. If *pbRemind is FALSE, the caller should save the 
  3482. //               update version from the SOFTDISTINFO and pass it in as the Advertised
  3483. //               version in future calls.
  3484. //
  3485. //    IDYES    - The user has selected Update Now/About Update. The caller should navigate to
  3486. //               the SOFTDISTINFO's pszHREF to initiate the install or learn about it.
  3487. //               The caller should save the update version from the SOFTDISTINFO and pass
  3488. //               it in as the Advertised version in future calls.
  3489. //
  3490. //    IDIGNORE - There is no pending software update. Note: There is
  3491. //               no Ignore button in the standard UI. This occurs if the available
  3492. //               version is less than the installed version or is not present or if the
  3493. //               Advertised version is greater than or equal to the update version.
  3494. //
  3495. //    IDABORT  - An error occured. Call GetSoftwareUpdateInfo() for a more specific HRESULT.
  3496. //               Note: There is no Abort button in the standard UI.
  3497.  
  3498.  
  3499. SHDOCAPI_(DWORD) SoftwareUpdateMessageBox( HWND hWnd,
  3500.                                            LPCWSTR szDistUnit,
  3501.                                            DWORD dwFlags,
  3502.                                            LPSOFTDISTINFO psdi );
  3503. #endif // if __urlmon_h__
  3504.  
  3505. #ifdef __cplusplus
  3506. }
  3507.  
  3508. #endif  /* __cplusplus */
  3509.  
  3510. #ifndef RC_INVOKED
  3511. #pragma pack()
  3512. #endif  /* !RC_INVOKED */
  3513.  
  3514. #endif // _SHLOBJ_H_
  3515.