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

6459 lines
268 KiB

  1. //***************************************************************************
  2. // --- SHELLAPI.W SHSEMIP.H SHLOBJ.W SHOBJIDL.IDL SHLDISP.IDL SHPRIV.IDL ---
  3. // Which header is best for my new API?
  4. //
  5. // SHLOBJ - *AVOID NEW USAGE*, PREFER OTHER HEADERS
  6. // used primarily for legacy compatibility
  7. //
  8. // SHELLAPI - ALL NEW SHELL32 EXPORTS public and private
  9. // used for both public and private exports from shell32
  10. //
  11. // SHSEMIP - *AVOID _ALL_ USAGE*, NO EXPORTS, SUPER PRIVATE
  12. // used for very private shell defines.
  13. //
  14. // SHOBJIDL - ALL NEW SHELL PUBLIC INTERFACES
  15. // primary file for public shell (shell32+) interfaces
  16. //
  17. // SHLDISP - ALL NEW SHELL AUTOMATION INTERFACES
  18. // automation interfaces are always public
  19. //
  20. // SHPRIV - ALL NEW SHELL PRIVATE INTERFACES
  21. // private interfaces used anywhere in the shell
  22. //
  23. //
  24. // SHLOBJ was originally the file that defined all of shell32's interfaces.
  25. // it devolved into a dumping ground of public and private APIs and
  26. // interfaces. in the effort to better support COM and better API management
  27. // we are attempting to avoid using shlobj
  28. //***************************************************************************
  29. #ifndef _SHLOBJP_H_
  30. #define _SHLOBJP_H_
  31. #define NO_MONIKER
  32. #include <docobj.h>
  33. #include <shldisp.h>
  34. #include <pshpack1.h> /* Assume byte packing throughout */
  35. #ifdef __cplusplus
  36. extern "C" { /* Assume C declarations for C++ */
  37. #endif /* __cplusplus */
  38. #include <shtypes.h>
  39. #include <shpriv.h>
  40. #include <iepriv.h>
  41. // HMONITOR is already declared in NT 5's windef.h.
  42. #if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500)
  43. DECLARE_HANDLE(HMONITOR);
  44. #define HMONITOR_DECLARED
  45. #endif
  46. #include <tlog.h>
  47. // DOC'ed for DOJ compliance
  48. SHSTDAPI_(void *) SHRealloc(void * pv, SIZE_T cbNew);
  49. SHSTDAPI_(SIZE_T) SHGetSize(void * pv);
  50. // DOC'ed for DOJ compliance
  51. #define CMF_FINDHACK 0x00000080 // This is a hack - we should remove this bit
  52. //
  53. // Private QueryContextMenuFlag passed from DefView
  54. //
  55. #define CMF_DVFILE 0x00010000 // "File" pulldown
  56. #define CMF_ICM3 0x00020000 // QueryContextMenu can assume IContextMenu3 semantics (i.e.,
  57. // will receive WM_INITMENUPOPUP, WM_MEASUREITEM, WM_DRAWITEM,
  58. // and WM_MENUCHAR, via HandleMenuMsg2)
  59. #define CMICEXSIZE_NT4 (SIZEOF(CMINVOKECOMMANDINFOEX) - SIZEOF(POINT))
  60. #define CMIC_MASK_NO_HOOKS SEE_MASK_NO_HOOKS
  61. #define CMIC_MASK_DATAOBJECT 0x40000000 // lpPara is IDataObject*
  62. #define CMIC_MASK_MODAL 0x80000000
  63. #define CMIC_VALID_SEE_FLAGS SEE_VALID_CMIC_FLAGS
  64. #include <pshpack8.h>
  65. // the struct below is used for cross-process passing of CMINVOKECOMMANDINFOEX structs
  66. // we store offsets for the strings into ourself and we are win64 safe
  67. typedef struct {
  68. DWORD cbSize; // size of the struct
  69. DWORD fMask; // any combination of CMIC_MASK_*
  70. DWORD dwHwnd; // might be NULL (indicating no owner window)
  71. int nShow; // one of SW_ values for ShowWindow() API
  72. DWORD dwHotKey;
  73. POINT ptInvoke; // Point where it's invoked
  74. DWORD dwVerbW; // offset from struct to lpVerbW
  75. DWORD dwParametersW; // offset from struct to lpParametersW - might be NULL (indicating no parameter)
  76. DWORD dwDirectoryW; // offset from struct to lpDirectoryW - might be NULL (indicating no specific directory)
  77. DWORD dwTitleW; // offset from struct to lpTitleW - might be NULL (indicating no title)
  78. }ICIX_PERSIST;
  79. #include <poppack.h>
  80. #define CONTEXTMENU_IDCMD_FIRST 1 // minimal QueryContextMenu idCmdFirst value //
  81. #define CONTEXTMENU_IDCMD_LAST 0x7fff // maximal QueryContextMenu idCmdLast value //
  82. //----------------------------------------------------------------------------
  83. // Internal helper macro
  84. //----------------------------------------------------------------------------
  85. #define _IOffset(class, itf) ((UINT_PTR)&(((class *)0)->itf))
  86. #define IToClass(class, itf, pitf) ((class *)(((LPSTR)pitf)-_IOffset(class, itf)))
  87. #define IToClassN(class, itf, pitf) IToClass(class, itf, pitf)
  88. //
  89. // Helper macro definitions
  90. //
  91. #define S_BOOL(f) MAKE_SCODE(SEVERITY_SUCCESS, 0, f)
  92. #ifdef DEBUG
  93. #define ReleaseAndAssert(punk) Assert(punk->lpVtbl->Release(punk)==0)
  94. #else
  95. #define ReleaseAndAssert(punk) (punk->lpVtbl->Release(punk))
  96. #endif
  97. //
  98. // this interface is just the IID. return back
  99. // a pointer to the IPersist interface if the object
  100. // implementation is free threaded. this is used
  101. // for performance on free threaded objects.
  102. //
  103. #define IPersistFreeThreadedObject IPersist
  104. // this interface is just the IID. return back
  105. // a pointer to the IDropTarget interface if the
  106. // object calls DAD_DragLeave/DAD_SetDragImage
  107. // in its IDropTarget::Drop().
  108. //
  109. #define IDropTargetWithDADSupport IDropTarget
  110. // this is only inherited by CFSFolder_IconOverlayManager, it enumerates through all IconOverlayID's and
  111. // keep their information in an array.
  112. //===========================================================================
  113. //
  114. // IBrowserBand
  115. //
  116. // IBrowserBand::GetObjectBB(REFIID riid, void **ppv)
  117. // Obtain a service from the web browser.
  118. //
  119. // IBrowserBand::SetBrowserBandInfo(DWORD dwMask, PBROWSERBANDINFO pbbi)
  120. // Set browser band properties based on members of browserbandinfo struct
  121. // specified by dwMask. These properties include title, deskband mode, and
  122. // current size.
  123. //
  124. //===========================================================================
  125. typedef struct {
  126. UINT cbSize;
  127. DWORD dwModeFlags;
  128. BSTR bstrTitle;
  129. SIZE sizeMin;
  130. SIZE sizeMax;
  131. SIZE sizeCur;
  132. } BROWSERBANDINFO, *PBROWSERBANDINFO;
  133. #define BBIM_MODEFLAGS 0x00000001
  134. #define BBIM_TITLE 0x00000002
  135. #define BBIM_SIZEMIN 0x00000004
  136. #define BBIM_SIZEMAX 0x00000008
  137. #define BBIM_SIZECUR 0x00000010
  138. #undef INTERFACE
  139. #define INTERFACE IBrowserBand
  140. DECLARE_INTERFACE_(IBrowserBand, IUnknown)
  141. {
  142. // *** IUnknown methods ***
  143. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  144. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  145. STDMETHOD_(ULONG,Release)(THIS) PURE;
  146. // *** IBrowserBand methods ***
  147. STDMETHOD(GetObjectBB)(THIS_ REFIID riid, void **ppv) PURE;
  148. STDMETHOD(SetBrowserBandInfo)(THIS_ DWORD dwMask, PBROWSERBANDINFO pbbi) PURE;
  149. STDMETHOD(GetBrowserBandInfo)(THIS_ DWORD dwMask, PBROWSERBANDINFO pbbi) PURE;
  150. };
  151. // NT4 Console Server included shell32\shlink.h to get structure
  152. // definitions and mimicked shell32\shlink.c to understand the
  153. // stream format so our stream format is fixed forever. This is
  154. // not bad since it was designed with extension in mind. We need
  155. // to publish (as privately as possible) the file format and
  156. // structures needed to read the file format.
  157. //
  158. // The stream format is a SHELL_LINK_DATA followed by
  159. // if SLDF_HAS_ID_LIST an ILSaveToStream followed by
  160. // if SLDF_HAS_LINK_INFO a LINKINFO followed by
  161. // if SLDF_HAS_NAME a STREAMSTRING followed by
  162. // if SLDF_RELPATH a STREAMSTRING followed by
  163. // if SLDF_WORKINGDIR a STREAMSTRING followed by
  164. // if SLDF_HAS_ARGS a STREAMSTRING followed by
  165. // if SLDF_HAS_ICON_LOCATION a STREAMSTRING followed by
  166. // SHWriteDataBlockList list of signature blocks
  167. //
  168. // Where a STREAMSTRING is a USHORT count of characters
  169. // followed by that many (SLDF_UNICODE ? WIDE : ANSI) characters.
  170. //
  171. typedef struct { // sld
  172. DWORD cbSize; // signature for this data structure
  173. CLSID clsid; // our GUID
  174. DWORD dwFlags; // SHELL_LINK_DATA_FLAGS enumeration
  175. DWORD dwFileAttributes;
  176. FILETIME ftCreationTime;
  177. FILETIME ftLastAccessTime;
  178. FILETIME ftLastWriteTime;
  179. DWORD nFileSizeLow;
  180. int iIcon;
  181. int iShowCmd;
  182. WORD wHotkey;
  183. WORD wUnused;
  184. DWORD dwRes1;
  185. DWORD dwRes2;
  186. } SHELL_LINK_DATA, *LPSHELL_LINK_DATA;
  187. typedef struct
  188. {
  189. DWORD cbSize; // Size of this extra data block
  190. DWORD dwSignature; // signature of this extra data block
  191. } EXP_HEADER, *LPEXP_HEADER;
  192. typedef struct
  193. {
  194. DWORD cbSize; // Size of this extra data block
  195. DWORD dwSignature; // signature of this extra data block
  196. BYTE abTracker[ 1 ]; //
  197. } EXP_TRACKER, *LPEXP_TRACKER;
  198. #define EXP_TRACKER_SIG 0xA0000003 // LPEXP_TRACKER
  199. typedef struct
  200. {
  201. DWORD cbSize; // Size of this extra data block
  202. DWORD dwSignature; // signature of this extra data block
  203. WCHAR wszLayerEnvName[64]; // name of shim layer to run with this link (eg "NT4SP5")
  204. } EXP_SHIMLAYER;
  205. #define EXP_SHIMLAYER_SIG 0xA0000008
  206. // NT40 Console Control Panel Applet does a CoCreateInstance(CLSID_CShellLink),
  207. // used the CShellLink definition to get the 'this' pointer, and passed that
  208. // along to some private exports in shell32. This completely prevents us
  209. // from moving the CShellLink implementation to another DLL. (If we do, or an
  210. // ISV takes our stream format and implements a better link by pointing the
  211. // classid to their implementation, the NT40 Console CPA will fault.)
  212. //
  213. // To fix this problem in future revs, CShellLink will support IShellLinkDataList
  214. // AddDataBlock adds the data block
  215. // FindDataBloc returns a LocalAlloc()d COPY of a data block with the
  216. // signature dwSig (NOTE: this is different than SHFindDataBlock)
  217. // RemoveDataBlock removes a data block with signature dwSig
  218. // Plan is for NT50's Console CPA to use this interface instead.
  219. //
  220. //
  221. // IURLSearchHook Interface is called whenever the browser navigates to a
  222. // non-standard URL. It can be used to redirect the user's request to a
  223. // search engine or a specific web site.
  224. //
  225. // A non-standard URL does not have a protocol prefix (e.g.,
  226. // "www.microsoft.com") and the protocol cannot be easily guessed by
  227. // the browser (e.g., "home.microsoft.com").
  228. //
  229. // The parameters of Translate(..)
  230. // lpwszSearchURL -- (IN/OUT) Wide char buffer that contains the request
  231. // "URL" user typed in as input and the tranlated URL
  232. // as output.
  233. // cchBufferSize -- (IN) size of lpwszSearchURL
  234. //
  235. // Return Values:
  236. // S_OK Search handled completely, pszResult has the full URL to
  237. // browse to. Stop running any further IURLSearchHooks and
  238. // pass this URL back to the browser for browsing.
  239. //
  240. // S_FALSE Query has been preprocessed, pszResult has the result of
  241. // the preprocess, further search still needed. Go on
  242. // executing the rest of the IURLSearchHooks. The
  243. // preprocessing steps can be:
  244. //
  245. // 1. replaced certain characters
  246. // 2. added more hints
  247. //
  248. // E_ABORT Search handled completely, stop running any further
  249. // IURLSearchHooks, but NO BROWSING NEEDED as a result,
  250. // pszResult is a copy of pcszQuery.
  251. //
  252. // ; NOTE: This is not fully implemented, yet, making IURLQualify return this
  253. // involves too much change.
  254. //
  255. // NOTE:: E_ABORT is currently treated as E_FAIL. It requires too much change.
  256. //
  257. // E_FAIL This Hook was unsuccessful. Search not handled at all,
  258. // pcszQueryURL has the query string. Please go on running
  259. // other IURLSearchHooks.
  260. //
  261. // History:
  262. // --/--/94 KurtE Created
  263. //
  264. // History:
  265. // 3/4/94 kraigb Created
  266. //
  267. // CGID_DefView Command Target IDs. used to persist global DefView state
  268. enum
  269. {
  270. DVID_SETASDEFAULT, // Set the DefView state of this folder as default for all of the same class
  271. DVID_RESETDEFAULT // Reset the DefView state to the default (delete subkeys)
  272. };
  273. // CGID_ShellDocView Command Target IDs. for shell doc view wedge
  274. enum {
  275. SHDVID_FINALTITLEAVAIL, // DEAD: variantIn bstr - sent after final OLECMDID_SETTITLE is sent
  276. SHDVID_MIMECSETMENUOPEN, // mimecharset menu open commands
  277. SHDVID_PRINTFRAME, // print HTML frame
  278. SHDVID_PUTOFFLINE, // DEAD: The Offline property has been changed
  279. SHDVID_PUTSILENT, // DEAD: The frame's Silent property has been changed
  280. SHDVID_GOBACK, // Navigate Back
  281. SHDVID_GOFORWARD, // Navigate Forward
  282. SHDVID_CANGOBACK, // Is Back Navigation Possible?
  283. SHDVID_CANGOFORWARD, // Is Forward Navigation Possible?
  284. SHDVID_CANACTIVATENOW, // (down) (PICS) OK to navigate to this view now?
  285. SHDVID_ACTIVATEMENOW, // (up) (PICS) Rating checks out, navigate now
  286. SHDVID_CANSUPPORTPICS, // (down) variantIn I4: IOleCommandTarget to reply to
  287. SHDVID_PICSLABELFOUND, // (up) variantIn bstr: PICS label
  288. SHDVID_NOMOREPICSLABELS, // (up) End of document, no more PICS labels coming
  289. SHDVID_CANDEACTIVATENOW, // (QS down) (in script/etc) OK to deactivate view now?
  290. SHDVID_DEACTIVATEMENOW, // (EXEC up) (in script/etc) out of script, deactivate view now
  291. SHDVID_NODEACTIVATENOW, // (EXEC up) (in script/etc) entering script, disable deactivate
  292. SHDVID_AMBIENTPROPCHANGE, // variantIn I4: dispid of ambient property that changed
  293. SHDVID_GETSYSIMAGEINDEX, // variantOut: image index for current page
  294. SHDVID_GETPENDINGOBJECT, // variantOut: IUnknown of pending shellview/docobject
  295. SHDVID_GETPENDINGURL, // variantOut: BSTR of URL for pending docobject
  296. SHDVID_SETPENDINGURL, // variantIn: BSTR of URL passed to pending docobject
  297. SHDVID_ISDRAGSOURCE, // (down) varioutOut I4: non-zero if it's initiated drag&drop
  298. SHDVID_DOCFAMILYCHARSET, // variantOut: I4: windows (family) codepage
  299. SHDVID_DOCCHARSET, // variantOut: I4: actual (mlang) codepage
  300. SHDVID_RAISE, // vaIn:I4:DTRF_*, vaOut:NULL unless DTRF_QUERY
  301. SHDVID_GETTRANSITION, // (down) vaIn: I4: TransitionEvent; vaOut BSTR (CLSID), I4 (dwSpeed)
  302. SHDVID_GETMIMECSETMENU, // get menu handle for mimecharset
  303. SHDVID_DOCWRITEABORT, // Abort binding but activate pending docobject
  304. SHDVID_SETPRINTSTATUS, // VariantIn: BOOL, TRUE - Started printing, FALSE - Finished printing
  305. SHDVID_NAVIGATIONSTATUS, // QS for tooltip text and Exec when user clicks
  306. SHDVID_PROGRESSSTATUS, // QS for tooltip text and Exec when user clicks
  307. SHDVID_ONLINESTATUS, // QS for tooltip text and Exec when user clicks
  308. SHDVID_SSLSTATUS, // QS for tooltip text and Exec when user clicks
  309. SHDVID_PRINTSTATUS, // QS for tooltip text and Exec when user clicks
  310. SHDVID_ZONESTATUS, // QS for tooltip text and Exec when user clicks
  311. SHDVID_ONCODEPAGECHANGE, // variantIn I4: new specified codepage
  312. SHDVID_SETSECURELOCK, // set the secure icon
  313. SHDVID_SHOWBROWSERBAR, // show browser bar of clsid guid
  314. SHDVID_NAVIGATEBB, // navigate to pidl in browserbar.
  315. SHDVID_UPDATEOFFLINEDESKTOP,// put the desktop in ON-LINE mode, update and put it back in Offline mode
  316. SHDVID_PICSBLOCKINGUI, // (up) In I4: pointer to "ratings nugget" for block API
  317. SHDVID_ONCOLORSCHANGE, // (up) sent by mshtml to indicate color set change
  318. SHDVID_CANDOCOLORSCHANGE, // (down) used to query if document supports the above
  319. SHDVID_QUERYMERGEDHELPMENU, // was the help menu micro-merged?
  320. SHDVID_QUERYOBJECTSHELPMENU,// return the object's help menu
  321. SHDVID_HELP, // do help
  322. SHDVID_UEMLOG, // set UEM logging vaIn:I4:UEMIND_*, vaOut:NULL
  323. SHDVID_GETBROWSERBAR, // get IDeskBand for browser bar of clsid guid
  324. SHDVID_GETFONTMENU,
  325. SHDVID_FONTMENUOPEN,
  326. SHDVID_CLSIDTOIDM, // get the idm for the given clsid
  327. SHDVID_GETDOCDIRMENU, // get menu handle for document direction
  328. SHDVID_ADDMENUEXTENSIONS, // Context Menu Extensions
  329. SHDVID_CLSIDTOMONIKER, // CLSID to property page resource mapping
  330. SHDVID_RESETSTATUSBAR, // set the status bar back to "normal" icon w/out text
  331. SHDVID_ISBROWSERBARVISIBLE, // is browser bar of clsid guid visible?
  332. SHDVID_GETOPTIONSHWND, // gets hwnd for internet options prop sheet (NULL if not open)
  333. SHDVID_DELEGATEWINDOWOM, // set policy for whether window OM methods should be delegated.
  334. SHDVID_PAGEFROMPOSTDATA, // determines if page was generated by post data
  335. SHDVID_DISPLAYSCRIPTERRORS, // tells the top docobject host to display his script err dialog
  336. SHDVID_NAVIGATEBBTOURL, // Navigate to an URL in browserbar (used in Trident).
  337. SHDVID_NAVIGATEFROMDOC, // The document delegated the navigation for a non-html mime-type.
  338. SHDVID_STARTPICSFORWINDOW, // (up) variantIn: IUnknown of window that is navigating
  339. // variantOut: bool if pics process started
  340. SHDVID_CANCELPICSFORWINDOW, // (up) variantIn: IUnknown of window that is no longer navigating
  341. SHDVID_ISPICSENABLED, // (up) variantOut: bool
  342. SHDVID_PICSLABELFOUNDINHTTPHEADER,// (up) variantIn bstr: PICS label
  343. SHDVID_CHECKINCACHEIFOFFLINE, // Check in cache if offline
  344. SHDVID_CHECKDONTUPDATETLOG, // check if the current navigate is already dealing with the travellog correctly
  345. SHDVID_UPDATEDOCHOSTSTATE, // Sent from CBaseBrowser2::_UpdateBrowserState to tell the dochost to update its state.
  346. SHDVID_FIREFILEDOWNLOAD,
  347. SHDVID_COMPLETEDOCHOSTPASSING,
  348. SHDVID_NAVSTART,
  349. SHDVID_SETNAVIGATABLECODEPAGE,
  350. SHDVID_WINDOWOPEN,
  351. SHDVID_PRIVACYSTATUS, // QS for tooltip text and exec when user clicks
  352. SHDVID_FORWARDSECURELOCK, // asks CDocObjectHost to forward its security status up to the shell browser
  353. SHDVID_ISEXPLORERBARVISIBLE, // is any explorer bar visible?
  354. };
  355. // CGID_DocHostCmdPriv Command Target IDs
  356. //
  357. enum
  358. {
  359. DOCHOST_DOCCANNAVIGATE, // The document knows how to navigate.
  360. DOCHOST_NAVIGATION_ERROR, // Navigation Error
  361. DOCHOST_DOCHYPERLINK, // The document is navigating.
  362. DOCHOST_SENDINGREQUEST, // The document is sending a request for download. Update the progress bar.
  363. DOCHOST_FINDINGRESOURCE, // The document is finding a resource. Update the progress bar.
  364. DOCHOST_RESETSEARCHINFO, // Reset search information (after a successful navigation)
  365. DOCHOST_SETBROWSERINDEX, // Sets the browser ID to use for TravelLog and frame targeting
  366. DOCHOST_NOTE_ERROR_PAGE, // Need to know when we're navigating to an error web page.
  367. DOCHOST_READYSTATE_INTERACTIVE, // a document on a page is readystate interactive
  368. DOCHOST_CONTENTDISPOSITIONATTACH // The document needs to be saved.
  369. };
  370. // CGID_SearchBand Command Target IDs.
  371. enum {
  372. SBID_SEARCH_NEW, // (re)load the context-appropriate url
  373. SBID_SEARCH_NEXT, // cycle between multiple providers
  374. SBID_SEARCH_CUSTOMIZE, // navigate to customization url
  375. SBID_SEARCH_HELP, // what it says
  376. SBID_GETPIDL, // get the search pane's pidl
  377. SBID_HASPIDL, // does the search pane have a pidl (i.e, has it navigated)
  378. };
  379. // CGID_MediaBar target ids
  380. enum {
  381. MBID_PLAY, // Play an url
  382. MBID_POPOUT // Detect state of player
  383. };
  384. enum {
  385. MB_DOCKED,
  386. MB_POPOUT
  387. };
  388. //
  389. // Private struct passed as argument to SHDVID_UPDATEDOCHOSTSTATE
  390. //
  391. struct DOCHOSTUPDATEDATA
  392. {
  393. LPITEMIDLIST _pidl;
  394. BOOL _fIsErrorUrl;
  395. };
  396. //
  397. // this enum is used by SHDVID_SETSECURELOCK and SBCMDID_SETSECURELOCKICON
  398. // when adding new values, make sure to add to both SET and SUGGEST, and
  399. // the code depends on a direct correlation between the level of security
  400. // and the value of the enum. so keep new values in the correct order
  401. //
  402. enum {
  403. SECURELOCK_NOCHANGE = -1,
  404. SECURELOCK_SET_UNSECURE = 0,
  405. SECURELOCK_SET_MIXED,
  406. SECURELOCK_SET_SECUREUNKNOWNBIT,
  407. SECURELOCK_SET_SECURE40BIT,
  408. SECURELOCK_SET_SECURE56BIT,
  409. SECURELOCK_SET_FORTEZZA,
  410. SECURELOCK_SET_SECURE128BIT,
  411. SECURELOCK_FIRSTSUGGEST,
  412. SECURELOCK_SUGGEST_UNSECURE = SECURELOCK_FIRSTSUGGEST,
  413. SECURELOCK_SUGGEST_MIXED,
  414. SECURELOCK_SUGGEST_SECUREUNKNOWNBIT,
  415. SECURELOCK_SUGGEST_SECURE40BIT,
  416. SECURELOCK_SUGGEST_SECURE56BIT,
  417. SECURELOCK_SUGGEST_FORTEZZA,
  418. SECURELOCK_SUGGEST_SECURE128BIT,
  419. };
  420. #define FCIDM_DRIVELIST (FCIDM_BROWSERFIRST + 2) //
  421. #define FCIDM_TREE (FCIDM_BROWSERFIRST + 3) //
  422. #define FCIDM_TABS (FCIDM_BROWSERFIRST + 4) //
  423. #define FCIDM_REBAR (FCIDM_BROWSERFIRST + 5) //
  424. // SBCMDID_SHOWCONTROL
  425. enum {
  426. SBSC_HIDE = 0,
  427. SBSC_SHOW = 1,
  428. SBSC_TOGGLE = 2,
  429. SBSC_QUERY = 3
  430. };
  431. // SBCMDID_OPTIONS
  432. enum {
  433. SBO_DEFAULT = 0 ,
  434. SBO_NOBROWSERPAGES = 1
  435. };
  436. // CGID_Explorer Command Target IDs
  437. enum {
  438. SBCMDID_ENABLESHOWTREE = 0,
  439. SBCMDID_SHOWCONTROL = 1, // variant vt_i4 = loword = FCW_* hiword = SBSC_*
  440. SBCMDID_CANCELNAVIGATION = 2, // cancel last navigation
  441. SBCMDID_MAYSAVECHANGES = 3, // about to close and may save changes
  442. SBCMDID_SETHLINKFRAME = 4, // variant vt_i4 = phlinkframe
  443. SBCMDID_ENABLESTOP = 5, // variant vt_bool = fEnable
  444. SBCMDID_OPTIONS = 6, // the view.options page
  445. SBCMDID_EXPLORER = 7, // are you explorer.exe?
  446. SBCMDID_ADDTOFAVORITES = 8,
  447. SBCMDID_ACTIVEOBJECTMENUS = 9,
  448. SBCMDID_MAYSAVEVIEWSTATE = 10, // Should we save view stream
  449. SBCMDID_DOFAVORITESMENU = 11, // popup the favorites menu
  450. SBCMDID_DOMAILMENU = 12, // popup the mail menu
  451. SBCMDID_GETADDRESSBARTEXT = 13, // get user-typed text
  452. SBCMDID_ASYNCNAVIGATION = 14, // do an async navigation
  453. SBCMDID_SEARCHBAROBSOLETE = 15, // OBSOLETE beta-1 SEARCHBAR
  454. SBCMDID_FLUSHOBJECTCACHE = 16, // flush object cache
  455. SBCMDID_CREATESHORTCUT = 17, // create a shortcut
  456. SBCMDID_SETMERGEDWEBMENU = 18, // set pre-merged menu for HTML
  457. SBCMDID_REMOVELOCKICON = 19, // Remove lock icon
  458. SBCMDID_SELECTHISTPIDL = 20, // QS:EXEC select history pidl on navigate
  459. SBCMDID_WRITEHIST = 21, // QS only:write history sf on navigate
  460. SBCMDID_GETHISTPIDL = 22, // EXEC gets most recent history pidl
  461. SBCMDID_REGISTERNSCBAND = 23, // EXEC registers NscBand when visible
  462. SBCMDID_COCREATEDOCUMENT = 24, // Create an instance of MSHTML
  463. SBCMDID_SETSECURELOCKICON = 25, // sets the SSL lock icon for the current page
  464. SBCMDID_INITFILECTXMENU = 26, // EXEC,QS: file context menu for band item
  465. SBCMDID_UNREGISTERNSCBAND = 27, // EXEC unregisters NscBand when invisible
  466. SBCMDID_SEARCHBAR = 28, // show/hide/toggle BrowserBar search
  467. SBCMDID_HISTORYBAR = 29, // show/hide/toggle BrowserBar history
  468. SBCMDID_FAVORITESBAR = 30, // show/hide/toggle BrowserBar favorites
  469. #ifdef ENABLE_CHANNELS
  470. SBCMDID_CHANNELSBAR = 31, // show/hide/toggle BrowserBar channels
  471. #endif
  472. SBCMDID_SENDPAGE = 32, // sends the current page via email
  473. SBCMDID_SENDSHORTCUT = 33, // sends a shortcut to current page via email
  474. SBCMDID_TOOLBAREMPTY = 34, // toolbar has nothing visible
  475. SBCMDID_EXPLORERBAR = 35, // show/hide/toggle BrowserBar all folders
  476. SBCMDID_GETUSERADDRESSBARTEXT = 36, // get the exact text the user-entered
  477. SBCMDID_HISTSFOLDER = 37, // EXEC varOut returns cached history IShellFolder
  478. SBCMDID_UPDATETRAVELLOG = 38, // updates the travellog with the current info
  479. SBCMDID_MIXEDZONE = 39, // The current view has mixed zones
  480. SBCMDID_REPLACELOCATION = 40, // replace the current URL with this one.
  481. SBCMDID_GETPANE = 41, // Browser asks the view for pane ordinal
  482. SBCMDID_FILERENAME = 42, // Browser forwards file->rename to explorer bar
  483. SBCMDID_FILEDELETE = 43, // Browser forwards file->delete to explorer bar
  484. SBCMDID_FILEPROPERTIES = 44, // Browser forwards file->properties to explorer bar
  485. SBCMDID_IESHORTCUT = 45, // Navigates the browser to an .url file
  486. SBCMDID_GETSHORTCUTPATH = 46, // Asks for the path to the shortcut - if it exists
  487. SBCMDID_DISCUSSIONBAND = 47, // show/hide/toggle the Office discussion band
  488. SBCMDID_SETADDRESSBARFOCUS = 48, // Set focus on address bar on WM_ACTIVATE (UNIX)
  489. SBCMDID_HASADDRESSBARFOCUS = 49, // Checks whether address bar has focus (UNIX)
  490. SBCMDID_MSGBAND = 50, // MsgBand Message (UNIX)
  491. SBCMDID_ISIEMODEBROWSER = 51, // returns S_OK if browser is in IE mode
  492. SBCMDID_GETTEMPLATEMENU = 52, // get handle to template menu
  493. SBCMDID_GETCURRENTMENU = 53, // get handle to current menu
  494. SBCMDID_ERRORPAGE = 54, // informs addressbar mru that this is an error page
  495. SBCMDID_AUTOSEARCHING = 55, // informs addressbar mru that we are trying a new url
  496. SBCMDID_STARTEDFORINTERNET = 56, // return S_OK if window started as IE window, S_FALSE otherwise
  497. SBCMDID_ISBROWSERACTIVE = 57, // return S_OK if the browser is active, S_FALSE otherwise
  498. SBCMDID_SUGGESTSAVEWINPOS = 58, // return S_OK if browser decides to save window position, S_FALSE otherwise
  499. SBCMDID_CACHEINETZONEICON = 59, // Cache/refresh internet zone icons painted by status bar
  500. SBCMDID_ONVIEWMOVETOTOP = 60, // Notification that the view window has moved to HWND_TOP
  501. SBCMDID_ONCLOSE = 61, // Close notification destined for the dochost.
  502. SBCMDID_CANCELANDCLOSE = 62, // Cancel the async download and close the browser.
  503. SBCMDID_MEDIABAR = 63, // show/hide/toggle MediaBar
  504. };
  505. #define ZONE_UNKNOWN -1
  506. #define ZONE_MIXED -2
  507. #define IS_SPECIAL_ZONE(a) (((a) == ZONE_UNKNOWN) || ((a) == ZONE_MIXED))
  508. #if (_WIN32_IE >= 0x0400)
  509. // CGID_AddresseditBox Command Target IDs
  510. enum {
  511. AECMDID_SAVE = 0, // Ask AddressEditBox to save
  512. };
  513. #endif
  514. #ifdef NONAMELESSUNION
  515. #define NAMELESS_MEMBER(member) DUMMYUNIONNAME.##member
  516. #else
  517. #define NAMELESS_MEMBER(member) member
  518. #endif
  519. #define STRRET_OLESTR STRRET_WSTR // same as STRRET_WSTR
  520. #define STRRET_OFFPTR(pidl,lpstrret) ((LPSTR)((LPBYTE)(pidl)+(lpstrret)->NAMELESS_MEMBER(uOffset)))
  521. // DOC'ed for DOJ compliance
  522. SHSTDAPI SHParseShellItem(LPCWSTR psz, IShellItem **ppsi);
  523. SHSTDAPI SIEnumObjects(IShellItem *psi, HWND hwnd, SHCONTF flags, IEnumShellItems **ppenum);
  524. SHSTDAPI SHCreateShellItemArray(LPCITEMIDLIST pidlParent,IShellFolder *psfParent,UINT cidl,
  525. LPCITEMIDLIST *ppidl,IShellItemArray **ppsiItemArray);
  526. #define REGSTR_PATH_INTERNET_EXPLORER TEXT("\\SOFTWARE\\Microsoft\\Internet Explorer")
  527. #define REGSTR_PATH_IE_MAIN REGSTR_PATH_INTERNET_EXPLORER TEXT("\\Main")
  528. #define REGSTR_VALUE_USER_AGENT TEXT("UserAgent")
  529. #define REGSTR_DEFAULT_USER_AGENT TEXT("Mozilla/2.0 (compatible; MSIE 3.0A; Windows 95)")
  530. // 0x000f
  531. #define CSIDL_PERUSER_TEMP 0x0032 // per user TEMP (reserved, not impelemented)
  532. #define CSIDL_9XCOMMAND 0x0033 // Win9x COMMANDN (dos programs) (reserved, not impelemented)
  533. #define CSIDL_9XSYSTEM 0x0034 // Win9x/NT system (not system32) (reserved, not impelemented)
  534. #define CSIDL_FLAG_DONT_UNEXPAND 0x2000 // combine with CSIDL_ value to avoid unexpanding environment variables
  535. // DOC'ed for DOJ compliance
  536. SHFOLDERAPI SHSetFolderPathA(int csidl, HANDLE hToken, DWORD dwFlags, LPCSTR pszPath);
  537. // 0x000f
  538. #define CSIDL_PERUSER_TEMP 0x0032 // per user TEMP (reserved, not impelemented)
  539. #define CSIDL_9XCOMMAND 0x0033 // Win9x COMMANDN (dos programs) (reserved, not impelemented)
  540. #define CSIDL_9XSYSTEM 0x0034 // Win9x/NT system (not system32) (reserved, not impelemented)
  541. #define CSIDL_FLAG_DONT_UNEXPAND 0x2000 // combine with CSIDL_ value to avoid unexpanding environment variables
  542. // DOC'ed for DOJ compliance
  543. SHFOLDERAPI SHSetFolderPathW(int csidl, HANDLE hToken, DWORD dwFlags, LPCWSTR pszPath);
  544. #ifdef UNICODE
  545. #define SHSetFolderPath SHSetFolderPathW
  546. #else
  547. #define SHSetFolderPath SHSetFolderPathA
  548. #endif // !UNICODE
  549. SHSTDAPI_(BOOL) MakeShellURLFromPathA(LPCSTR pszPathIn, LPSTR pszUrl, DWORD dwCch);
  550. SHSTDAPI_(BOOL) MakeShellURLFromPathW(LPCWSTR pszPathIn, LPWSTR pszUrl, DWORD dwCch);
  551. #ifdef UNICODE
  552. #define MakeShellURLFromPath MakeShellURLFromPathW
  553. #else
  554. #define MakeShellURLFromPath MakeShellURLFromPathA
  555. #endif // !UNICODE
  556. SHSTDAPI_(BOOL) SHIsTempDisplayMode();
  557. SHSTDAPI_(FILEDESCRIPTOR *) GetFileDescriptor(FILEGROUPDESCRIPTOR *pfgd, BOOL fUnicode, int nIndex, LPTSTR pszName);
  558. SHSTDAPI CopyStreamUI(IStream *pstmSrc, IStream *pstmDest, IProgressDialog *pdlg, ULONGLONG ullMaxBytes);
  559. // DOC'ed for DOJ compliance
  560. // above was doc'ed for DOJ compliance
  561. // pszTitle can be a resource, but the hinst is assumed to be shell32.dll
  562. // lpszTitle can be a resource, but the hinst is assumed to be shell32.dll
  563. //-------------------------------------------------------------------------
  564. //
  565. // Shell Service Object
  566. //
  567. //-------------------------------------------------------------------------
  568. // Cmds for CGID_ShellServiceObject
  569. enum {
  570. SSOCMDID_OPEN = 2,
  571. SSOCMDID_CLOSE = 3,
  572. };
  573. #define CMDID_SAVEASTHICKET 5
  574. //-------------------------------------------------------------------------
  575. // STR_DISPLAY_UI_DURING_BINDING - IBindCtx Key
  576. //-------------------------------------------------------------------------
  577. // If displaying UI during binding is allowed, this parameter
  578. // will be in the IBindCtx so the object binding can get the
  579. // IUnknown* of the site in order to:
  580. // 1. Use the site's hwnd as the parent hwnd of any UI dialogs.
  581. // This is done via. IOleWindow::GetWindow() or IInternetSecurityMgrSite::GetWindow()
  582. // 2. While the dialog is being displayed, make the site modal
  583. // This is done via:
  584. // IOleInPlaceActiveObject::EnableModeless()
  585. // IOleInPlaceUIWindow::EnableModelessSB()
  586. // IInternetSecurityMgrSite::EnableModeless()
  587. #define STR_DISPLAY_UI_DURING_BINDING L"UI During Binding"
  588. // bindctx key, tells an FS folder to ignore the STGM_CREATE flag in ParseDisplayName.
  589. // otherwise it will always succeed, but we need to be able to force it to fail for
  590. // the cd-r drive.
  591. #define STR_DONT_FORCE_CREATE L"Don't Force Create"
  592. // bindctx key, passed to IShellFolder::ParseDisplayName(). gives netfldr extra
  593. // information it can use to route the parsing of the name we are giving it.
  594. #define STR_PARSE_NETFOLDER_INFO L"Net Parse Data"
  595. // in the property bag associated with STR_PARSE_NETFOLDER_INFO this string property
  596. // defines the WNetProvider to be used when calling WNetGetResourceInformation.
  597. #define STR_PARSE_NETFOLDER_PROVIDERNAME L"WNetProvider"
  598. //
  599. // The IShellDetails interface was private in win95 and didnt have a _WIN32_IE guard,
  600. // so it is now in shlobj.h, along with the definition of SHELLDETAILS
  601. //
  602. #undef INTERFACE
  603. #define INTERFACE IMountedVolume
  604. DECLARE_INTERFACE_(IMountedVolume, IUnknown)
  605. {
  606. // *** IUnknown methods ***
  607. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  608. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  609. STDMETHOD_(ULONG,Release) (THIS) PURE;
  610. // *** IMountedVolume methods ***
  611. STDMETHOD(Initialize)(THIS_ LPCWSTR pcszHostFolderPath) PURE;
  612. };
  613. //-------------------------------------------------------------------------
  614. // This is the interface for a browser to "subclass" the main File Cabinet
  615. // window. Note that only the hwnd, message, wParam, and lParam fields of
  616. // the msg structure are used. The browser window will get a WM_NOTIFY
  617. // message with NULL ID, FCN_MESSAGE as the code, and a pointer to
  618. // FCMSG_NOTIFY as the lParam.
  619. //
  620. //-------------------------------------------------------------------------
  621. #include <pshpack8.h>
  622. typedef struct tagFCMSG_NOTIFY
  623. {
  624. NMHDR hdr;
  625. MSG msg;
  626. LRESULT lResult;
  627. } FCMSG_NOTIFY;
  628. #include <poppack.h> /* Return to byte packing */
  629. #define FCN_MESSAGE (100)
  630. //---------------------------------------------------------------------------
  631. // messages that can be send to the cabinet by other apps
  632. //
  633. // REVIEW: Do we really need to publish any of those?
  634. //---------------------------------------------------------------------------
  635. #define NF_INHERITVIEW 0x0000
  636. #define NF_LOCALVIEW 0x0001
  637. // Change the path of an existing folder.
  638. // wParam:
  639. // 0: LPARAM is a pidl, handle the message immediately.
  640. // CSP_REPOST: LPARAM is a pidl, copy the pidl and handle the
  641. // message later.
  642. // CSP_NOEXECUTE: if this path is not a folder, fail, don't shell exec
  643. //
  644. //
  645. // lParam: LPITEMIDLIST of path.
  646. //
  647. //
  648. #define CSP_REPOST 0x0001
  649. #define CSP_INITIATEDBYHLINKFRAME 0x0002
  650. #define CSP_NOEXECUTE 0x0004
  651. #define CSP_NONAVIGATE 0x0008
  652. #define CWM_SETPATH (WM_USER + 2)
  653. // lpsv points to the Shell View extension that requested idle processing
  654. // uID is an app define identifier for the processor
  655. // returns: TRUE if there is more idle processing necessary, FALSE if all done
  656. // Note that the idle processor should do one "atomic" operation and return
  657. // as soon as possible.
  658. typedef BOOL (CALLBACK *FCIDLEPROC)(void *lpsv, UINT uID);
  659. // Inform the File Cabinet that you want idle messages.
  660. // This should ONLY be used by File Cabinet extensions.
  661. // wParam: app define UINT (passed to FCIDLEPROC).
  662. // lParam: pointer to an FCIDLEPROC.
  663. // return: TRUE if successful; FALSE otherwise
  664. //
  665. #define CWM_WANTIDLE (WM_USER + 3)
  666. // get or set the FOLDERSETTINGS for a view
  667. // wParam: BOOL TRUE -> set to view info buffer, FALSE -> get view info buffer
  668. // lParam: LPFOLDERSETTINGS buffer to get or set view info
  669. //
  670. #define CWM_GETSETCURRENTINFO (WM_USER + 4)
  671. #define FileCabinet_GetSetCurrentInfo(_hwnd, _bSet, _lpfs) \
  672. SendMessage(_hwnd, CWM_GETSETCURRENTINFO, (WPARAM)(_bSet), (LPARAM)(LPFOLDERSETTINGS)_lpfs)
  673. // selects the specified item in the current view
  674. // wParam: SVSI_* flags
  675. // lParam: LPCITEMIDLIST of the item ID, NULL -> all items
  676. //
  677. #define CWM_SELECTITEM (WM_USER + 5)
  678. #define FileCabinet_SelectItem(_hwnd, _sel, _item) \
  679. SendMessage(_hwnd, CWM_SELECTITEM, _sel, (LPARAM)(LPCITEMIDLIST)(_item))
  680. // selects the specified path in the current view
  681. // wParam: SVSI_* flags
  682. // lParam: LPCSTR of the display name
  683. //
  684. #define CWM_SELECTPATH (WM_USER + 6)
  685. #define FileCabinet_SelectPath(_hwnd, _sel, _path) \
  686. SendMessage(_hwnd, CWM_SELECTPATH, _sel, (LPARAM)(LPCSTR)(_path))
  687. // Get the IShellBrowser object associated with an hwndMain
  688. #define CWM_GETISHELLBROWSER (WM_USER + 7)
  689. #define FileCabinet_GetIShellBrowser(_hwnd) \
  690. (IShellBrowser*)SendMessage(_hwnd, CWM_GETISHELLBROWSER, 0, 0L)
  691. //
  692. // two pidls can have the same path, so we need a compare pidl message
  693. #define CWM_COMPAREPIDL (WM_USER + 9)
  694. //
  695. // sent when the global state changes
  696. #define CWM_GLOBALSTATECHANGE (WM_USER + 10)
  697. #define CWMF_GLOBALSTATE 0x0000
  698. #define CWMF_SECURITY 0x0001
  699. // sent to the desktop from a second instance
  700. #define CWM_COMMANDLINE (WM_USER + 11)
  701. // global clone your current pidl
  702. #define CWM_CLONEPIDL (WM_USER + 12)
  703. // See if the root of the instance is as specified
  704. #define CWM_COMPAREROOT (WM_USER + 13)
  705. // Tell desktop our root
  706. #define CWM_SPECIFYCOMPARE (WM_USER + 14)
  707. // See if the root of the instance matches a hwnd
  708. #define CWM_PERFORMCOMPARE (WM_USER + 15)
  709. // Forward SHChangeNotify events
  710. #define CWM_FSNOTIFY (WM_USER + 16)
  711. // Forward SHChangeRegistration events
  712. #define CWM_CHANGEREGISTRATION (WM_USER + 17)
  713. // For AddToRecentDocs processing by desktop
  714. #define CWM_ADDTORECENT (WM_USER + 18)
  715. // For SHWaitForFile processing by desktopop
  716. #define CWM_WAITOP (WM_USER + 19)
  717. // Notify for changes to the fav's folder.
  718. #define CWM_FAV_CHANGE (WM_USER + 20)
  719. #define CWM_SHOWDRAGIMAGE (WM_USER + 21)
  720. #define CWM_SHOWFOLDEROPT (WM_USER + 22)
  721. #define CWMW_FOLDEROPTIONS 0 // wParam for CWM_SHOWFOLDEROPT
  722. #define CWMW_TASKBAROPTIONS 1 // wParam for CWM_SHOWFOLDEROPT
  723. #define CWM_FSNOTIFYSUSPENDRESUME (WM_USER + 23)
  724. #define CWM_CREATELOCALSERVER (WM_USER + 24)
  725. #define CWM_GETSCNWINDOW (WM_USER + 25)
  726. #define CWM_TASKBARWAKEUP (WM_USER + 26) // Used to restore tray thread to normal priority in extremely stressed machines
  727. #define CWM_STARTNETCRAWLER (WM_USER + 27)
  728. #define CWM_RESERVEDFORCOMDLG_FIRST (WM_USER + 100)
  729. #define CWM_RESERVEDFORCOMDLG_LAST (WM_USER + 199)
  730. #define CWM_RESERVEDFORWEBBROWSER_FIRST (WM_USER + 200)
  731. #define CWM_RESERVEDFORWEBBROWSER_LAST (WM_USER + 299)
  732. #define STFRF_NORMAL DWFRF_NORMAL
  733. #define STFRF_DELETECONFIGDATA DWFRF_DELETECONFIGDATA
  734. #undef INTERFACE
  735. #define INTERFACE IMultiMonitorDockingSite
  736. DECLARE_INTERFACE_(IMultiMonitorDockingSite, IUnknown)
  737. {
  738. // *** IUnknown methods ***
  739. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  740. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  741. STDMETHOD_(ULONG,Release) (THIS) PURE;
  742. // *** IMultiMonitorDockingSite methods ***
  743. STDMETHOD(GetMonitor) (THIS_ IUnknown* punkSrc, HMONITOR * phMon) PURE;
  744. STDMETHOD(RequestMonitor) (THIS_ IUnknown* punkSrc, HMONITOR * phMon) PURE;
  745. STDMETHOD(SetMonitor) (THIS_ IUnknown* punkSrc, HMONITOR hMonNew, HMONITOR *phMonOld) PURE;
  746. };
  747. #if (_WIN32_IE >= 0x0400)
  748. // Interface used to scale and sharpen images...
  749. // right now, always pass the palette from SHCreateShellPalette on a 256 colour machine...
  750. #undef INTERFACE
  751. #define INTERFACE IScaleAndSharpenImage2
  752. DECLARE_INTERFACE_ (IScaleAndSharpenImage2, IUnknown )
  753. {
  754. // *** IUnknown methods ***
  755. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  756. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  757. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  758. // *** IScaleAndSharpenImage methods ***
  759. STDMETHOD( ScaleSharpen2 ) ( THIS_ BITMAPINFO * pbi,
  760. void * pBits,
  761. HBITMAP * phBmpThumbnail,
  762. const SIZE * prgSize,
  763. DWORD dwRecClrDepth,
  764. HPALETTE hpal,
  765. UINT uiSharpPct,
  766. BOOL fOrigSize) PURE;
  767. };
  768. // IImageCache
  769. // Interface for controlling and accessing an imagecache of bitmaps for icons..
  770. // flags for the dwMask member of IMAGECACHEINFO
  771. #define ICIFLAG_LARGE 0x0001
  772. #define ICIFLAG_SMALL 0x0002
  773. #define ICIFLAG_BITMAP 0x0004
  774. #define ICIFLAG_ICON 0x0008
  775. #define ICIFLAG_INDEX 0x0010
  776. #define ICIFLAG_NAME 0x0020
  777. #define ICIFLAG_FLAGS 0x0040
  778. #define ICIFLAG_NOUSAGE 0x0080
  779. #define ICIFLAG_DATESTAMP 0x0100
  780. #define ICIFLAG_MIRROR 0x2000
  781. #if (_WIN32_IE >= 0x0501)
  782. #define ICIFLAG_SYSTEM 0x4000
  783. #endif
  784. typedef struct _tagImageCacheInfo
  785. {
  786. DWORD cbSize;
  787. DWORD dwMask;
  788. union
  789. {
  790. HBITMAP hBitmapLarge;
  791. HICON hIconLarge;
  792. };
  793. HBITMAP hMaskLarge;
  794. union
  795. {
  796. HBITMAP hBitmapSmall;
  797. HICON hIconSmall;
  798. };
  799. HBITMAP hMaskSmall;
  800. LPCWSTR pszName;
  801. int iIndex;
  802. DWORD dwFlags;
  803. #if (_WIN32_IE >= 0x0500)
  804. FILETIME ftDateStamp;
  805. #endif
  806. } IMAGECACHEINFO;
  807. typedef IMAGECACHEINFO * LPIMAGECACHEINFO;
  808. typedef const IMAGECACHEINFO * LPCIMAGECACHEINFO;
  809. #define ICIIFLAG_LARGE 0x0001
  810. #define ICIIFLAG_SMALL 0x0002
  811. #if (_WIN32_IE >= 0x0501)
  812. #define ICIIFLAG_SORTBYUSED 0x0004
  813. #endif
  814. typedef struct _tagImageCacheInitInfo
  815. {
  816. DWORD cbSize;
  817. DWORD dwMask;
  818. HIMAGELIST himlLarge;
  819. HIMAGELIST himlSmall;
  820. SIZEL rgSizeLarge;
  821. SIZEL rgSizeSmall;
  822. DWORD dwFlags;
  823. int iStart;
  824. int iGrow;
  825. }IMAGECACHEINITINFO;
  826. typedef IMAGECACHEINITINFO * LPIMAGECACHEINITINFO;
  827. #undef INTERFACE
  828. #define INTERFACE IImageCache
  829. DECLARE_INTERFACE_ ( IImageCache, IUnknown )
  830. {
  831. // *** IUnknown methods ***
  832. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  833. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  834. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  835. // *** IImageCache methods ***
  836. STDMETHOD ( AddImage ) ( THIS_ LPCIMAGECACHEINFO pInfo, UINT * puIndex ) PURE;
  837. STDMETHOD ( FindImage ) ( THIS_ LPCIMAGECACHEINFO pInfo, UINT * puIndex ) PURE;
  838. STDMETHOD ( FreeImage ) ( THIS_ UINT iImageIndex ) PURE;
  839. STDMETHOD ( Flush )( THIS_ BOOL fRelease ) PURE;
  840. STDMETHOD ( ChangeImageInfo ) ( THIS_ UINT IImageIndex, LPCIMAGECACHEINFO pInfo ) PURE;
  841. STDMETHOD ( GetCacheSize ) ( THIS_ UINT * puSize ) PURE;
  842. STDMETHOD ( GetUsage ) ( THIS_ UINT uIndex, UINT * puUsage ) PURE;
  843. STDMETHOD( GetImageList ) ( THIS_ LPIMAGECACHEINITINFO pInfo ) PURE;
  844. };
  845. typedef IImageCache * LPIMAGECACHE;
  846. #if (_WIN32_IE >= 0x0500)
  847. // IImageCache 2
  848. #undef INTERFACE
  849. #define INTERFACE IImageCache2
  850. DECLARE_INTERFACE_ ( IImageCache2, IImageCache )
  851. {
  852. // *** IUnknown methods ***
  853. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  854. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  855. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  856. // *** IImageCache methods ***
  857. STDMETHOD ( AddImage ) ( THIS_ LPCIMAGECACHEINFO pInfo, UINT * puIndex ) PURE;
  858. STDMETHOD ( FindImage ) ( THIS_ LPCIMAGECACHEINFO pInfo, UINT * puIndex ) PURE;
  859. STDMETHOD ( FreeImage ) ( THIS_ UINT iImageIndex ) PURE;
  860. STDMETHOD ( Flush )( THIS_ BOOL fRelease ) PURE;
  861. STDMETHOD ( ChangeImageInfo ) ( THIS_ UINT IImageIndex, LPCIMAGECACHEINFO pInfo ) PURE;
  862. STDMETHOD ( GetCacheSize ) ( THIS_ UINT * puSize ) PURE;
  863. STDMETHOD ( GetUsage ) ( THIS_ UINT uIndex, UINT * puUsage ) PURE;
  864. STDMETHOD( GetImageList ) ( THIS_ LPIMAGECACHEINITINFO pInfo ) PURE;
  865. // IImageCache2 methods
  866. STDMETHOD ( DeleteImage ) ( THIS_ UINT iImageIndex ) PURE;
  867. STDMETHOD ( GetImageInfo ) (THIS_ UINT iImageIndex, LPIMAGECACHEINFO pInfo ) PURE;
  868. };
  869. #endif
  870. #if (_WIN32_IE >= 0x0501)
  871. // These are values returned from IImageCache::GetUsage which correspond
  872. // to the state of the cache entry
  873. #define ICD_USAGE_NOUSAGE (UINT) -1
  874. #define ICD_USAGE_DELETED (UINT) -2
  875. #define ICD_USAGE_SYSTEM (UINT) -3
  876. // IImageCache 3
  877. #undef INTERFACE
  878. #define INTERFACE IImageCache3
  879. DECLARE_INTERFACE_ ( IImageCache3, IImageCache2 )
  880. {
  881. // *** IUnknown methods ***
  882. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  883. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  884. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  885. // *** IImageCache methods ***
  886. STDMETHOD ( AddImage ) ( THIS_ LPCIMAGECACHEINFO pInfo, UINT * puIndex ) PURE;
  887. STDMETHOD ( FindImage ) ( THIS_ LPCIMAGECACHEINFO pInfo, UINT * puIndex ) PURE;
  888. STDMETHOD ( FreeImage ) ( THIS_ UINT iImageIndex ) PURE;
  889. STDMETHOD ( Flush )( THIS_ BOOL fRelease ) PURE;
  890. STDMETHOD ( ChangeImageInfo ) ( THIS_ UINT IImageIndex, LPCIMAGECACHEINFO pInfo ) PURE;
  891. STDMETHOD ( GetCacheSize ) ( THIS_ UINT * puSize ) PURE;
  892. STDMETHOD ( GetUsage ) ( THIS_ UINT uIndex, UINT * puUsage ) PURE;
  893. STDMETHOD ( GetImageList ) ( THIS_ LPIMAGECACHEINITINFO pInfo ) PURE;
  894. // *** IImageCache2 methods ***
  895. STDMETHOD ( DeleteImage ) ( THIS_ UINT iImageIndex ) PURE;
  896. STDMETHOD ( GetImageInfo ) (THIS_ UINT iImageIndex, LPIMAGECACHEINFO pInfo ) PURE;
  897. // *** IImageCache3 methods ***
  898. STDMETHOD ( GetImageIndexFromCacheIndex )( UINT iCacheIndex, UINT * puImageIndex ) PURE;
  899. };
  900. #endif
  901. //
  902. // Interface for interacting with the IE splash screen
  903. //
  904. #undef INTERFACE
  905. #define INTERFACE ISplashScreen
  906. DECLARE_INTERFACE_( ISplashScreen, IUnknown )
  907. {
  908. // *** IUnknown methods ***
  909. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  910. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  911. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  912. // *** ISplashScreen methods ***
  913. STDMETHOD ( Show ) ( THIS_ HINSTANCE hinst, UINT idResHi, UINT idResLow, HWND * phwnd ) PURE;
  914. STDMETHOD ( Dismiss ) (THIS) PURE;
  915. };
  916. typedef ISplashScreen * LPSPLASHSCREEN;
  917. //
  918. // Interface for Multiple Monitor Configurations
  919. //
  920. #define MD_PRIMARY 0x00000001
  921. #define MD_ATTACHED 0x00000002
  922. #include <pshpack8.h>
  923. typedef struct _MonitorData
  924. {
  925. DWORD dwSize;
  926. DWORD dwFlags;
  927. DWORD dwStatus;
  928. RECT rcPos;
  929. } MonitorData, * LPMONITORDATA;
  930. #include <poppack.h> /* Return to byte packing */
  931. #undef INTERFACE
  932. #define INTERFACE IMultiMonConfig
  933. DECLARE_INTERFACE_( IMultiMonConfig, IUnknown )
  934. {
  935. // *** IUnknown methods ***
  936. STDMETHOD (QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  937. STDMETHOD_(ULONG, AddRef) ( THIS ) PURE;
  938. STDMETHOD_(ULONG, Release) ( THIS ) PURE;
  939. // *** IMultiMonConfig methods ***
  940. STDMETHOD ( Initialize ) ( THIS_ HWND hwndHost, WNDPROC WndProc, DWORD dwReserved) PURE;
  941. STDMETHOD ( GetNumberOfMonitors ) (THIS_ int * pCMon, DWORD dwReserved) PURE;
  942. STDMETHOD ( GetMonitorData) (THIS_ int iMonitor, MonitorData * pmd, DWORD dwReserved) PURE;
  943. STDMETHOD ( Paint) (THIS_ int iMonitor, DWORD dwReserved) PURE;
  944. };
  945. typedef IMultiMonConfig * LPMULTIMONCONFIG;
  946. #endif // _WIN32_IE > 0x0400
  947. //// IRestrict
  948. // For the pdwRestrictionResult out parameter in IRestrict::IsRestricted() for
  949. // all pguidIDs.
  950. typedef enum
  951. {
  952. RR_ALLOW = 1,
  953. RR_DISALLOW,
  954. RR_NOCHANGE,
  955. } RESTRICTION_RESULT;
  956. // IRestrict::IsRestricted() dwRestrictAction parameter values for
  957. // the RID_RDeskBars pguidID.
  958. typedef enum
  959. {
  960. RA_DRAG = 1,
  961. RA_DROP,
  962. RA_ADD,
  963. RA_CLOSE,
  964. RA_MOVE,
  965. } RESTRICT_ACTIONS;
  966. #undef INTERFACE
  967. #define INTERFACE IRestrict
  968. DECLARE_INTERFACE_(IRestrict, IUnknown)
  969. {
  970. // *** IUnknown methods ***
  971. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  972. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  973. STDMETHOD_(ULONG,Release) (THIS) PURE;
  974. // *** IRestrict Methods ***
  975. STDMETHOD(IsRestricted) (THIS_ const GUID * pguidID, DWORD dwRestrictAction, VARIANT * pvarArgs, OUT DWORD * pdwRestrictionResult) PURE;
  976. };
  977. //// IAddressBand
  978. #define OLECMD_REFRESH_TOPMOST 0x00000000
  979. #define OLECMD_REFRESH_ENTIRELIST 0x00000001
  980. #undef INTERFACE
  981. #define INTERFACE IAddressBand
  982. DECLARE_INTERFACE_(IAddressBand, IUnknown)
  983. {
  984. // *** IUnknown methods ***
  985. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  986. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  987. STDMETHOD_(ULONG,Release) (THIS) PURE;
  988. // *** IAddressBand Methods ***
  989. STDMETHOD(FileSysChange) (THIS_ DWORD dwEvent, LPCITEMIDLIST * ppidl1) PURE;
  990. STDMETHOD(Refresh) (THIS_ VARIANT * pvarType) PURE;
  991. };
  992. #undef INTERFACE
  993. #define INTERFACE IAddressEditBox
  994. // Init Flags
  995. #define AEB_INIT_DEFAULT 0x00000000
  996. #define AEB_INIT_NOSHELL 0x00000001
  997. #define AEB_INIT_NOWEB 0x00000002
  998. #define AEB_INIT_NOFILE 0x00000004
  999. #define AEB_INIT_AUTOEXEC 0x00000008 // Set if you want the item Navigated/ShellExeced when ENTER occurs.
  1000. #define AEB_INIT_SUBCLASS 0x00000010 // If set parent needs to pass HWND events thru IWinEventHandler::OnWinEvent()
  1001. #define AEB_INIT_NOASYNC 0x00000020 // Set if you don't want/support async navigation (from a modal dlg for instance)
  1002. // Parse Flags for IAddressEditBox::ParseNow()
  1003. #define SHURL_FLAGS_NONE 0x00000000
  1004. #define SHURL_FLAGS_NOUI 0x00000001 // Don't display any UI.
  1005. #define SHURL_FLAGS_NOSNS 0x00000002 // Ignore SHELL URLs. (FILE and Internet URLs still work)
  1006. #define SHURL_FLAGS_NOWEB 0x00000004 // Ignore WEB URLs. (Don't successfully parse if not found in shell name space)
  1007. #define SHURL_FLAGS_NOPATHSEARCH 0x00000008 // don't search on dos paths or app path
  1008. #define SHURL_FLAGS_AUTOCORRECT 0x00000010 // Try to autocorrect WEB URLs
  1009. // Exec Flags for IAddressEditBox::Execute()
  1010. #define SHURL_EXECFLAGS_NONE 0x00000000
  1011. #define SHURL_EXECFLAGS_SEPVDM 0x00000001 // If ShellExec(), set SEE_MASK_FLAG_SEPVDM fMask.
  1012. #define SHURL_EXECFLAGS_DONTFORCEIE 0x00000002 // If some browser other than IE is associated with HTML files, allow them to launch.
  1013. DECLARE_INTERFACE_(IAddressEditBox, IUnknown)
  1014. {
  1015. // *** IUnknown methods ***
  1016. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1017. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1018. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1019. // *** IAddressEditBox Methods ***
  1020. STDMETHOD(Init) (THIS_ HWND hwnd, HWND hwndEditBox, DWORD dwFlags, IUnknown * punkParent) PURE;
  1021. STDMETHOD(SetCurrentDir) (THIS_ LPCOLESTR pwzDir) PURE;
  1022. STDMETHOD(ParseNow) (THIS_ DWORD dwParseFlags) PURE;
  1023. STDMETHOD(Execute) (THIS_ DWORD dwExecFlags) PURE;
  1024. STDMETHOD(Save) (THIS_ DWORD dwReserved) PURE;
  1025. };
  1026. #if (_WIN32_IE >= 0x0400)
  1027. #define ISFB_MASK_ALL 0x0000003F //
  1028. #define ISFB_MASK_INVALID (~(ISFB_MASK_ALL)) //
  1029. //#define ISFB_STATE_NOTITLE 0x00000008 // obsolete! (use cbs::SetBandState)
  1030. #define ISFB_STATE_ALL 0x000001FF //
  1031. //-------------------------------------------------------------------------
  1032. //
  1033. // IWinEventHandler interface
  1034. //
  1035. // An object that wants to send messages to another object (typically
  1036. // a sub-object) QI's for the sub-object's IWinEventHandler interface.
  1037. // Once the object determines the hwnd is owned by the sub-object (via
  1038. // IsWindowOwner), the object calls OnWinEvent for send the message.
  1039. //
  1040. //
  1041. // [Member functions]
  1042. //
  1043. // IWinEventHandler::IsWindowOwner(hwnd)
  1044. // Returns S_OK if the hwnd is owned by the object, S_FALSE if not.
  1045. //
  1046. // IWinEventHandler::OnWinEvent(hwnd, dwMsg, wParam, lParam, plRet)
  1047. // Sends a message to the object. The Win32 return value (i.e., the
  1048. // value returned by DefWindowProc) is returned in *plRet. Return
  1049. // S_OK if the message is handled, otherwise S_FALSE.
  1050. //
  1051. //-------------------------------------------------------------------------
  1052. #undef INTERFACE
  1053. #define INTERFACE IWinEventHandler
  1054. DECLARE_INTERFACE_(IWinEventHandler, IUnknown)
  1055. {
  1056. // *** IUnknown methods ***
  1057. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1058. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1059. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1060. // *** IWinEventHandler Methods ***
  1061. STDMETHOD(OnWinEvent) (THIS_ HWND hwnd, UINT dwMsg, WPARAM wParam, LPARAM lParam, LRESULT* plres) PURE;
  1062. STDMETHOD(IsWindowOwner) (THIS_ HWND hwnd) PURE;
  1063. };
  1064. #endif // _WIN32_IE > 0x0400
  1065. //==========================================================================
  1066. // IExplorerToolbar interfaces
  1067. //
  1068. // This is an interface to the shell toolbar which allows shell views
  1069. // to add buttons and process.
  1070. // See http://ohserv/users/satona/toolbar_extension.htm for spec.
  1071. //
  1072. //==========================================================================
  1073. // Bitmap types
  1074. #define BITMAP_NORMAL 0x1
  1075. #define BITMAP_HOT 0x2
  1076. #define BITMAP_DISABLED 0x3
  1077. // Band Visibility Flags
  1078. #define VBF_TOOLS 0x00000001
  1079. #define VBF_ADDRESS 0x00000002
  1080. #define VBF_LINKS 0x00000004
  1081. #define VBF_BRAND 0x00000008
  1082. #define VBF_MENU 0x00000010
  1083. #define VBF_ONELINETEXT 0x00000020
  1084. #define VBF_TWOLINESTEXT 0x00000040
  1085. #define VBF_NOCUSTOMIZE 0x00000080
  1086. #define VBF_EXTERNALBANDS 0xFFFF0000
  1087. #define VBF_VALID (VBF_TOOLS | VBF_ADDRESS | VBF_LINKS | VBF_BRAND | VBF_MENU | VBF_EXTERNALBANDS)
  1088. #undef INTERFACE
  1089. #define INTERFACE IExplorerToolbar
  1090. typedef enum {
  1091. ETCMDID_GETBUTTONS = 0x0001,
  1092. ETCMDID_NEWCOMMANDTARGET = 0x0002, // sent to the previous command target when a new one is coming in
  1093. #if (_WIN32_IE >= 0x500)
  1094. ETCMDID_RELOADBUTTONS = 0x0003, // command target needs to call AddButtons again
  1095. #endif
  1096. } ENUM_ETCMDID;
  1097. DECLARE_INTERFACE_(IExplorerToolbar, IUnknown)
  1098. {
  1099. // *** IUnknown methods ***
  1100. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1101. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1102. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1103. // *** IExplorerToolbar methods ***
  1104. STDMETHOD(SetCommandTarget) (THIS_ IUnknown* punkCmdTarget, const GUID* pguidCmdGrp, DWORD dwFlags) PURE;
  1105. STDMETHOD(AddStdBrowserButtons) (THIS) PURE;
  1106. // Wrap of the TB_* messages the messages that are implmented
  1107. // are just the ones to add delete and modify the buttons, and not
  1108. // the ones to manipulate the toolbar.
  1109. STDMETHOD(AddButtons) (THIS_ const GUID * pguidButtonGroup, UINT nButtons, const TBBUTTON * lpButtons) PURE;
  1110. STDMETHOD(AddString) (THIS_ const GUID * pguidButtonGroup, HINSTANCE hInst, UINT_PTR uiResID, LRESULT * pOffset) PURE;
  1111. STDMETHOD(GetButton) (THIS_ const GUID * pguidButtonGroup, UINT uiCommand, LPTBBUTTON lpButton) PURE;
  1112. STDMETHOD(GetState) (THIS_ const GUID * pguidButtonGroup, UINT uiCommand, UINT * pfState) PURE;
  1113. STDMETHOD(SetState) (THIS_ const GUID * pguidButtonGroup, UINT uiCommand, UINT fState) PURE;
  1114. STDMETHOD(AddBitmap) (THIS_ const GUID * pguidButtonGroup, UINT uiBMPType, UINT uiCount, TBADDBITMAP * ptb,
  1115. LRESULT * pOffset, COLORREF rgbMask) PURE;
  1116. STDMETHOD(GetBitmapSize) (THIS_ UINT * uiID) PURE;
  1117. STDMETHOD(SendToolbarMsg) (THIS_ const GUID * pguidButtonGroup, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT * plRes) PURE;
  1118. STDMETHOD(SetImageList) (THIS_ const GUID* pguidCmdGroup, HIMAGELIST himlNormal, HIMAGELIST himlHot, HIMAGELIST himlDisabled) PURE;
  1119. STDMETHOD(ModifyButton) (THIS_ const GUID * pguidButtonGroup, UINT uiCommand, LPTBBUTTON lpButton) PURE;
  1120. };
  1121. //==========================================================================
  1122. // DefView supports a private service id for extended views.
  1123. // DefView's IOleCommandTarget supports the below command group and ids too.
  1124. //==========================================================================
  1125. // SID_DefView and CGID_DefView are defined in shlguid.w
  1126. //
  1127. #define DVCMDID_GETTHISDIRPATH 1 // pvaOut = path to this directory (if in filesystem)
  1128. #define DVCMDID_GETTHISDIRNAME 2 // pvaOut = friendly name of this directory
  1129. #define DVCMDID_GETTEMPLATEDIRNAME 3 // pvaOut = webview template (.htt) dir
  1130. #define IS_ADJUSTLISTVIEW 0x80000000
  1131. #define IS_INTERNALDUMMYBIT 0x40000000
  1132. #define IS_VALIDINTERNALBITS (IS_ADJUSTLISTVIEW | IS_INTERNALDUMMYBIT)
  1133. #define CFSTR_SHELLIDLISTP TEXT("Shell IDLData Private")
  1134. #define CFSTR_SHELLCOPYDATA TEXT("Shell Copy Data")
  1135. #define CFSTR_DROPEFFECTFOLDERLIST TEXT("DropEffectFolderList")
  1136. //
  1137. // Win 3.1 style HDROP
  1138. //
  1139. // Notes: Our API works only if pFiles == sizeof(DROPFILES16)
  1140. //
  1141. typedef struct _DROPFILES16 {
  1142. WORD pFiles; // offset to double null list of files
  1143. POINTS pt; // drop point (client coords)
  1144. WORD fNC; // is it on non client area
  1145. // and pt is in screen coords
  1146. } DROPFILES16, * LPDROPFILES16;
  1147. //
  1148. // format of CF_SHELLCOPYDATA
  1149. //
  1150. typedef struct _SHELLCOPYDATA {
  1151. DWORD dwEffect; // Intended effect
  1152. } SHELLCOPYDATA;
  1153. //
  1154. // CFSTR_DROPEFFECTFOLDERLIST defines the drop effects to certain folders
  1155. // this is applied when dropping to a file system folder.
  1156. //
  1157. typedef struct {
  1158. DWORD dwDropEffect;
  1159. WCHAR wszPath[MAX_PATH];
  1160. } DROPEFFECTFOLDER;
  1161. typedef struct {
  1162. DWORD dwDefaultDropEffect; // default drop effect (==0 for current behaviour)
  1163. INT cFolders; // number of folders in the list
  1164. DROPEFFECTFOLDER aFolders[1];
  1165. } DROPEFFECTFOLDERLIST;
  1166. //------ See shelldll\fsnotify.c for function descriptions. ----------
  1167. //
  1168. // Definition of the function type to be called by the notification
  1169. // service when a file the client has registered to monitor changes.
  1170. //
  1171. // DOC'ed for DOJ compliance:
  1172. #define SHCNRF_InterruptLevel 0x0001
  1173. #define SHCNRF_ShellLevel 0x0002
  1174. // If the caller passes SHCNRF_RecursiveInterrupt (meaning that they want interrupt events on the whole
  1175. // subtree), then they must also pass SHCNRF_InterruptLevel flag (duh), and they must be a recursive (eg
  1176. // fRecursive == TRUE) type notification.
  1177. #define SHCNRF_RecursiveInterrupt 0x1000
  1178. #define SHCNRF_ResumeThread 0x2000
  1179. #define SHCNRF_CreateSuspended 0x4000
  1180. #define SHCNRF_NewDelivery 0x8000
  1181. // !! WARNING !!
  1182. // If you change/add any new SHCNE_ events, you will need
  1183. // to possibly modify the SHCNE_XXXXEVENTS masks that are
  1184. // defined below as well.
  1185. // NOTE: SHCNE_GLOBALEVENTS are typically used to pass
  1186. // non-pidl information (packed into pidl format). We cannot
  1187. // extend SHCNE_GLOBALEVENTS and expect clients of the new
  1188. // events to work on a down-level shell32. In fact, they
  1189. // may very well fault during psfDesktop->CompareIDs.
  1190. // So be careful when adding to this bitfield!
  1191. //
  1192. // Win95 and NT4 and IE4 shipped with 0x0C0581E0L.
  1193. // We use this event mask to tell if we need to possibly throw out a SHCNE_UPDATEDIR that was
  1194. // generated by the filesystem because we have a more specific event already in our queue.
  1195. // NOTE: only non-interrupt events could cause us to throw out a interrupt generated UPDATEDIR event.
  1196. #define SHCNE_UPDATEDIR_OVERRIDE_EVENTS 0x00023818L
  1197. // This event was defined early on in IE4 for the Theme Switcher to
  1198. // notify the shell that a system-wide update needed to happen.
  1199. // This has been removed but I don't want to re-use the id just yet...
  1200. //#define SHCNEE_THEMECHANGED 1L // The theme changed
  1201. #define SHCNEE_WININETCHANGED 3L // dwItem2 contains CACHE_NOTIFY_* bits
  1202. #if (_WIN32_IE >= 0x0500)
  1203. #define SHCNEE_PROMOTEDITEM 6L // pidl2 is the pidl of the Promoted item
  1204. #define SHCNEE_DEMOTEDITEM 7L // pidl2 is the pidl of the demoted item
  1205. #define SHCNEE_ALIASINUSE 8L // some alias style folder is now being used
  1206. #endif
  1207. #if (_WIN32_IE >= 0x0600)
  1208. #define SHCNEE_SHORTCUTINVOKE 9L // an app has been launched via a shortcut
  1209. // pidl1 = SHShortcutInvokeAsIDList, pidl2=unused
  1210. #define SHCNEE_PINLISTCHANGED 10L // a change was made to the pin list
  1211. // pidl1 = SHChangeDWORDAsIDList, pidl2=unused
  1212. #define SHCNEE_USERINFOCHANGED 11L // A user picture was updated. pidl1 = SHChangeDWORDAsIDList, pidl2=unused
  1213. #define SHCNEE_UPDATEFOLDERLOCATION 12L // a special folder changed pidl1 = {SHChangeDWORDAsIDList, csidlFolder}, pidl2=unused
  1214. #endif
  1215. // Update types for the UpdateEntryList api
  1216. #define SHCNNU_SET 1 // Set the notify list to passed in list
  1217. #define SHCNNU_ADD 2 // Add the items to the current list
  1218. #define SHCNNU_REMOVE 3 // Remove the items from the current list
  1219. #define SHCNF_PRINTJOBA 0x0004 // dwItem1: printer name
  1220. // dwItem2: SHCNF_PRINTJOB_DATA
  1221. #define SHCNF_PRINTJOBW 0x0007 // dwItem1: printer name
  1222. // dwItem2: SHCNF_PRINTJOB_DATA
  1223. #define SHCNF_INSTRUMENT 0x0080 // dwItem1: LPSHCNF_INSTRUMENT
  1224. #define SHCNF_TRANSLATEDALIAS 0x4000 // for internals to filter on
  1225. #define SHCNF_ONLYNOTIFYINTERNALS 0x8000 // only notify internal clients
  1226. #ifdef UNICODE
  1227. #define SHCNF_PRINTJOB SHCNF_PRINTJOBW
  1228. #else
  1229. #define SHCNF_PRINTJOB SHCNF_PRINTJOBA
  1230. #endif
  1231. typedef struct tagSHCNF_PRINTJOB_DATA {
  1232. DWORD JobId;
  1233. DWORD Status;
  1234. DWORD TotalPages;
  1235. DWORD Size;
  1236. DWORD PagesPrinted;
  1237. } SHCNF_PRINTJOB_DATA, *LPSHCNF_PRINTJOB_DATA;
  1238. //
  1239. // This is all the INSTRUMENTation stuff...
  1240. // make this look like an ITEMIDLIST (uOffset points to 0 uTerm)
  1241. #include <pshpack1.h>
  1242. typedef struct tagSHCNF_INSTRUMENT {
  1243. USHORT uOffset;
  1244. USHORT uAlign;
  1245. DWORD dwEventType;
  1246. DWORD dwEventStructure;
  1247. SYSTEMTIME st;
  1248. union tagEvents {
  1249. struct tagSTRING {
  1250. TCHAR sz[32];
  1251. } string;
  1252. struct tagHOTKEY {
  1253. WPARAM wParam;
  1254. } hotkey;
  1255. struct tagWNDPROC {
  1256. HWND hwnd;
  1257. UINT uMsg;
  1258. WPARAM wParam;
  1259. LPARAM lParam;
  1260. } wndproc;
  1261. struct tagCOMMAND {
  1262. HWND hwnd;
  1263. UINT idCmd;
  1264. } command;
  1265. struct tagDROP {
  1266. HWND hwnd;
  1267. UINT idCmd;
  1268. // TCHAR sz[32]; // convert pDataObject into something we can log
  1269. } drop;
  1270. } e;
  1271. USHORT uTerm;
  1272. } SHCNF_INSTRUMENT_INFO, * LPSHCNF_INSTRUMENT_INFO;
  1273. #include <poppack.h>
  1274. #define SHCNFI_EVENT_STATECHANGE 0 // dwEventType
  1275. #define SHCNFI_EVENT_STRING 1 // e.string
  1276. #define SHCNFI_EVENT_HOTKEY 2 // e.hotkey
  1277. #define SHCNFI_EVENT_WNDPROC 3 // e.wndproc
  1278. #define SHCNFI_EVENT_WNDPROC_HOOK 4 // e.wndproc
  1279. #define SHCNFI_EVENT_ONCOMMAND 5 // e.command
  1280. #define SHCNFI_EVENT_INVOKECOMMAND 6 // e.command
  1281. #define SHCNFI_EVENT_TRACKPOPUPMENU 7 // e.command
  1282. #define SHCNFI_EVENT_DROP 8 // e.drop
  1283. #define SHCNFI_EVENT_MAX 9
  1284. #define SHCNFI_STRING_SHOWEXTVIEW 0
  1285. #define SHCNFI_STATE_KEYBOARDACTIVE 0 // _KEYBOARDACTIVE or _MOUSEACTIVE
  1286. #define SHCNFI_STATE_MOUSEACTIVE 1 // _KEYBOARDACTIVE or _MOUSEACTIVE
  1287. #define SHCNFI_STATE_ACCEL_TRAY 2 // _ACCEL_TRAY or _ACCEL_DESKTOP
  1288. #define SHCNFI_STATE_ACCEL_DESKTOP 3 // _ACCEL_TRAY or _ACCEL_DESKTOP
  1289. #define SHCNFI_STATE_START_DOWN 4 // _START_DOWN or _START_UP
  1290. #define SHCNFI_STATE_START_UP 5 // _START_DOWN or _START_UP
  1291. #define SHCNFI_STATE_TRAY_CONTEXT 6
  1292. #define SHCNFI_STATE_TRAY_CONTEXT_CLOCK 7
  1293. #define SHCNFI_STATE_TRAY_CONTEXT_START 8
  1294. #define SHCNFI_STATE_DEFVIEWX_ALT_DBLCLK 9
  1295. #define SHCNFI_STATE_DEFVIEWX_SHIFT_DBLCLK 10
  1296. #define SHCNFI_STATE_DEFVIEWX_DBLCLK 11
  1297. #define SHCNFI_GLOBALHOTKEY 0
  1298. #define SHCNFI_CABINET_WNDPROC 0
  1299. #define SHCNFI_DESKTOP_WNDPROC 1
  1300. #define SHCNFI_PROXYDESKTOP_WNDPROC 2
  1301. #define SHCNFI_TRAY_WNDPROC 3
  1302. #define SHCNFI_DRIVES_WNDPROC 4
  1303. #define SHCNFI_ONETREE_WNDPROC 5
  1304. #define SHCNFI_MAIN_WNDPROC 6
  1305. #define SHCNFI_FOLDEROPTIONS_DLGPROC 7
  1306. #define SHCNFI_VIEWOPTIONS_DLGPROC 8
  1307. #define SHCNFI_FT_DLGPROC 9
  1308. #define SHCNFI_FTEdit_DLGPROC 10
  1309. #define SHCNFI_FTCmd_DLGPROC 11
  1310. #define SHCNFI_TASKMAN_DLGPROC 12
  1311. #define SHCNFI_TRAYVIEWOPTIONS_DLGPROC 13
  1312. #define SHCNFI_INITSTARTMENU_DLGPROC 14
  1313. #define SHCNFI_PRINTERQUEUE_DLGPROC 15
  1314. #define SHCNFI_CABINET_ONCOMMAND 0
  1315. #define SHCNFI_TRAYCOMMAND 1
  1316. #define SHCNFI_BITBUCKET_DFM_INVOKE 0
  1317. #define SHCNFI_BITBUCKET_FNV_INVOKE 1
  1318. #define SHCNFI_BITBUCKET_INVOKE 2
  1319. #define SHCNFI_BITBUCKETBG_DFM_INVOKE 3
  1320. #define SHCNFI_CONTROLS_DFM_INVOKE 4
  1321. #define SHCNFI_CONTROLS_FNV_INVOKE 5
  1322. #define SHCNFI_CONTROLSBG_DFM_INVOKE 6
  1323. #define SHCNFI_DEFFOLDER_DFM_INVOKE 7
  1324. #define SHCNFI_DEFFOLDER_INVOKE 8
  1325. #define SHCNFI_FINDEXT_INVOKE 9
  1326. #define SHCNFI_DEFFOLDER_FNV_INVOKE 10
  1327. #define SHCNFI_DRIVESBG_DFM_INVOKE 11
  1328. #define SHCNFI_DRIVES_FNV_INVOKE 12
  1329. #define SHCNFI_DRIVES_DFM_INVOKE 13
  1330. #define SHCNFI_FOLDERBG_DFM_INVOKE 14
  1331. #define SHCNFI_FOLDER_FNV_INVOKE 15
  1332. #define SHCNFI_FOLDER_DFM_INVOKE 16
  1333. #define SHCNFI_NETWORKBG_DFM_INVOKE 17
  1334. #define SHCNFI_NETWORK_FNV_INVOKE 18
  1335. #define SHCNFI_NETWORK_DFM_INVOKE 19
  1336. #define SHCNFI_NETWORKPRINTER_DFM_INVOKE 20
  1337. #define SHCNFI_DESKTOPBG_DFM_INVOKE 21
  1338. #define SHCNFI_DESKTOP_DFM_INVOKE 22
  1339. #define SHCNFI_DESKTOP_FNV_INVOKE 23
  1340. #define SHCNFI_PRINTERS_DFM_INVOKE 24
  1341. #define SHCNFI_PRINTERSBG_DFM_INVOKE 25
  1342. #define SHCNFI_PRINTERS_FNV_INVOKE 26
  1343. #define SHCNFI_DEFVIEWX_INVOKE 27
  1344. #define SHCNFI_FOLDER_DROP 0
  1345. #define SHCNFI_PRINTQUEUE_DROP 1
  1346. #define SHCNFI_DEFVIEWX_TPM 2
  1347. #define SHCNFI_DROP_EXE_TPM 3
  1348. #define SHCNFI_IDLDT_TPM 4
  1349. #define SHCNFI_DROP_BITBUCKET 0
  1350. #define SHCNFI_DROP_PRINTFOLDER 1
  1351. #define SHCNFI_DROP_PRINTER 2
  1352. #define SHCNFI_DROP_RUN 3
  1353. #define SHCNFI_DROP_SHELLLINK 4
  1354. #define SHCNFI_DROP_DRIVES 5
  1355. #define SHCNFI_DROP_FS 6
  1356. #define SHCNFI_DROP_EXE 7
  1357. #define SHCNFI_DROP_NETROOT 8
  1358. #define SHCNFI_DROP_PRINTQUEUE 9
  1359. #define SHCNFI_DROP_BRIEFCASE 10
  1360. #ifdef WANT_SHELL_INSTRUMENTATION
  1361. #define INSTRUMENT_STATECHANGE(t) \
  1362. { \
  1363. SHCNF_INSTRUMENT_INFO s; \
  1364. s.dwEventType=(t); \
  1365. s.dwEventStructure=SHCNFI_EVENT_STATECHANGE; \
  1366. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \
  1367. }
  1368. #define INSTRUMENT_STRING(t,p) \
  1369. { \
  1370. SHCNF_INSTRUMENT_INFO s; \
  1371. s.dwEventType=(t); \
  1372. s.dwEventStructure=SHCNFI_EVENT_STRING; \
  1373. lstrcpyn(s.e.string.sz,(p),ARRAYSIZE(s.e.string.sz)); \
  1374. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \
  1375. }
  1376. #define INSTRUMENT_HOTKEY(t,w) \
  1377. { \
  1378. SHCNF_INSTRUMENT_INFO s; \
  1379. s.dwEventType=(t); \
  1380. s.dwEventStructure=SHCNFI_EVENT_HOTKEY; \
  1381. s.e.hotkey.wParam=(w); \
  1382. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \
  1383. }
  1384. #define INSTRUMENT_WNDPROC(t,h,u,w,l) \
  1385. { \
  1386. SHCNF_INSTRUMENT_INFO s; \
  1387. s.dwEventType=(t); \
  1388. s.dwEventStructure=SHCNFI_EVENT_WNDPROC; \
  1389. s.e.wndproc.hwnd=(h); \
  1390. s.e.wndproc.uMsg=(u); \
  1391. s.e.wndproc.wParam=(w); \
  1392. s.e.wndproc.lParam=(l); \
  1393. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \
  1394. }
  1395. #define INSTRUMENT_WNDPROC_HOOK(h,u,w,l) \
  1396. { \
  1397. SHCNF_INSTRUMENT_INFO s; \
  1398. s.dwEventType=0; \
  1399. s.dwEventStructure=SHCNFI_EVENT_WNDPROC_HOOK; \
  1400. s.e.wndproc.hwnd=(h); \
  1401. s.e.wndproc.uMsg=(u); \
  1402. s.e.wndproc.wParam=(w); \
  1403. s.e.wndproc.lParam=(l); \
  1404. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \
  1405. }
  1406. #define INSTRUMENT_ONCOMMAND(t,h,u) \
  1407. { \
  1408. SHCNF_INSTRUMENT_INFO s; \
  1409. s.dwEventType=(t); \
  1410. s.dwEventStructure=SHCNFI_EVENT_ONCOMMAND; \
  1411. s.e.command.hwnd=(h); \
  1412. s.e.command.idCmd=(u); \
  1413. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \
  1414. }
  1415. #define INSTRUMENT_INVOKECOMMAND(t,h,u) \
  1416. { \
  1417. SHCNF_INSTRUMENT_INFO s; \
  1418. s.dwEventType=(t); \
  1419. s.dwEventStructure=SHCNFI_EVENT_INVOKECOMMAND; \
  1420. s.e.command.hwnd=(h); \
  1421. s.e.command.idCmd=(u); \
  1422. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \
  1423. }
  1424. #define INSTRUMENT_TRACKPOPUPMENU(t,h,u) \
  1425. { \
  1426. SHCNF_INSTRUMENT_INFO s; \
  1427. s.dwEventType=(t); \
  1428. s.dwEventStructure=SHCNFI_EVENT_TRACKPOPUPMENU; \
  1429. s.e.command.hwnd=(h); \
  1430. s.e.command.idCmd=(u); \
  1431. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \
  1432. }
  1433. #define INSTRUMENT_DROP(t,h,u,p) \
  1434. { \
  1435. SHCNF_INSTRUMENT_INFO s; \
  1436. s.dwEventType=(t); \
  1437. s.dwEventStructure=SHCNFI_EVENT_DROP; \
  1438. s.e.drop.hwnd=(h); \
  1439. s.e.drop.idCmd=(u); \
  1440. SHChangeNotify(SHCNE_INSTRUMENT,SHCNF_INSTRUMENT,&s,NULL); \
  1441. }
  1442. #else
  1443. #define INSTRUMENT_STATECHANGE(t)
  1444. #define INSTRUMENT_STRING(t,p)
  1445. #define INSTRUMENT_HOTKEY(t,w)
  1446. #define INSTRUMENT_WNDPROC(t,h,u,w,l)
  1447. #define INSTRUMENT_WNDPROC_HOOK(h,u,w,l)
  1448. #define INSTRUMENT_ONCOMMAND(t,h,u)
  1449. #define INSTRUMENT_INVOKECOMMAND(t,h,u)
  1450. #define INSTRUMENT_TRACKPOPUPMENU(t,h,u)
  1451. #define INSTRUMENT_DROP(t,h,u,p)
  1452. #endif //WANT_SHELL_INSTRUMENTATION
  1453. //
  1454. //
  1455. // IQueryCodePage
  1456. //
  1457. #undef INTERFACE
  1458. #define INTERFACE IQueryCodePage
  1459. DECLARE_INTERFACE_(IQueryCodePage, IUnknown)
  1460. {
  1461. // *** IUnknown methods ***
  1462. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1463. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1464. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1465. // *** IQueryCodePage methods ***
  1466. STDMETHOD(GetCodePage)(THIS_ UINT * puiCodePage) PURE;
  1467. STDMETHOD(SetCodePage)(THIS_ UINT uiCodePage) PURE;
  1468. } ;
  1469. SHSTDAPI_(void) SHWaitOp_Operate(HANDLE hWaitOp, DWORD dwProcId);
  1470. // DOC'ed for DOJ compliance:
  1471. #if (_WIN32_IE >= 0x0400)
  1472. // Use this instead of SHChangeDWORDAsIDList for SHCNEE_ORDERCHANGED
  1473. // SHCNEE_PROMOTEDITEM and SHCNEE_DEMOTEDITEM
  1474. //
  1475. // When filling in the pSender, cast LPVOID directly to INT64.
  1476. // Do not cast through DWORD_PTR because that will not sign extend
  1477. // properly on Win32.
  1478. typedef struct _SHChangeMenuAsIDList {
  1479. USHORT cb;
  1480. DWORD dwItem1; // SHCNEE_EXTENDED_EVENT requires this
  1481. // pSender must appear immediately after dwItem1 for IE5.0 compat
  1482. INT64 pSender; // address of sender (64-bit for Win64)
  1483. DWORD dwProcessID; // pid of sender
  1484. USHORT cbZero;
  1485. } SHChangeMenuAsIDList, * LPSHChangeMenuAsIDList;
  1486. //DOC'ed for DOJ compliance:
  1487. typedef struct _SHShortcutInvokeAsIDList {
  1488. USHORT cb;
  1489. DWORD dwItem1; // SHCNEE_EXTENDED_EVENT requires this
  1490. DWORD dwPid; // PID of target application
  1491. WCHAR szShortcutName[MAX_PATH]; // Path to shortcut
  1492. WCHAR szTargetName[MAX_PATH]; // Path to target application
  1493. USHORT cbZero;
  1494. } SHShortcutInvokeAsIDList, *LPSHShortcutInvokeAsIDList;
  1495. #endif /* _WIN32_IE */
  1496. #define SHChangeNotifyHandleEvents() SHChangeNotify(0, SHCNF_FLUSH, NULL, NULL)
  1497. // DOC'ed for DOJ compliance
  1498. #define SHChangeNotifyRegisterORD 2
  1499. // DOC'ed for DOJ compliance
  1500. #define SHChangeNotifyDeregisterORD 4
  1501. SHSTDAPI_(BOOL) SHChangeNotifyUpdateEntryList(unsigned long ulID, int iUpdateType, int cEntries, SHChangeNotifyEntry *pshcne);
  1502. SHSTDAPI_(void) SHChangeNotifyReceive(LONG lEvent, UINT uFlags, LPCITEMIDLIST pidl, LPCITEMIDLIST pidlExtra);
  1503. SHSTDAPI_(BOOL) SHChangeRegistrationReceive(HANDLE hChangeNotification, DWORD dwProcId);
  1504. SHSTDAPI_(void) SHChangeNotifyDeregisterWindow(HWND hwnd);
  1505. SHSTDAPI_(LRESULT) SHChangeNotifySuspendResumeReceive(WPARAM wParam, LPARAM lParam);
  1506. SHSTDAPI_(BOOL) SHChangeNotifySuspendResume(BOOL bSuspend, LPITEMIDLIST pidlSuspend, BOOL bRescursive, DWORD dwReserved);
  1507. typedef HANDLE LPSHChangeNotificationLock;
  1508. // DOC'ed for DOJ compliance
  1509. // END Internal SHChangeNotify HELPERS
  1510. // DOC'ed for DOJ compliance
  1511. #ifndef NOOCHOST // {
  1512. //
  1513. // ====== OCHOST CONTROL ==========================================
  1514. //
  1515. // The following are all definations of structures, windows messages needed for OCHOST,
  1516. // the window control you can use to host an OC.
  1517. // To use OCHOST, you must specify the window class as OCHOST_CLASS or "OCHOST"
  1518. // -- To Create and initialize OCHOST:
  1519. // 1. CreateWindow with window title = the string version of class id or the OC
  1520. // 2. CreateWindow with a pointer to the OCHINITSTRUCT structure as the last parameter
  1521. // you must allocate and initialize the OCHINITSTRUCT structure
  1522. // 3. CreateWindow with no title and the last param == NULL, then use the OCM_INITIALIZE message
  1523. // or the OCHost_InitOC macro to initialize it.
  1524. // 4. Use OCM_QUERYINTERFACE to QI an interface pointer from the OC.
  1525. // 5. Simply destroy the window when you exit.
  1526. // SHDRC -- Shell Doc Register Classes
  1527. typedef struct _SHDRC {
  1528. DWORD cbSize; // size of this structure in bytes
  1529. DWORD dwFlags; // SHDRCF_ flags
  1530. } SHDRC;
  1531. #define SHDRCF_OCHOST 0x0001 // Register the OCHOST_CLASS window
  1532. #define SHDRCF_ALL 0x0001 //
  1533. SHDOCAPI_(BOOL) DllRegisterWindowClasses(const SHDRC * pshdrc);
  1534. BROWSEUIAPI_(BOOL) InitOCHostClass(const SHDRC *pshdrc);
  1535. #define OCHOST_CLASSA "OCHost"
  1536. #define OCHOST_CLASSW L"OCHost"
  1537. #ifdef UNICODE
  1538. #define OCHOST_CLASS OCHOST_CLASSW
  1539. #else
  1540. #define OCHOST_CLASS OCHOST_CLASSA
  1541. #endif
  1542. // ------------------- Window messages for OC Host --------------------
  1543. // IUnknown::QueryInterface the hosted OC
  1544. typedef struct _QIMSG {
  1545. const IID * qiid;
  1546. void **ppvObject;
  1547. } QIMSG, *LPQIMSG;
  1548. // ................. Query Interface Message ..........
  1549. #define OCM_QUERYINTERFACE (WM_USER+0)
  1550. #ifdef __cplusplus
  1551. inline HRESULT OCHost_QueryInterface(HWND hwndOCH, REFIID riid, void **ppv) \
  1552. { QIMSG qimsg = {&riid, ppv}; \
  1553. return (HRESULT)SNDMSG((hwndOCH), OCM_QUERYINTERFACE, (WPARAM)sizeof(qimsg), (LPARAM)&qimsg); \
  1554. }
  1555. #else
  1556. #define OCHost_QueryInterface(hwndOCH, riid, ppv) \
  1557. { QIMSG qimsg = {&riid, ppv}; \
  1558. SNDMSG((hwndOCH), OCM_QUERYINTERFACE, (WPARAM)sizeof(qimsg), (LPARAM)&qimsg); \
  1559. }
  1560. #endif
  1561. // ------------------- OC Initialization Structure ---------------------
  1562. // This is intended to be passed in as the lParam of the OCM_INITOC message
  1563. typedef struct _OCHINITSTRUCT {
  1564. UINT cbSize; // size of this structure
  1565. CLSID clsidOC; // class ID of the OC
  1566. IUnknown * punkOwner; // owner of OCHOST
  1567. } OCHINITSTRUCT, *LPOCHINITSTRUCT;
  1568. //--------------------------------------------------------------------
  1569. // ................ Initialize and activate the OC ...............
  1570. #define OCM_INITIALIZE (WM_USER+1)
  1571. #define OCM_INITOC OCM_INITIALIZE
  1572. #define OCHost_InitOC(hwndOCH, lpOCS) \
  1573. (HRESULT)SNDMSG((hwndOCH), OCM_INITOC, 0, (LPARAM)lpOCS)
  1574. // ............... give ochost a parent IUnknown .......
  1575. #define OCM_SETOWNER (WM_USER+2)
  1576. #define OCHost_SetOwner(hwndOC, punk) \
  1577. (HRESULT)SNDMSG((hwndOC), OCM_SETOWNER, 0, (LPARAM)(IUnknown*)(punk))
  1578. // ............... DoVerb the OC .......
  1579. // n.b. iVerb is technically a long, WPARAM might truncate it
  1580. #define OCM_DOVERB (WM_USER+3)
  1581. #define OCHost_DoVerb(hwndOC, iVerb, lpMsg) \
  1582. (HRESULT)SNDMSG((hwndOC), OCM_DOVERB, (WPARAM)iVerb, (LPARAM)lpMsg)
  1583. //.................Enable/Disable OC event notifications
  1584. #define OCM_ENABLEEVENTS (WM_USER+4)
  1585. // WPARAM: TRUE to enable event notifications, FALSE to disable.
  1586. // returns: TRUE if successful, otherwise FALSE.
  1587. // Event notification is in the form of a WM_NOTIFY with
  1588. // code OCN_OCEVENT and an NMOCEVENT block.
  1589. #define OCHost_EnableEvents(hwndOC, bEnable) \
  1590. (BOOL)SNDMSG((hwndOC), OCM_ENABLEEVENTS, (WPARAM)bEnable, 0L)
  1591. #define OCM_SETSERVICEPROVIDER (WM_USER+5)
  1592. // LPARAM: IServiceProvider* pSP.
  1593. // This message sets a service provider for SID_OleClientSite delegation.
  1594. // Currently, OCHost will just call this guy with (SID_OleClientSite, IDispatch)
  1595. // and the client-implemented service provider can return an IDispatch to
  1596. // handle ambient properties.
  1597. #define OCHost_SetServiceProvider(hwndOC, pSP) \
  1598. (BOOL)SNDMSG((hwndOC), OCM_SETSERVICEPROVIDER, 0L, (LPARAM) pSP)
  1599. // ------------------ Window Notify messages from OC Host --------------
  1600. #define OCN_FIRST 0x1300
  1601. #define OCN_COCREATEINSTANCE (OCN_FIRST + 1)
  1602. typedef struct _OCNCOCREATEMSG {
  1603. NMHDR nmhdr;
  1604. CLSID clsidOC;
  1605. IUnknown ** ppunk;
  1606. } OCNCOCREATEMSG, *LPOCNCOCREATEMSG;
  1607. // NOTE: return values are defined as the following
  1608. // If the handler of OCN_COCREATEINSTANCE Notify message returns OCNCOCREATE_ALREADYCREATED,
  1609. // on return the (*ppvObj) is assumed to have the value of the OC's IUnkown pointer
  1610. #define OCNCOCREATE_CONTINUE 0
  1611. #define OCNCOCREATE_HANDLED -1
  1612. #define OCN_PERSISTINIT (OCN_FIRST + 2)
  1613. // NOTE: return values are defined as the following
  1614. // If the handler of OCN_PERSISTINIT Notify message returns OCNPERSIST_ABORT,
  1615. // the OCHOST will abort IPersist's initialization.
  1616. #define OCNPERSISTINIT_CONTINUE 0
  1617. #define OCNPERSISTINIT_HANDLED -1
  1618. // The return value on the following notify messages are ignored.
  1619. #define OCN_ACTIVATE (OCN_FIRST + 3)
  1620. #define OCN_DEACTIVATE (OCN_FIRST + 4)
  1621. #define OCN_EXIT (OCN_FIRST + 5)
  1622. #define OCN_ONPOSRECTCHANGE (OCN_FIRST + 6)
  1623. typedef struct _OCNONPOSRECTCHANGEMSG {
  1624. NMHDR nmhdr;
  1625. LPCRECT prcPosRect;
  1626. } OCNONPOSRECTCHANGEMSG, *LPOCNONPOSRECTCHANGEMSG;
  1627. #define OCN_ONUIACTIVATE (OCN_FIRST + 7)
  1628. typedef struct _OCNONUIACTIVATEMSG {
  1629. NMHDR nmhdr;
  1630. IUnknown *punk;
  1631. } OCNONUIACTIVATEMSG, *LPOCNONUIACTIVATEMSG;
  1632. #define OCNONUIACTIVATE_HANDLED -1
  1633. #define OCN_ONSETSTATUSTEXT (OCN_FIRST + 8)
  1634. typedef struct _OCNONSETSTATUSTEXT {
  1635. NMHDR nmhdr;
  1636. LPCOLESTR pwszStatusText;
  1637. } OCNONSETSTATUSTEXTMSG, *LPOCNONSETSTATUSTEXTMSG;
  1638. #define OCN_OCEVENT (OCN_FIRST + 9)
  1639. // OC event notification block.
  1640. // Recipient should return nonzero if any outbound parameters were modified
  1641. // and should be returned to the ActiveX control object; otherwse zero.
  1642. // NOTE: Structure is not properly aligned. Already shipped so too late to fix
  1643. typedef struct tagNMOCEVENT
  1644. {
  1645. IN NMHDR hdr ;
  1646. IN DISPID dispID ;
  1647. IN IID iid ;
  1648. IN LCID lcid ;
  1649. IN WORD wFlags ;
  1650. IN OUT DISPPARAMS *pDispParams ;
  1651. OUT VARIANT *pVarResult ;
  1652. OUT EXCEPINFO *pExepInfo ;
  1653. OUT UINT *puArgErr ;
  1654. } NMOCEVENT, *PNMOCEVENT, *LPNMOCEVENT ;
  1655. #endif // NOOCHOST // }
  1656. //
  1657. // Access to shdocvw's active session count
  1658. //
  1659. enum SessionOp {
  1660. SESSION_QUERY = 0,
  1661. SESSION_INCREMENT,
  1662. SESSION_DECREMENT,
  1663. SESSION_INCREMENT_NODEFAULTBROWSERCHECK
  1664. };
  1665. long SetQueryNetSessionCount(enum SessionOp Op);
  1666. SHDOCAPI_(void) IEWriteErrorLog(const EXCEPTION_RECORD* pexr);
  1667. //
  1668. // Internal APIs Follow. NOT FOR PUBLIC CONSUMPTION.
  1669. //
  1670. // Errors shared in the shell
  1671. #define E_FILE_NOT_FOUND MAKE_SCODE(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND)
  1672. #define E_PATH_NOT_FOUND MAKE_SCODE(SEVERITY_ERROR, FACILITY_WIN32, ERROR_PATH_NOT_FOUND)
  1673. // Useful macros
  1674. #define ResultFromShort(i) MAKE_HRESULT(SEVERITY_SUCCESS, 0, (USHORT)(i))
  1675. #define ShortFromResult(r) (short)HRESULT_CODE(r)
  1676. #if (defined(UNICODE) && !defined(_X86_)) // all non-x86 systems require alignment
  1677. #ifndef ALIGNMENT_SCENARIO
  1678. #define ALIGNMENT_SCENARIO
  1679. #endif
  1680. #endif
  1681. #ifndef LPNTSTR_DEFINED
  1682. #define LPNTSTR_DEFINED
  1683. typedef UNALIGNED const WCHAR * LPNCWSTR;
  1684. typedef UNALIGNED WCHAR * LPNWSTR;
  1685. #ifdef UNICODE
  1686. #define LPNCTSTR LPNCWSTR
  1687. #define LPNTSTR LPNWSTR
  1688. #else
  1689. #define LPNCTSTR LPCSTR
  1690. #define LPNTSTR LPSTR
  1691. #endif
  1692. #endif // LPNTSTR_DEFINED
  1693. #define RFN_FIRST (0U-510U) // run file dialog notify
  1694. #define RFN_LAST (0U-519U)
  1695. //=======================================================================
  1696. // String constants for
  1697. // 1. Registration database keywords (prefix STRREG_)
  1698. // 2. Exported functions from handler dlls (prefix STREXP_)
  1699. // 3. .INI file keywords (prefix STRINI_)
  1700. // 4. Others (prefix STR_)
  1701. //=======================================================================
  1702. #define STRREG_SHELLUI TEXT("ShellUIHandler")
  1703. #define STRREG_SHELL TEXT("Shell")
  1704. #define STRREG_DEFICON TEXT("DefaultIcon")
  1705. #define STRREG_SHEX TEXT("shellex")
  1706. #define STRREG_SHEX_PROPSHEET STRREG_SHEX TEXT("\\PropertySheetHandlers")
  1707. #define STRREG_SHEX_DDHANDLER STRREG_SHEX TEXT("\\DragDropHandlers")
  1708. #define STRREG_SHEX_MENUHANDLER STRREG_SHEX TEXT("\\ContextMenuHandlers")
  1709. #define STRREG_SHEX_COPYHOOK TEXT("Directory\\") STRREG_SHEX TEXT("\\CopyHookHandlers")
  1710. #define STRREG_SHEX_PRNCOPYHOOK TEXT("Printers\\") STRREG_SHEX TEXT("\\CopyHookHandlers")
  1711. #define STRREG_STARTMENU TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MenuOrder\\Start Menu")
  1712. #define STRREG_STARTMENU2 TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MenuOrder\\Start Menu2")
  1713. #define STRREG_FAVORITES TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\MenuOrder\\Favorites")
  1714. #define STRREG_DISCARDABLE TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Discardable")
  1715. #define STRREG_POSTSETUP TEXT("\\PostSetup")
  1716. #define STREXP_CANUNLOAD "DllCanUnloadNow" // From OLE 2.0
  1717. #define STRINI_CLASSINFO TEXT(".ShellClassInfo") // secton name
  1718. #define STRINI_SHELLUI TEXT("ShellUIHandler")
  1719. #define STRINI_OPENDIRICON TEXT("OpenDirIcon")
  1720. #define STRINI_DIRICON TEXT("DirIcon")
  1721. #define STR_DESKTOPINI TEXT("desktop.ini")
  1722. #define STR_DESKTOPINIA "desktop.ini"
  1723. #define DRIVEID(path) ((*path - 'A') & 31)
  1724. #define PATH_CCH_EXT 64
  1725. // DOC'ed for DOJ Compliance
  1726. #ifndef NOUSER
  1727. typedef struct {
  1728. NMHDR hdr;
  1729. CHAR szCmd[MAX_PATH*2];
  1730. DWORD dwHotKey;
  1731. HMONITOR hMonitor;
  1732. } NMVIEWFOLDERA, *LPNMVIEWFOLDERA;
  1733. typedef struct {
  1734. NMHDR hdr;
  1735. WCHAR szCmd[MAX_PATH*2];
  1736. DWORD dwHotKey;
  1737. HMONITOR hMonitor;
  1738. } NMVIEWFOLDERW, *LPNMVIEWFOLDERW;
  1739. #ifdef UNICODE
  1740. typedef NMVIEWFOLDERW NMVIEWFOLDER;
  1741. typedef LPNMVIEWFOLDERW LPNMVIEWFOLDER;
  1742. #else
  1743. typedef NMVIEWFOLDERA NMVIEWFOLDER;
  1744. typedef LPNMVIEWFOLDERA LPNMVIEWFOLDER;
  1745. #endif // UNICODE
  1746. #endif
  1747. //
  1748. // DDE related APIs
  1749. //
  1750. SHSTDDOCAPI_(void) ShellDDEInit(BOOL fInit);
  1751. SHSTDDOCAPI_(BOOL) DDEHandleViewFolderNotify(IShellBrowser* psb, HWND hwnd, LPNMVIEWFOLDER lpnm);
  1752. SHSTDDOCAPI_(LPNMVIEWFOLDER) DDECreatePostNotify(LPNMVIEWFOLDER lpnm);
  1753. // DOC'ed for DOJ compliance
  1754. SHSTDAPI CIDLData_CreateFromIDArray(LPCITEMIDLIST pidlFolder, UINT cidl, LPCITEMIDLIST apidl[], IDataObject **ppdtobj);
  1755. SHSTDAPI SHCreateFileDataObject(LPCITEMIDLIST pidlFolder, UINT cidl, LPCITEMIDLIST *apidl, IDataObject *pdtInner, IDataObject **pdtobj);
  1756. // Common strings
  1757. #define STR_DESKTOPCLASS "Progman"
  1758. //
  1759. // Storage name of a scrap/bookmark item
  1760. //
  1761. #define WSTR_SCRAPITEM L"\003ITEM000"
  1762. // DOC'ed for DOJ Compliance
  1763. #ifdef RFN_FIRST
  1764. #define RFN_EXECUTE (RFN_FIRST - 0)
  1765. typedef struct {
  1766. NMHDR hdr;
  1767. LPCSTR lpszCmd;
  1768. LPCSTR lpszWorkingDir;
  1769. int nShowCmd;
  1770. } NMRUNFILEA, *LPNMRUNFILEA;
  1771. typedef struct {
  1772. NMHDR hdr;
  1773. LPCWSTR lpszCmd;
  1774. LPCWSTR lpszWorkingDir;
  1775. int nShowCmd;
  1776. } NMRUNFILEW, *LPNMRUNFILEW;
  1777. #ifdef UNICODE
  1778. typedef NMRUNFILEW NMRUNFILE;
  1779. typedef LPNMRUNFILEW LPNMRUNFILE;
  1780. #else
  1781. typedef NMRUNFILEA NMRUNFILE;
  1782. typedef LPNMRUNFILEA LPNMRUNFILE;
  1783. #endif // UNICODE
  1784. #endif
  1785. // DOC'ed for DOJ compliance
  1786. // Shell create link API
  1787. #define SHCL_USETEMPLATE 0x0001
  1788. #define SHCL_USEDESKTOP 0x0002
  1789. #define SHCL_CONFIRM 0x0004
  1790. #define SHCL_MAKEFOLDERSHORTCUT 0x0008
  1791. #if (_WIN32_IE >= 0x0600)
  1792. #define SHCL_NOUNIQUE 0x0010
  1793. #endif // _WIN2_IE >= 0x0600
  1794. SHSTDAPI SHCreateLinks(HWND hwnd, LPCTSTR pszDir, IDataObject *pDataObj, UINT fFlags, LPITEMIDLIST* ppidl);
  1795. SHSTDAPI SHRegisterDragDrop(HWND hwnd, IDropTarget *pdtgt);
  1796. SHSTDAPI SHRevokeDragDrop(HWND hwnd);
  1797. // DOC'ed for DOJ compliance
  1798. //===========================================================================
  1799. // office 9 pluggable UI
  1800. //===========================================================================
  1801. #define PUI_OFFICE_COMMAND (WM_USER + 0x901)
  1802. #define PLUGUI_CMD_SHUTDOWN 0 // wParam value
  1803. #define PLUGUI_CMD_QUERY 1 // wParam value
  1804. #define OFFICE_VERSION_9 9 // standardized value to return for Office 9 apps
  1805. typedef struct _PLUGUI_INFO
  1806. {
  1807. unsigned uMajorVersion : 8; // Used to indicate App's major version number
  1808. unsigned uOleServer : 1; // BOOL, TRUE if this is an OLE process
  1809. unsigned uUnused : 23; // not used
  1810. } PLUGUI_INFO;
  1811. typedef union _PLUGUI_QUERY
  1812. {
  1813. UINT uQueryVal;
  1814. PLUGUI_INFO PlugUIInfo;
  1815. } PLUGUI_QUERY;
  1816. //===========================================================================
  1817. // Image dragging API (definitely private)
  1818. //===========================================================================
  1819. // DOC'ed for DOJ Compliance
  1820. //Contains the drag context header.
  1821. // Must be pack1 since it's persisted into a stream that travels between
  1822. // processes.
  1823. typedef struct {
  1824. BOOL fImage;
  1825. BOOL fLayered;
  1826. POINT ptOffset;
  1827. } DragContextHeader;
  1828. #define DAD_InitScrollData(pad) (pad)->bFull = FALSE, (pad)->iNextSample = 0, (pad)->dwLastScroll = 0
  1829. // DOC'ed for DOJ Compliance
  1830. SHSTDAPI_(BOOL) DAD_DragEnter(HWND hwndTarget);
  1831. // DOC'ed for DOJ Compliance
  1832. SHSTDAPI_(BOOL) DAD_SetDragImageFromListView(HWND hwndLV, POINT ptOffset);
  1833. SHSTDAPI_(void) DAD_InvalidateCursors(void);
  1834. //----------------------------------------------------------------------------
  1835. // CABINETSTATE holds the global configuration for the Explorer and its cohorts.
  1836. //
  1837. // Originally the cLength was an 'int', it is now two words, allowing us to
  1838. // specify a version number.
  1839. //----------------------------------------------------------------------------
  1840. // DOC'ed for DOJ Compliance
  1841. // RUN FILE RETURN values from notify message
  1842. #define RFR_NOTHANDLED 0
  1843. #define RFR_SUCCESS 1
  1844. #define RFR_FAILURE 2
  1845. #define PathGetExtensionORD 158
  1846. SHSTDAPI_(LPTSTR) PathGetExtension(LPCTSTR pszPath, LPTSTR pszExtension, int cchExt);
  1847. // DOC'ed for DOJ Compliance
  1848. SHSTDAPI_(BOOL) PathGetShortName(LPCTSTR pszLongName, LPTSTR pszShortName, UINT cbShortName);
  1849. SHSTDAPI_(BOOL) PathGetLongName(LPCTSTR pszShortName, LPTSTR pszLongName, UINT cbLongName);
  1850. SHSTDAPI_(BOOL) PathDirectoryExists(LPCTSTR pszDir);
  1851. // DOC'ed for DOJ Compliance
  1852. SHSTDAPI_(LPTSTR) PathGetNextComponent(LPCTSTR pszPath, LPTSTR pszComponent);
  1853. // DOC'ed for DOJ Compliance
  1854. SHSTDAPI_(BOOL) PathIsEqualOrSubFolder(LPCTSTR pszFolder, LPCTSTR pszSubFolder);
  1855. // DOC'ed for DOJ Compliance
  1856. SHSTDAPI_(BOOL) PathIsTemporaryA(LPCSTR pszPath);
  1857. SHSTDAPI_(BOOL) PathIsTemporaryW(LPCWSTR pszPath);
  1858. #ifdef UNICODE
  1859. #define PathIsTemporary PathIsTemporaryW
  1860. #else
  1861. #define PathIsTemporary PathIsTemporaryA
  1862. #endif // !UNICODE
  1863. // DOC'ed for DOJ Compliance
  1864. SHSTDAPI_(int) PathCleanupSpecEx(LPCTSTR pszDir, LPTSTR pszSpec);
  1865. // DOC'ed for DOJ Compliance
  1866. SHSTDAPI_(BOOL) ParseField(LPCTSTR szData, int n, LPTSTR szBuf, int iBufLen);
  1867. // Needed for RunFileDlg
  1868. #define RFD_NOBROWSE 0x00000001
  1869. #define RFD_NODEFFILE 0x00000002
  1870. #define RFD_USEFULLPATHDIR 0x00000004
  1871. #define RFD_NOSHOWOPEN 0x00000008
  1872. #define RFD_WOW_APP 0x00000010
  1873. #define RFD_NOSEPMEMORY_BOX 0x00000020
  1874. SHSTDAPI_(int) RunFileDlg(HWND hwnd, HICON hIcon, LPCTSTR pszWorkingDir, LPCTSTR pszTitle,
  1875. LPCTSTR pszPrompt, DWORD dwFlags);
  1876. // DOC'ed for DOJ Compliance
  1877. SHSTDAPI_(int) RealDriveTypeFlags(int iDrive, BOOL fOKToHitNet);
  1878. // DOC'ed for DOJ compliance
  1879. SHSTDAPI_(void) InvalidateDriveType(int iDrive);
  1880. // DOC'ed for DOJ Compliance
  1881. //
  1882. // Constants used for dwNumFmtFlags argument in Int64ToString and LargeIntegerToString.
  1883. //
  1884. #define NUMFMT_IDIGITS 0x00000001
  1885. #define NUMFMT_ILZERO 0x00000002
  1886. #define NUMFMT_SGROUPING 0x00000004
  1887. #define NUMFMT_SDECIMAL 0x00000008
  1888. #define NUMFMT_STHOUSAND 0x00000010
  1889. #define NUMFMT_INEGNUMBER 0x00000020
  1890. #define NUMFMT_ALL 0xFFFFFFFF
  1891. SHSTDAPI_(int) LargeIntegerToString(LARGE_INTEGER *pN, LPTSTR szOutStr, UINT nSize, BOOL bFormat, NUMBERFMT *pFmt, DWORD dwNumFmtFlags);
  1892. SHSTDAPI_(int) Int64ToString(_int64 n, LPTSTR szOutStr, UINT nSize, BOOL bFormat, NUMBERFMT *pFmt, DWORD dwNumFmtFlags);
  1893. //-------- drive type identification --------------
  1894. // iDrive drive index (0=A, 1=B, ...)
  1895. //
  1896. #define DRIVE_CDROM 5 // extended DriveType() types
  1897. #define DRIVE_RAMDRIVE 6
  1898. #define DRIVE_TYPE 0x000F // type masek
  1899. #define DRIVE_SLOW 0x0010 // drive is on a slow link
  1900. #define DRIVE_LFN 0x0020 // drive supports LFNs
  1901. #define DRIVE_AUTORUN 0x0040 // drive has AutoRun.inf in root.
  1902. #define DRIVE_AUDIOCD 0x0080 // drive is a AudioCD
  1903. #define DRIVE_AUTOOPEN 0x0100 // should *always* auto open on insert
  1904. #define DRIVE_NETUNAVAIL 0x0200 // Network drive that is not available
  1905. #define DRIVE_SHELLOPEN 0x0400 // should auto open on insert, if shell has focus
  1906. #define DRIVE_SECURITY 0x0800 // Supports ACLs
  1907. #define DRIVE_COMPRESSED 0x1000 // Root of volume is compressed
  1908. #define DRIVE_ISCOMPRESSIBLE 0x2000 // Drive supports compression (not nescesarrily compressed)
  1909. #define DRIVE_DVD 0x4000 // drive is a DVD
  1910. #define DriveTypeFlags(iDrive) DriveType('A' + (iDrive))
  1911. #define DriveIsSlow(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_SLOW)
  1912. #define DriveIsLFN(iDrive) (RealDriveTypeFlags(iDrive, TRUE) & DRIVE_LFN)
  1913. #define DriveIsAutoRun(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_AUTORUN)
  1914. #define DriveIsAutoOpen(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_AUTOOPEN)
  1915. #define DriveIsShellOpen(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_SHELLOPEN)
  1916. #define DriveIsAudioCD(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_AUDIOCD)
  1917. #define DriveIsNetUnAvail(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_NETUNAVAIL)
  1918. #define DriveIsSecure(iDrive) (RealDriveTypeFlags(iDrive, TRUE) & DRIVE_SECURITY)
  1919. #define DriveIsCompressed(iDrive) (RealDriveTypeFlags(iDrive, TRUE) & DRIVE_COMPRESSED)
  1920. #define DriveIsCompressible(iDrive) (RealDriveTypeFlags(iDrive, TRUE) & DRIVE_ISCOMPRESSIBLE)
  1921. #define DriveIsDVD(iDrive) (RealDriveTypeFlags(iDrive, FALSE) & DRIVE_DVD)
  1922. #define IsCDRomDrive(iDrive) (RealDriveType(iDrive, FALSE) == DRIVE_CDROM)
  1923. #define IsRamDrive(iDrive) (RealDriveType(iDrive, FALSE) == DRIVE_RAMDRIVE)
  1924. #define IsRemovableDrive(iDrive) (RealDriveType(iDrive, FALSE) == DRIVE_REMOVABLE)
  1925. #define IsRemoteDrive(iDrive) (RealDriveType(iDrive, FALSE) == DRIVE_REMOTE)
  1926. //
  1927. // For SHCreateDefClassObject
  1928. //
  1929. typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown *pUnkOuter, REFIID riid, void **ppvObject);
  1930. SHSTDAPI SHCreateDefClassObject(REFIID riid, void **ppv, LPFNCREATEINSTANCE lpfn, UINT *pcRefDll, REFIID riidInstance);
  1931. // DOC'ed for DOJ compliance
  1932. typedef HANDLE HNRES; // for SHGetNetResource
  1933. SHSTDAPI_(UINT) SHGetNetResource(HNRES hnres, UINT iItem, LPNETRESOURCE pnres, UINT cbMax);
  1934. #define SHOP_TYPEMASK 0x00000007
  1935. #define SHOP_MODAL 0x80000000
  1936. SHSTDAPI_(DWORD) SHChkDskDrive(HWND hwnd, UINT drive);
  1937. // DOC'ed for DOJ compliance
  1938. //====== SEMI-PRIVATE API ===============================
  1939. // DOC'ed for DOJ compliance
  1940. WINSHELLAPI HPSXA SHCreatePropSheetExtArrayEx( HKEY hKey, LPCTSTR pszSubKey, UINT max_iface, IDataObject * pdo );
  1941. //====== SEMI-PRIVATE API ORDINALS ===============================
  1942. // This is the list of semi-private ordinals we semi-publish.
  1943. #define SHGetNetResourceORD 69
  1944. #define SHObjectPropertiesORD 178
  1945. #define SHAddFromPropSheetExtArrayORD 167
  1946. #define SHCreatePropSheetExtArrayORD 168
  1947. #define SHDestroyPropSheetExtArrayORD 169
  1948. #define SHReplaceFromPropSheetExtArrayORD 170
  1949. #define SHCreateDefClassObjectORD 70
  1950. #define SHEXP_SHGETNETRESOURCE MAKEINTRESOURCE(SHGetNetResourceORD)
  1951. #define SHEXP_SHADDFROMPROPSHEETEXTARRAY MAKEINTRESOURCE(SHAddFromPropSheetExtArrayORD)
  1952. #define SHEXP_SHCREATEPROPSHEETEXTARRAY MAKEINTRESOURCE(SHCreatePropSheetExtArrayORD)
  1953. #define SHEXP_SHDESTROYPROPSHEETEXTARRAY MAKEINTRESOURCE(SHDestroyPropSheetExtArrayORD)
  1954. #define SHEXP_SHREPLACEFROMPROPSHEETEXTARRAY MAKEINTRESOURCE(SHReplaceFromPropSheetExtArrayORD)
  1955. #define SHEXP_SHCREATEDEFCLASSOBJECT MAKEINTRESOURCE(SHCreateDefClassObjectORD)
  1956. // This avoids duplicate definition problems in the net\config project
  1957. // which defines *some* of its own PIDL utility functions, but depends on
  1958. // us for others (ILClone())
  1959. // DOC'ed for DOJ Compliance
  1960. #ifndef AVOID_NET_CONFIG_DUPLICATES
  1961. //===========================================================================
  1962. // ITEMIDLIST
  1963. //===========================================================================
  1964. // flags for ILGetDisplayNameEx
  1965. #define ILGDN_FULLNAME 0
  1966. #define ILGDN_ITEMONLY 1
  1967. #define ILGDN_INFOLDER 2
  1968. // DOC'ed for DOJ Compliance
  1969. #define ILIsEmpty(pidl) ((pidl) == NULL || (pidl)->mkid.cb==0)
  1970. SHSTDAPI_(LPITEMIDLIST) ILCreate(void);
  1971. // DOC'ed for DOJ Compliance
  1972. SHSTDAPI_(void) ILGlobalFree(LPITEMIDLIST pidl);
  1973. SHSTDAPI_(BOOL) ILGetDisplayName(LPCITEMIDLIST pidl, LPTSTR pszName);
  1974. SHSTDAPI_(BOOL) ILGetDisplayNameEx(IShellFolder *psfRoot, LPCITEMIDLIST pidl, LPTSTR pszName, int fType);
  1975. // DOC'ed for DOJ Compliance
  1976. SHSTDAPI_(LPITEMIDLIST) ILGlobalClone(LPCITEMIDLIST pidl);
  1977. // DOC'ed for DOJ Compliance
  1978. SHSTDAPI ILLoadFromFile(HFILE hfile, LPITEMIDLIST *pidl);
  1979. SHSTDAPI ILSaveToFile(HFILE hfile, LPCITEMIDLIST pidl);
  1980. // DOC'ed for DOJ Compliance
  1981. // helper macros
  1982. #define ILCreateFromID(pmkid) ILAppendID(NULL, pmkid, TRUE)
  1983. #endif // AVOID_NET_CONFIG_DUPLICATES
  1984. // WARNING: this interface is not supported on the current platform, just downlevel
  1985. #undef INTERFACE
  1986. #define INTERFACE IWebViewOCWinMan
  1987. DECLARE_INTERFACE_(IWebViewOCWinMan, IUnknown)
  1988. {
  1989. // *** IUnknown methods ***
  1990. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  1991. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  1992. STDMETHOD_(ULONG,Release) (THIS) PURE;
  1993. // *** IWebViewOCWinMan methods ***
  1994. STDMETHOD(SwapWindow) (THIS_ HWND hwndLV, IWebViewOCWinMan **pocWinMan) PURE;
  1995. };
  1996. // DOC'ed for DOJ compliance
  1997. // Classic Win95 policy bits. Do NOT add any more bits in
  1998. // this range. See the ranges below to add new policies.
  1999. // | |
  2000. // v v
  2001. // Values starting at 4000001 are treated as raw INTs. New
  2002. // *shell-specific* policies (NOT browser policies) should
  2003. // be added in this range. Use SHRestricted() with these bits.
  2004. // | |
  2005. // v v
  2006. //--- UNUSED -- USE THIS SPACE --- 0x4000006C to 0x4000006E
  2007. // Browser restrictions (parameter for SHRestricted2)
  2008. //
  2009. // The browser restrictions are divided into two ranges, "explorer restrictions" and
  2010. // "infodelivery restrictions". Explorer restrictions are kept under "Software\\Microsoft\\
  2011. // Windows\\CurrentVersion\\Policies\\Explorer," while infodelivery restrictions are kept
  2012. // under "Software\\Policies\\Microsoft\\Internet Explorer\\Infodelivery\\Restrictions."
  2013. //
  2014. // **NOTE**: SHRestricted2 assumes each range is continuous.
  2015. typedef enum {
  2016. // explorer restrictions
  2017. REST_BROWSER_NONE = 0x00000000, // REST_EXPLORER_FIRST
  2018. REST_NOTOOLBARCUSTOMIZE = 0x00000001,
  2019. REST_NOBANDCUSTOMIZE = 0x00000002,
  2020. REST_SMALLICONS = 0x00000003,
  2021. REST_LOCKICONSIZE = 0x00000004,
  2022. REST_SPECIFYDEFAULTBUTTONS = 0x00000005,
  2023. REST_BTN_BACK = 0x00000006,
  2024. REST_BTN_FORWARD = 0x00000007,
  2025. REST_BTN_STOPDOWNLOAD = 0x00000008,
  2026. REST_BTN_REFRESH = 0x00000009,
  2027. REST_BTN_HOME = 0x0000000A,
  2028. REST_BTN_SEARCH = 0x0000000B,
  2029. REST_BTN_HISTORY = 0x0000000C,
  2030. REST_BTN_FAVORITES = 0x0000000D,
  2031. REST_BTN_ALLFOLDERS = 0x0000000E,
  2032. REST_BTN_THEATER = 0x0000000F,
  2033. REST_BTN_TOOLS = 0x00000010,
  2034. REST_BTN_MAIL = 0x00000011,
  2035. REST_BTN_FONTS = 0x00000012,
  2036. REST_BTN_PRINT = 0x00000013,
  2037. REST_BTN_EDIT = 0x00000014,
  2038. REST_BTN_DISCUSSIONS = 0x00000015,
  2039. REST_BTN_CUT = 0x00000016,
  2040. REST_BTN_COPY = 0x00000017,
  2041. REST_BTN_PASTE = 0x00000018,
  2042. REST_BTN_ENCODING = 0x00000019,
  2043. REST_NoUserAssist = 0x0000001A,
  2044. REST_NoWindowsUpdate = 0x0000001B,
  2045. REST_NoExpandedNewMenu = 0x0000001C,
  2046. REST_NOFILEURL = 0x0000001D,
  2047. REST_BTN_PRINTPREVIEW = 0X0000001E,
  2048. REST_BTN_MEDIABAR = 0x0000001F, // REST_EXPLORER_LAST
  2049. // infodelivery restrictions
  2050. REST_NoChannelUI = 0x50000001, // REST_INFO_FIRST
  2051. REST_NoAddingChannels = 0x50000002,
  2052. REST_NoEditingChannels = 0x50000003,
  2053. REST_NoRemovingChannels = 0x50000004,
  2054. REST_NoAddingSubscriptions = 0x50000005,
  2055. REST_NoEditingSubscriptions = 0x50000006,
  2056. REST_NoRemovingSubscriptions = 0x50000007,
  2057. REST_NoChannelLogging = 0x50000008,
  2058. REST_NoManualUpdates = 0x50000009,
  2059. REST_NoScheduledUpdates = 0x5000000A,
  2060. REST_NoUnattendedDialing = 0x5000000B,
  2061. REST_NoChannelContent = 0x5000000C,
  2062. REST_NoSubscriptionContent = 0x5000000D,
  2063. REST_NoEditingScheduleGroups = 0x5000000E,
  2064. REST_MaxChannelSize = 0x5000000F,
  2065. REST_MaxSubscriptionSize = 0x50000010,
  2066. REST_MaxChannelCount = 0x50000011,
  2067. REST_MaxSubscriptionCount = 0x50000012,
  2068. REST_MinUpdateInterval = 0x50000013,
  2069. REST_UpdateExcludeBegin = 0x50000014,
  2070. REST_UpdateExcludeEnd = 0x50000015,
  2071. REST_UpdateInNewProcess = 0x50000016,
  2072. REST_MaxWebcrawlLevels = 0x50000017,
  2073. REST_MaxChannelLevels = 0x50000018,
  2074. REST_NoSubscriptionPasswords = 0x50000019,
  2075. REST_NoBrowserSaveWebComplete = 0x5000001A,
  2076. REST_NoSearchCustomization = 0x5000001B,
  2077. REST_NoSplash = 0x5000001C, // REST_INFO_LAST
  2078. // restrictions ported from SP2
  2079. REST_NoFileOpen = 0x60000001, // REST_BROWSER_FIRST
  2080. REST_NoFileNew = 0x60000002,
  2081. REST_NoBrowserSaveAs = 0x60000003,
  2082. REST_NoBrowserOptions = 0x60000004,
  2083. REST_NoFavorites = 0x60000005,
  2084. REST_NoSelectDownloadDir = 0x60000006,
  2085. REST_NoBrowserContextMenu = 0x60000007,
  2086. REST_NoBrowserClose = 0x60000008,
  2087. REST_NoOpeninNewWnd = 0x60000009,
  2088. REST_NoTheaterMode = 0x6000000A,
  2089. REST_NoFindFiles = 0x6000000B,
  2090. REST_NoViewSource = 0x6000000C,
  2091. REST_GoMenu = 0x6000000D,
  2092. REST_NoToolbarOptions = 0x6000000E,
  2093. REST_NoHelpItem_TipOfTheDay = 0x6000000F,
  2094. REST_NoHelpItem_NetscapeHelp = 0x60000010,
  2095. REST_NoHelpItem_Tutorial = 0x60000011,
  2096. REST_NoHelpItem_SendFeedback = 0x60000012,
  2097. REST_AlwaysPromptWhenDownload = 0x60000013,
  2098. REST_NoNavButtons = 0x60000014,
  2099. REST_NoHelpMenu = 0x60000015,
  2100. REST_NoBrowserBars = 0x60000016,
  2101. REST_NoToolBar = 0x60000017,
  2102. REST_NoAddressBar = 0x60000018,
  2103. REST_NoLinksBar = 0x60000019,
  2104. REST_NoPrinting = 0x60000020,
  2105. REST_No_LaunchMediaBar = 0x60000021,
  2106. REST_No_MediaBarOnlineContent = 0x60000022, // REST_BROWSER_LAST
  2107. } BROWSER_RESTRICTIONS;
  2108. #define REST_EXPLORER_FIRST REST_BROWSER_NONE
  2109. #define REST_EXPLORER_LAST REST_BTN_MEDIABAR
  2110. #define REST_INFO_FIRST REST_NoChannelUI
  2111. #define REST_INFO_LAST REST_NoSplash
  2112. #define REST_BROWSER_FIRST REST_NoFileOpen
  2113. #define REST_BROWSER_LAST REST_No_MediaBarOnlineContent
  2114. // codes for REST_BTN policies
  2115. #define RESTOPT_BTN_STATE_DEFAULT 0 // must be zero, else break browseui\itbar.cpp assumption
  2116. #define RESTOPT_BTN_STATE_VISIBLE 1
  2117. #define RESTOPT_BTN_STATE_HIDDEN 2
  2118. // REST_INTELLIMENUS
  2119. #define RESTOPT_INTELLIMENUS_USER 0
  2120. #define RESTOPT_INTELLIMENUS_DISABLED 1 // Match Restriction assumption: 1 == Off
  2121. #define RESTOPT_INTELLIMENUS_ENABLED 2
  2122. // FTP Exports
  2123. STDAPI IsIEDefautlFTPClient(void);
  2124. STDAPI MakeIEDefautlFTPClient(void);
  2125. STDAPI RestoreFTPClient(void);
  2126. SHSTDAPI_(void) SHSettingsChanged(WPARAM wParam, LPARAM lParam);
  2127. SHSTDAPI_(BOOL) SHIsBadInterfacePtr(LPCVOID pv, UINT cbVtbl);
  2128. // DOC'ed for DOJ Compliance
  2129. SHSTDAPI_(void) SHHandleDiskFull(HWND hwnd, int idDrive);
  2130. // DOC'ed for DOJ compliance
  2131. SHSTDAPI_(BOOL) SHFindComputer(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile);
  2132. // DOC'ed for DOJ Compliance
  2133. SHSTDAPI_(BOOL) Win32CreateDirectory(LPCTSTR pszPath, SECURITY_ATTRIBUTES *psa);
  2134. SHSTDAPI_(BOOL) Win32RemoveDirectory(LPCTSTR pszPath);
  2135. // DOC'ed for DOJ Compliance
  2136. SHSTDAPI_(void) SHUpdateRecycleBinIcon();
  2137. // DOC'ed for DOJ Compliance
  2138. SHSTDAPI_(LPITEMIDLIST) SHLogILFromFSIL(LPCITEMIDLIST pidlFS);
  2139. SHSTDAPI_(BOOL) StrRetToStrN(LPTSTR szOut, UINT uszOut, STRRET *pStrRet, LPCITEMIDLIST pidl);
  2140. SHSTDAPI_(DWORD) SHWaitForFileToOpen(LPCITEMIDLIST pidl, UINT uOptions, DWORD dwtimeout);
  2141. SHSTDAPI_(void) SetAppStartingCursor(HWND hwnd, BOOL fSet);
  2142. // DOC'ed for DOJ compliance
  2143. SHSTDAPI_(void *) SHGetHandlerEntry(LPCTSTR szHandler, LPCSTR szProcName, HINSTANCE *lpModule);
  2144. // This is sent to a browser windows letting them know that we have
  2145. // opened a folder, i.e. the folder open operation is done.
  2146. // Call RegisterWindowMessage to get the ID
  2147. #define SH_FILEOPENED TEXT("ShellFileOpened")
  2148. // DOC'ed for DOJ compliance
  2149. SHSTDAPI SHCreatePropertyBag(REFIID riid, void **ppv);
  2150. SHSTDAPI_(DWORD) SHNetConnectionDialog(HWND hwnd, LPTSTR pszRemoteName, DWORD dwType);
  2151. // DOC'ed for DOJ Compliance
  2152. SHSTDAPI_(int) SHLookupIconIndexA(LPCSTR pszFile, int iIconIndex, UINT uFlags);
  2153. // DOC'ed for DOJ Compliance
  2154. SHSTDAPI_(int) SHLookupIconIndexW(LPCWSTR pszFile, int iIconIndex, UINT uFlags);
  2155. #ifdef UNICODE
  2156. #define SHLookupIconIndex SHLookupIconIndexW
  2157. #else
  2158. #define SHLookupIconIndex SHLookupIconIndexA
  2159. #endif // !UNICODE
  2160. SHSTDAPI_(UINT) SHExtractIconsA(LPCSTR pszFileName, int nIconIndex, int cxIcon, int cyIcon,
  2161. HICON *phicon, UINT *piconid, UINT nIcons, UINT flags);
  2162. SHSTDAPI_(UINT) SHExtractIconsW(LPCWSTR pszFileName, int nIconIndex, int cxIcon, int cyIcon,
  2163. HICON *phicon, UINT *piconid, UINT nIcons, UINT flags);
  2164. #ifdef UNICODE
  2165. #define SHExtractIcons SHExtractIconsW
  2166. #else
  2167. #define SHExtractIcons SHExtractIconsA
  2168. #endif // !UNICODE
  2169. SHSTDAPI SHGetAssociations(LPCITEMIDLIST pidl, void **ppvQueryAssociations);
  2170. #define SHLookupIconIndexAORD 7
  2171. #define SHLookupIconIndexWORD 8
  2172. #ifdef UNICODE
  2173. #define SHLookupIconIndexORD SHLookupIconIndexWORD
  2174. #else
  2175. #define SHDefExtractIcon SHDefExtractIconA
  2176. #endif
  2177. // OpenAsInfo flags
  2178. #define OAIF_ALLOW_REGISTRATION 0x00000001 // enable the "always use this file" checkbox (NOTE if you dont pass this, it will be disabled)
  2179. #define OAIF_REGISTER_EXT 0x00000002 // do the registration after the user hits "ok"
  2180. #define OAIF_EXEC 0x00000004 // execute file after registering
  2181. #define OAIF_FORCE_REGISTRATION 0x00000008 // force the "always use this file" checkbox to be checked (normally, you wont use the OAIF_ALLOW_REGISTRATION wen you pass this)
  2182. #define OAIF_ALL (OAIF_ALLOW_REGISTRATION | OAIF_REGISTER_EXT | OAIF_EXEC | OAIF_FORCE_REGISTRATION) //
  2183. #include <pshpack8.h>
  2184. typedef struct _openasinfo
  2185. {
  2186. LPCTSTR pcszFile; // [in] file name
  2187. LPCTSTR pcszClass; // [in] file class description. NULL means
  2188. // use pcszFile's extension
  2189. DWORD dwInFlags; // [in] input flags from OAIF_*
  2190. TCHAR szApp[MAX_PATH]; // [out] application selected
  2191. } OPENASINFO, * POPENASINFO;
  2192. #include <poppack.h> /* Return to byte packing */
  2193. SHSTDAPI OpenAsDialog(HWND hwnd, POPENASINFO poainfo);
  2194. //
  2195. // Interface pointer validation
  2196. //
  2197. #define IsBadInterfacePtr(pitf, ITF) SHIsBadInterfacePtr(pitf, sizeof(ITF##Vtbl))
  2198. //===========================================================================
  2199. // Another block of private API
  2200. //===========================================================================
  2201. // indexes into the shell image lists (Shell_GetImageList) for default images
  2202. // If you add to this list, you also need to update II_LASTSYSICON!
  2203. #define II_DOCNOASSOC 0 // document (blank page) (not associated)
  2204. #define II_DOCUMENT 1 // document (with stuff on the page)
  2205. #define II_APPLICATION 2 // application (exe, com, bat)
  2206. #define II_FOLDER 3 // folder (plain)
  2207. #define II_FOLDEROPEN 4 // folder (open)
  2208. #define II_DRIVE525 5
  2209. #define II_DRIVE35 6
  2210. #define II_DRIVEREMOVE 7
  2211. #define II_DRIVEFIXED 8
  2212. #define II_DRIVENET 9
  2213. #define II_DRIVENETDISABLED 10
  2214. #define II_DRIVECD 11
  2215. #define II_DRIVERAM 12
  2216. #define II_WORLD 13
  2217. #define II_NETWORK 14
  2218. #define II_SERVER 15
  2219. #define II_PRINTER 16
  2220. #define II_MYNETWORK 17
  2221. #define II_GROUP 18
  2222. // Startmenu images.
  2223. #define II_STPROGS 19
  2224. #define II_STDOCS 20
  2225. #define II_STSETNGS 21
  2226. #define II_STFIND 22
  2227. #define II_STHELP 23
  2228. #define II_STRUN 24
  2229. #define II_STSUSPEND 25
  2230. #define II_STEJECT 26
  2231. #define II_STSHUTD 27
  2232. #define II_SHARE 28
  2233. #define II_LINK 29
  2234. #define II_SLOWFILE 30
  2235. #define II_RECYCLER 31
  2236. #define II_RECYCLERFULL 32
  2237. #define II_RNA 33
  2238. #define II_DESKTOP 34
  2239. // More startmenu image.
  2240. #define II_STCPANEL 35
  2241. #define II_STSPROGS 36
  2242. #define II_STPRNTRS 37
  2243. #define II_STFONTS 38
  2244. #define II_STTASKBR 39
  2245. #define II_CDAUDIO 40
  2246. #define II_TREE 41
  2247. #define II_STCPROGS 42
  2248. #define II_STFAVORITES 43
  2249. #define II_STLOGOFF 44
  2250. #define II_STFLDRPROP 45
  2251. #define II_WINUPDATE 46
  2252. #define II_MU_STSECURITY 47
  2253. #define II_MU_STDISCONN 48
  2254. #ifdef WINNT // hydra specific id
  2255. #define II_LASTSYSICON II_MU_STDISCONN
  2256. #else
  2257. // Last system image list icon index - used by icon cache manager
  2258. #define II_LASTSYSICON II_WINUPDATE
  2259. #endif
  2260. // Overlay indexes
  2261. #define II_OVERLAYFIRST II_SHARE
  2262. #define II_OVERLAYLAST II_SLOWFILE
  2263. #define II_NDSCONTAINER 72
  2264. #define II_SERVERSHARE 73
  2265. SHSTDAPI_(BOOL) FileIconInit( BOOL fRestoreCache );
  2266. // DOC'ed for DOJ compliance
  2267. SHSTDAPI_(void) Shell_SysColorChange(void);
  2268. // DOC'ed for DOJ compliance
  2269. //
  2270. // OLE string
  2271. //
  2272. SHSTDAPI_(int) OleStrToStrN(LPTSTR, int, LPCOLESTR, int);
  2273. SHSTDAPI_(int) StrToOleStrN(LPOLESTR, int, LPCTSTR, int);
  2274. SHSTDAPI_(int) OleStrToStr(LPTSTR, LPCOLESTR);
  2275. SHSTDAPI_(int) StrToOleStr(LPOLESTR, LPCTSTR);
  2276. #define LIPF_ENABLE 0x00000001 // create the object (vs release the object)
  2277. #define LIPF_HOLDREF 0x00000002 // hold ref on object after creation (vs release immediately)
  2278. typedef struct
  2279. {
  2280. CLSID clsid;
  2281. DWORD dwFlags;
  2282. } LOADINPROCDATA, *PLOADINPROCDATA;
  2283. // Tray CopyData Messages
  2284. #define TCDM_APPBAR 0x00000000
  2285. #define TCDM_NOTIFY 0x00000001
  2286. #define TCDM_LOADINPROC 0x00000002
  2287. //
  2288. // Private QueryContextMenuFlag passed from Bands
  2289. //
  2290. #define CMF_BANDCMD 0x00020000 // Install Band Context menu commands
  2291. //
  2292. // Functions to help the cabinets sync to each other
  2293. // uOptions parameter to SHWaitForFileOpen
  2294. //
  2295. #define WFFO_WAITTIME 10000L
  2296. #define WFFO_ADD 0x0001
  2297. #define WFFO_REMOVE 0x0002
  2298. #define WFFO_WAIT 0x0004
  2299. #define WFFO_SIGNAL 0x0008
  2300. //
  2301. // NOTES: IShellService is used when we share a service component
  2302. // (which implements a certain interface) among multiple clients
  2303. // (such as IE 3.0 and Explorer). The client always CoCreateInstance
  2304. // it and call SetOwner(this). When the client is going away
  2305. // (typically when the window is closed), it calls SetOwner(NULL)
  2306. // to let the service object releases the reference to the owner
  2307. // object.
  2308. //
  2309. #undef INTERFACE
  2310. #define INTERFACE IShellService
  2311. DECLARE_INTERFACE_(IShellService, IUnknown)
  2312. {
  2313. // *** IUnknown methods ***
  2314. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2315. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2316. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2317. // *** IShellService specific methods ***
  2318. STDMETHOD(SetOwner)(THIS_ struct IUnknown* punkOwner) PURE;
  2319. };
  2320. //
  2321. // NOTES: IHistSFPrivate is used when manipulating a history IShellFolder object
  2322. // It includes methods for pointing the shell folder at the correct virtual
  2323. // directory. QIing for IHistSFPrivate also guarantees the pidl format can
  2324. // safely be delved into to access the INTERNET_CACHE_ENTRY_INFO structure
  2325. //
  2326. #undef INTERFACE
  2327. #define INTERFACE IHistSFPrivate
  2328. DECLARE_INTERFACE_(IHistSFPrivate, IUnknown)
  2329. {
  2330. // *** IUnknown methods ***
  2331. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2332. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2333. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2334. // *** IHistPrivate specific methods ***
  2335. STDMETHOD(SetCachePrefix)(THIS_ LPCWSTR pszCachePrefix) PURE;
  2336. STDMETHOD(SetDomain)(THIS_ LPCWSTR pszDomain) PURE;
  2337. STDMETHOD(WriteHistory)(THIS_ LPCWSTR pszPrefixedUrl, FILETIME ftExpires, FILETIME ftModified, LPITEMIDLIST * ppidlSelect) PURE;
  2338. STDMETHOD(ClearHistory) (THIS) PURE;
  2339. };
  2340. //
  2341. // NOTES: IShellFolderViewType lets a shell folder support different "views" on
  2342. // its contents (meaning different hierarchical layouts of its data) with
  2343. // the default "view" being the one the shell folder displays normally.
  2344. // This enumerator returns pidls that are special hidden folders at the
  2345. // top level of the shell folder (which are not otherwise enumerated).
  2346. #undef INTERFACE
  2347. #define INTERFACE IShellFolderViewType
  2348. DECLARE_INTERFACE_(IShellFolderViewType, IUnknown)
  2349. {
  2350. // *** IUnknown methods ***
  2351. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2352. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2353. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2354. // *** IShellFolderViewType Methods ***
  2355. // NOTE: "Views" are seen by the user as hidden folders off the
  2356. // root (represented by pidls). Whenever appropriate, the
  2357. // default view (coming off the root folder) is represented
  2358. // as the NULL *or* empty pidl.
  2359. // EnumViews:
  2360. // Return an enumerator which will give out one pidl for every extended view.
  2361. STDMETHOD(EnumViews)(THIS_ ULONG grfFlags, IEnumIDList **ppenum) PURE;
  2362. // GetDefaultViewName:
  2363. // Return the name of the default view. The names of the other views
  2364. // can be retrieved by calling GetDisplayNameOf.
  2365. STDMETHOD(GetDefaultViewName)(THIS_ DWORD uFlags, LPWSTR *ppwszName) PURE;
  2366. STDMETHOD(GetViewTypeProperties)(THIS_ LPCITEMIDLIST pidl, DWORD *pdwFlags) PURE;
  2367. // TranslateViewPidl:
  2368. // Attempt to take a pidl represented in one heirarchical representation of
  2369. // the shell folder, and find it in a different representation.
  2370. // pidl should be relative to the root folder.
  2371. // Remember to ILFree ppidlOut
  2372. STDMETHOD(TranslateViewPidl)(THIS_ LPCITEMIDLIST pidl, LPCITEMIDLIST pidlView, LPITEMIDLIST *ppidlOut) PURE;
  2373. };
  2374. #define SFVTFLAG_NOTIFY_CREATE 0x00000001
  2375. #define SFVTFLAG_NOTIFY_RESORT 0x00000002
  2376. //
  2377. // NOTES: IShellFolderSearchableCallback allows the searcher to provide
  2378. // callback routines that moniter the search process
  2379. //
  2380. #undef INTERFACE
  2381. #define INTERFACE IShellFolderSearchableCallback
  2382. DECLARE_INTERFACE_(IShellFolderSearchableCallback, IUnknown)
  2383. {
  2384. // *** IUnknown methods ***
  2385. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2386. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2387. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2388. // *** IShellFolderSearchableCallback Methods ***
  2389. // NOTE: Caller may pass NULL for pVar or pdwFlags as a legal value
  2390. STDMETHOD(RunBegin)(THIS_ DWORD dwReserved) PURE;
  2391. STDMETHOD(RunEnd)(THIS_ DWORD dwReserved) PURE;
  2392. };
  2393. //
  2394. // NOTES: IShellFolderSearchable allows a shell extension to provide a searchable
  2395. // namespace.
  2396. #undef INTERFACE
  2397. #define INTERFACE IShellFolderSearchable
  2398. DECLARE_INTERFACE_(IShellFolderSearchable, IUnknown)
  2399. {
  2400. // *** IUnknown methods ***
  2401. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2402. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2403. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2404. // *** IShellFolderSearchable methods ***
  2405. // FindString -
  2406. // The returned shell folder's enumerator will have any
  2407. // search hits for the given search string.
  2408. // As no flags are currently defined, we suggest you pass
  2409. // NULL as lpdword
  2410. // punkOnAsyncSearch will be QI'd for IShellFolderSearchableCallback
  2411. STDMETHOD(FindString)(THIS_ LPCWSTR pwszTarget, DWORD *pdwFlags,
  2412. IUnknown *punkOnAsyncSearch, LPITEMIDLIST *ppidlOut) PURE;
  2413. // CancelAsyncSearch -
  2414. // Begins the process of cancelling any pending
  2415. // asynchronous search from this pidl.
  2416. // When the search is actually cancelled, RunEnd will be called
  2417. // Returns: S_OK => cancelling, S_FALSE => not running
  2418. STDMETHOD(CancelAsyncSearch) (THIS_ LPCITEMIDLIST pidlSearch, DWORD *pdwFlags) PURE;
  2419. // InvalidateSearch -
  2420. // Makes this pidl no longer a valid portion of the shell folder
  2421. // also does some cleanup of any databases used in the search and
  2422. // will cause the eventual release of the IRunHook callback
  2423. // May cause async search to be cancelled
  2424. STDMETHOD(InvalidateSearch) (THIS_ LPCITEMIDLIST pidlSearch, DWORD *pdwFlags) PURE;
  2425. };
  2426. //
  2427. // NOTES: IBandSiteHelper is used to let explorer's BandSite implementation,
  2428. // which aggregates shdocvw's BandSite, provide callback hooks for shdocvw
  2429. // to call.
  2430. //
  2431. #undef INTERFACE
  2432. #define INTERFACE IBandSiteHelper
  2433. DECLARE_INTERFACE_(IBandSiteHelper, IUnknown)
  2434. {
  2435. // *** IUnknown methods ***
  2436. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2437. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2438. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2439. // *** IBandSiteHelper specific methods ***
  2440. STDMETHOD(LoadFromStreamBS)(THIS_ struct IStream* pstm, REFIID riid, void **ppv) PURE;
  2441. STDMETHOD(SaveToStreamBS)(THIS_ struct IUnknown* punk, struct IStream* pstm) PURE;
  2442. };
  2443. // This private interface is added such that some of the support features that is in
  2444. // SHDocvw's Internet explorer frame automation code, that is not part of publicly
  2445. // defined interfaces can be used in the Explorer code...
  2446. //
  2447. // Note: FindCIE4ConnectionPoint was a hack for IE4. New code should use
  2448. // shlwapi helper functions like IConnectionPoint_Invoke instead.
  2449. //
  2450. #ifdef __cplusplus
  2451. class CIE4ConnectionPoint;
  2452. #else
  2453. typedef struct CIE4ConnectionPoint CIE4ConnectionPoint;
  2454. #endif
  2455. #undef INTERFACE
  2456. #define INTERFACE IExpDispSupport
  2457. DECLARE_INTERFACE_(IExpDispSupport, IUnknown)
  2458. {
  2459. // *** IUnknown methods ***
  2460. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2461. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2462. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2463. // *** IExpDispSupport specific methods ***
  2464. STDMETHOD(FindCIE4ConnectionPoint)(THIS_ REFIID riid, CIE4ConnectionPoint **ppccp) PURE;
  2465. STDMETHOD(OnTranslateAccelerator)(THIS_ MSG *pMsg, DWORD grfModifiers) PURE;
  2466. STDMETHOD(OnInvoke)(THIS_ DISPID dispidMember, REFIID iid, LCID lcid, WORD wFlags, DISPPARAMS *pdispparams,
  2467. VARIANT *pVarResult, EXCEPINFO *pexcepinfo, UINT *puArgErr) PURE;
  2468. };
  2469. //
  2470. // This interface is related to the above. It contains functions
  2471. // that would only be implemented on the WebBrowserOC version if IExpDispSupport.
  2472. //
  2473. #undef INTERFACE
  2474. #define INTERFACE IExpDispSupportOC
  2475. DECLARE_INTERFACE_(IExpDispSupportOC, IUnknown)
  2476. {
  2477. // *** IUnknown methods ***
  2478. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2479. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2480. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2481. // *** IExpDispSupportOC specific methods ***
  2482. STDMETHOD(OnOnControlInfoChanged)(THIS) PURE;
  2483. STDMETHOD(GetDoVerbMSG)(THIS_ MSG *pMsg) PURE;
  2484. };
  2485. //===========================================================================
  2486. // IConnectionPointCB interface
  2487. #undef INTERFACE
  2488. #define INTERFACE IConnectionPointCB
  2489. DECLARE_INTERFACE_(IConnectionPointCB, IUnknown)
  2490. {
  2491. // *** IUnknown methods ***
  2492. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2493. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2494. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2495. // *** IConnectionPointCB Methods ***
  2496. STDMETHOD(OnAdvise) (THIS_ REFIID iid, DWORD cSinks, ULONG_PTR dwCookie) PURE;
  2497. STDMETHOD(OnUnadvise) (THIS_ REFIID iid, DWORD cSinks, ULONG_PTR dwCookie) PURE;
  2498. };
  2499. //===========================================================================
  2500. // IDelegateDropTargetCB interface
  2501. //
  2502. // This interface is used by CDelegateDropTarget implementation in shdocvw
  2503. // to generate an IDropTarget implementation that delegates to different
  2504. // IDropTarget implementations depending on the point currently over. The
  2505. // implementor of IDelegateDropTargetCB can handle feedback, scrolling,
  2506. // hit testing, and returning interfaces for ids returned from hit testing.
  2507. //
  2508. // GetWindows returns the hwnd to lock and the hwnd to scroll (not necesarily
  2509. // the same window, as you often want to lock the parent of the window
  2510. // you want to scroll)
  2511. //
  2512. // HitTest should return an id of the object over as well as
  2513. // uptate UI (highlights, etc). if ppt is NULL
  2514. // that means remove any UI as the drag is terminating.
  2515. // this should be able to handle hittesting on points not
  2516. // even inside hwndScroll.
  2517. //
  2518. // GetObject returns an interface for an id returned from HitTest
  2519. //
  2520. // OnDrop gives the CB a chance to take action on the drop.
  2521. // returning S_FALSE from this function prevents
  2522. // CDelegateDropTarget from calling pdt->Drop(...).
  2523. //
  2524. #undef INTERFACE
  2525. #define INTERFACE IDelegateDropTargetCB
  2526. DECLARE_INTERFACE_(IDelegateDropTargetCB, IUnknown)
  2527. {
  2528. // *** IUnknown methods ***
  2529. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2530. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2531. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2532. // *** IDelegateDropTargetCB Methods ***
  2533. STDMETHOD(GetWindows) (THIS_ HWND * phwndLock, HWND * phwndScroll) PURE;
  2534. STDMETHOD(HitTest) (THIS_ LPPOINT ppt, DWORD * pdwId) PURE;
  2535. STDMETHOD(GetObject) (THIS_ DWORD dwId, REFIID riid, void **ppv) PURE;
  2536. STDMETHOD(OnDrop) (THIS_ IDropTarget *pdt, IDataObject *pdtobj, DWORD grfKeyState, POINTL pt, DWORD *pdwEffect) PURE;
  2537. };
  2538. #ifdef __COMMCTRL_DA_DEFINED__ // we need HDPAs for this interface
  2539. //
  2540. // IOrderList - for ordering info in favorites/channels
  2541. //
  2542. // Typical usage is: GetOrderList, AllocOrderItem, insert into correct
  2543. // position, SetOrderList, and then FreeOrderList.
  2544. //
  2545. typedef struct
  2546. {
  2547. LPITEMIDLIST pidl; // IDlist for this item
  2548. int nOrder; // Ordinal indicating user preference
  2549. DWORD lParam; // store custom order info.
  2550. } ORDERITEM, * PORDERITEM;
  2551. // Values for SortOrderList
  2552. #define OI_SORTBYNAME 0
  2553. #define OI_SORTBYORDINAL 1
  2554. #define OI_MERGEBYNAME 2
  2555. #undef INTERFACE
  2556. #define INTERFACE IOrderList
  2557. DECLARE_INTERFACE_(IOrderList, IUnknown)
  2558. {
  2559. // *** IUnknown methods ***
  2560. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2561. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2562. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2563. // *** IOrderList Methods ***
  2564. STDMETHOD(GetOrderList)(THIS_ HDPA * phdpa) PURE;
  2565. STDMETHOD(SetOrderList)(THIS_ HDPA hdpa, IShellFolder *psf) PURE;
  2566. STDMETHOD(FreeOrderList)(THIS_ HDPA hdpa) PURE;
  2567. STDMETHOD(SortOrderList)(THIS_ HDPA hdpa, DWORD dw) PURE;
  2568. STDMETHOD(AllocOrderItem)(THIS_ PORDERITEM * ppoi, LPCITEMIDLIST pidl) PURE;
  2569. STDMETHOD(FreeOrderItem)(THIS_ PORDERITEM poi) PURE;
  2570. };
  2571. #undef INTERFACE
  2572. #define INTERFACE IOrderList2
  2573. DECLARE_INTERFACE_(IOrderList2, IOrderList)
  2574. {
  2575. // *** IUnknown methods ***
  2576. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE;
  2577. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2578. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2579. // *** IOrderList Methods ***
  2580. STDMETHOD(GetOrderList)(THIS_ HDPA * phdpa) PURE; // WARNING (lamadio): This assumes Favorites Menu
  2581. STDMETHOD(SetOrderList)(THIS_ HDPA hdpa, IShellFolder *psf) PURE; // WARNING (lamadio): This assumes Favorites Menu
  2582. STDMETHOD(FreeOrderList)(THIS_ HDPA hdpa) PURE;
  2583. STDMETHOD(SortOrderList)(THIS_ HDPA hdpa, DWORD dw) PURE;
  2584. STDMETHOD(AllocOrderItem)(THIS_ PORDERITEM * ppoi, LPCITEMIDLIST pidl) PURE;
  2585. STDMETHOD(FreeOrderItem)(THIS_ PORDERITEM poi) PURE;
  2586. // *** IOrderList2
  2587. STDMETHOD(LoadFromStream)(THIS_ IStream* pstm, HDPA* phdpa, IShellFolder* psf) PURE;
  2588. STDMETHOD(SaveToStream)(THIS_ IStream* pstm, HDPA hdpa) PURE;
  2589. };
  2590. #endif
  2591. //===========================================================================
  2592. // IShellHTMLWindowSupport private COmWindow interface. This should never be exposed.
  2593. typedef struct IHTMLElement IHTMLElement;
  2594. #undef INTERFACE
  2595. #define INTERFACE IShellHTMLWindowSupport
  2596. DECLARE_INTERFACE_(IShellHTMLWindowSupport, IUnknown)
  2597. {
  2598. // *** IUnknown methods ***
  2599. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2600. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2601. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2602. STDMETHOD(ViewReleaseIntelliForms)(THIS) PURE;
  2603. STDMETHOD(ViewReleased)(THIS) PURE;
  2604. STDMETHOD(ViewActivated)(THIS) PURE;
  2605. STDMETHOD(ReadyStateChangedTo)(THIS_ long, IShellView* ) PURE;
  2606. STDMETHOD(CanNavigate)(THIS) PURE;
  2607. STDMETHOD(ActiveElementChanged)(THIS_ IHTMLElement * pHTMLElement) PURE;
  2608. };
  2609. //===========================================================================
  2610. // IShellHTMLWindowSupport2 private COmWindow interface. This should never be exposed.
  2611. #undef INTERFACE
  2612. #define INTERFACE IShellHTMLWindowSupport2
  2613. DECLARE_INTERFACE_(IShellHTMLWindowSupport2, IShellHTMLWindowSupport)
  2614. {
  2615. STDMETHOD(IsGalleryMeta)(THIS_ BOOL bFlag) PURE;
  2616. };
  2617. //===========================================================================
  2618. // IBandProxy private COmWindow interface. This should never be exposed.
  2619. #undef INTERFACE
  2620. #define INTERFACE IBandProxy
  2621. DECLARE_INTERFACE_(IBandProxy, IUnknown)
  2622. {
  2623. // *** IUnknown methods ***
  2624. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2625. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2626. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2627. // *** IBandProxy Methods ***
  2628. STDMETHOD(SetSite) (THIS_ IUnknown* punkSite) PURE;
  2629. STDMETHOD(CreateNewWindow) (THIS_ IUnknown** ppunk) PURE;
  2630. STDMETHOD(GetBrowserWindow) (THIS_ IUnknown** ppunk) PURE;
  2631. STDMETHOD(IsConnected) (THIS) PURE;
  2632. STDMETHOD(NavigateToPIDL) (THIS_ LPCITEMIDLIST pidl) PURE;
  2633. STDMETHOD(NavigateToURL) (THIS_ LPCWSTR wzUrl, VARIANT * Flags) PURE;
  2634. };
  2635. //===========================================================================
  2636. //
  2637. // Make it sure that we include ole2x.h and shlobj.h
  2638. //
  2639. #if defined(__IOleInPlaceSite_FWD_DEFINED__) && defined(FCIDM_SHVIEWFIRST)
  2640. #ifdef HLINK_H
  2641. #include <pshpack8.h>
  2642. typedef struct {
  2643. HWND _hwnd;
  2644. ITravelLog *_ptl;
  2645. IHlinkFrame *_phlf;
  2646. IWebBrowser2 *_pautoWB2; // use this to reference _pauto's IWebBrowser2 functions
  2647. IExpDispSupport *_pautoEDS; // use this to reference _pauto's IExpDispSupport functions
  2648. IShellService *_pautoSS; // use this to reference _pauto's IShellService functions
  2649. int _eSecureLockIcon;
  2650. DWORD _fCreatingViewWindow :1;
  2651. UINT _uActivateState; // this is the state we should use when we go active..
  2652. // this is here so that derived classes can set us for UI or non-UI active
  2653. // The following pidl is used in CBaseBrowser2::GetViewStateStream because
  2654. // at that time, neither _pidlCur nor _pidlPending are initialized.
  2655. LPCITEMIDLIST _pidlNewShellView;
  2656. IOleCommandTarget* _pctView;
  2657. LPITEMIDLIST _pidlCur;
  2658. IShellView *_psv;
  2659. IShellFolder *_psf; // IShellFolder for _psv (used in CVOCBrowser)
  2660. HWND _hwndView;
  2661. LPWSTR _pszTitleCur;
  2662. LPITEMIDLIST _pidlPending;
  2663. IShellView *_psvPending;
  2664. IShellFolder *_psfPending;
  2665. HWND _hwndViewPending;
  2666. LPWSTR _pszTitlePending;
  2667. BOOL _fIsViewMSHTML;
  2668. BOOL _fPrivacyImpacted;
  2669. } BASEBROWSERDATA, *LPBASEBROWSERDATA;
  2670. typedef const BASEBROWSERDATA *LPCBASEBROWSERDATA;
  2671. #include <poppack.h>
  2672. #else
  2673. // so (unref'ed) ifaces will compile (?)
  2674. typedef LPVOID BASEBROWSERDATA;
  2675. typedef LPCVOID *LPBASEBROWSERDATA;
  2676. typedef LPCVOID *LPCBASEBROWSERDATA;
  2677. #endif // hlink_h
  2678. typedef struct _travellog * PTRAVELLOG;
  2679. #undef INTERFACE
  2680. #define INTERFACE IBrowserService
  2681. DECLARE_INTERFACE_(IBrowserService, IUnknown)
  2682. {
  2683. // *** IUnknown methods ***
  2684. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2685. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2686. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2687. // *** IBrowserService specific methods ***
  2688. STDMETHOD(GetParentSite)(THIS_ struct IOleInPlaceSite** ppipsite) PURE;
  2689. STDMETHOD(SetTitle)(THIS_ IShellView* psv, LPCWSTR pszName) PURE;
  2690. STDMETHOD(GetTitle)(THIS_ IShellView* psv, LPWSTR pszName, DWORD cchName) PURE;
  2691. STDMETHOD(GetOleObject)(THIS_ struct IOleObject** ppobjv) PURE;
  2692. // think about this one.. I'm not sure we want to expose this -- Chee
  2693. // My impression is that we won't document this whole interface???
  2694. STDMETHOD(GetTravelLog)(THIS_ ITravelLog** pptl) PURE;
  2695. STDMETHOD(ShowControlWindow)(THIS_ UINT id, BOOL fShow) PURE;
  2696. STDMETHOD(IsControlWindowShown)(THIS_ UINT id, BOOL *pfShown) PURE;
  2697. STDMETHOD(IEGetDisplayName)(THIS_ LPCITEMIDLIST pidl, LPWSTR pwszName, UINT uFlags) PURE;
  2698. STDMETHOD(IEParseDisplayName)(THIS_ UINT uiCP, LPCWSTR pwszPath, LPITEMIDLIST * ppidlOut) PURE;
  2699. STDMETHOD(DisplayParseError)(THIS_ HRESULT hres, LPCWSTR pwszPath) PURE;
  2700. STDMETHOD(NavigateToPidl)(THIS_ LPCITEMIDLIST pidl, DWORD grfHLNF) PURE;
  2701. STDMETHOD (SetNavigateState)(THIS_ BNSTATE bnstate) PURE;
  2702. STDMETHOD (GetNavigateState) (THIS_ BNSTATE *pbnstate) PURE;
  2703. STDMETHOD (NotifyRedirect) (THIS_ struct IShellView* psv, LPCITEMIDLIST pidl, BOOL *pfDidBrowse) PURE;
  2704. STDMETHOD (UpdateWindowList) (THIS) PURE;
  2705. STDMETHOD (UpdateBackForwardState) (THIS) PURE;
  2706. STDMETHOD(SetFlags)(THIS_ DWORD dwFlags, DWORD dwFlagMask) PURE;
  2707. STDMETHOD(GetFlags)(THIS_ DWORD *pdwFlags) PURE;
  2708. // Tells if it can navigate now or not.
  2709. STDMETHOD (CanNavigateNow) (THIS) PURE;
  2710. STDMETHOD (GetPidl) (THIS_ LPITEMIDLIST *ppidl) PURE;
  2711. STDMETHOD (SetReferrer) (THIS_ LPITEMIDLIST pidl) PURE;
  2712. STDMETHOD_(DWORD, GetBrowserIndex)(THIS) PURE;
  2713. STDMETHOD (GetBrowserByIndex)(THIS_ DWORD dwID, IUnknown **ppunk) PURE;
  2714. STDMETHOD (GetHistoryObject)(THIS_ IOleObject **ppole, IStream **pstm, IBindCtx **ppbc) PURE;
  2715. STDMETHOD (SetHistoryObject)(THIS_ IOleObject *pole, BOOL fIsLocalAnchor) PURE;
  2716. STDMETHOD (CacheOLEServer)(THIS_ IOleObject *pole) PURE;
  2717. STDMETHOD (GetSetCodePage)(THIS_ VARIANT* pvarIn, VARIANT* pvarOut) PURE;
  2718. STDMETHOD (OnHttpEquiv)(THIS_ IShellView* psv, BOOL fDone, VARIANT* pvarargIn, VARIANT* pvarargOut) PURE;
  2719. STDMETHOD (GetPalette)( THIS_ HPALETTE * hpal ) PURE;
  2720. STDMETHOD (RegisterWindow)(THIS_ BOOL fUnregister, int swc) PURE;
  2721. // Warning! Do not add any new methods to this interface
  2722. // because IE4 shell32.dll uses it, so changing the interface
  2723. // breaks IE4 interop.
  2724. };
  2725. #define BSF_REGISTERASDROPTARGET 0x00000001
  2726. #define BSF_THEATERMODE 0x00000002
  2727. #define BSF_NOLOCALFILEWARNING 0x00000010
  2728. #define BSF_UISETBYAUTOMATION 0x00000100
  2729. #define BSF_RESIZABLE 0x00000200
  2730. #define BSF_CANMAXIMIZE 0x00000400
  2731. #define BSF_TOPBROWSER 0x00000800
  2732. #define BSF_NAVNOHISTORY 0x00001000
  2733. #define BSF_HTMLNAVCANCELED 0x00002000
  2734. #define BSF_DONTSHOWNAVCANCELPAGE 0x00004000
  2735. #define BSF_SETNAVIGATABLECODEPAGE 0x00008000
  2736. #define BSF_DELEGATEDNAVIGATION 0x00010000
  2737. #define TRAVELLOG_LOCALANCHOR 0x00000001
  2738. #define TRAVELLOG_FORCEUPDATE 0x00000002
  2739. #include <pshpack8.h>
  2740. typedef struct SToolbarItem {
  2741. IDockingWindow * ptbar;
  2742. BORDERWIDTHS rcBorderTool;
  2743. LPWSTR pwszItem;
  2744. BOOL fShow;
  2745. HMONITOR hMon;
  2746. } TOOLBARITEM, *LPTOOLBARITEM;
  2747. #define ITB_VIEW ((UINT)-1) // view
  2748. #include <poppack.h> /* Assume byte packing throughout */
  2749. struct tagFolderSetData;
  2750. // TEMPORARY. this is so that we don't have to keep writing dummy subs in basesb as we're
  2751. // building basesb2
  2752. DECLARE_INTERFACE_(IBrowserService2, IBrowserService)
  2753. {
  2754. // *** IUnknown methods ***
  2755. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2756. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2757. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2758. // *** IBrowserService specific methods ***
  2759. // TODO: break into 3 sections (outer, inner, and both/inherit)
  2760. STDMETHOD(GetParentSite)(THIS_ struct IOleInPlaceSite** ppipsite) PURE;
  2761. STDMETHOD(SetTitle)(THIS_ IShellView* psv, LPCWSTR pszName) PURE;
  2762. STDMETHOD(GetTitle)(THIS_ IShellView* psv, LPWSTR pszName, DWORD cchName) PURE;
  2763. STDMETHOD(GetOleObject)(THIS_ struct IOleObject** ppobjv) PURE;
  2764. // think about this one.. I'm not sure we want to expose this -- Chee
  2765. // My impression is that we won't document this whole interface???
  2766. STDMETHOD(GetTravelLog)(THIS_ ITravelLog** pptl) PURE;
  2767. STDMETHOD(ShowControlWindow)(THIS_ UINT id, BOOL fShow) PURE;
  2768. STDMETHOD(IsControlWindowShown)(THIS_ UINT id, BOOL *pfShown) PURE;
  2769. STDMETHOD(IEGetDisplayName)(THIS_ LPCITEMIDLIST pidl, LPWSTR pwszName, UINT uFlags) PURE;
  2770. STDMETHOD(IEParseDisplayName)(THIS_ UINT uiCP, LPCWSTR pwszPath, LPITEMIDLIST * ppidlOut) PURE;
  2771. STDMETHOD(DisplayParseError)(THIS_ HRESULT hres, LPCWSTR pwszPath) PURE;
  2772. STDMETHOD(NavigateToPidl)(THIS_ LPCITEMIDLIST pidl, DWORD grfHLNF) PURE;
  2773. STDMETHOD (SetNavigateState)(THIS_ BNSTATE bnstate) PURE;
  2774. STDMETHOD (GetNavigateState) (THIS_ BNSTATE *pbnstate) PURE;
  2775. STDMETHOD (NotifyRedirect) (THIS_ struct IShellView* psv, LPCITEMIDLIST pidl, BOOL *pfDidBrowse) PURE;
  2776. STDMETHOD (UpdateWindowList) (THIS) PURE;
  2777. STDMETHOD (UpdateBackForwardState) (THIS) PURE;
  2778. STDMETHOD(SetFlags)(THIS_ DWORD dwFlags, DWORD dwFlagMask) PURE;
  2779. STDMETHOD(GetFlags)(THIS_ DWORD *pdwFlags) PURE;
  2780. // Tells if it can navigate now or not.
  2781. STDMETHOD (CanNavigateNow) (THIS) PURE;
  2782. STDMETHOD (GetPidl) (THIS_ LPITEMIDLIST *ppidl) PURE;
  2783. STDMETHOD (SetReferrer) (THIS_ LPITEMIDLIST pidl) PURE;
  2784. STDMETHOD_(DWORD, GetBrowserIndex)(THIS) PURE;
  2785. STDMETHOD (GetBrowserByIndex)(THIS_ DWORD dwID, IUnknown **ppunk) PURE;
  2786. STDMETHOD (GetHistoryObject)(THIS_ IOleObject **ppole, IStream **pstm, IBindCtx **ppbc) PURE;
  2787. STDMETHOD (SetHistoryObject)(THIS_ IOleObject *pole, BOOL fIsLocalAnchor) PURE;
  2788. STDMETHOD (CacheOLEServer)(THIS_ IOleObject *pole) PURE;
  2789. STDMETHOD (GetSetCodePage)(THIS_ VARIANT* pvarIn, VARIANT* pvarOut) PURE;
  2790. STDMETHOD (OnHttpEquiv)(THIS_ IShellView* psv, BOOL fDone, VARIANT* pvarargIn, VARIANT* pvarargOut) PURE;
  2791. STDMETHOD (GetPalette)( THIS_ HPALETTE * hpal ) PURE;
  2792. STDMETHOD (RegisterWindow)(THIS_ BOOL fUnregister, int swc) PURE;
  2793. // Stuff added for shbrowse->shbrows2 split
  2794. // These remove "friend" functions and classes
  2795. //
  2796. STDMETHOD_(LRESULT, WndProcBS)(THIS_ HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  2797. STDMETHOD (SetAsDefFolderSettings)(THIS) PURE;
  2798. STDMETHOD (GetViewRect)(THIS_ RECT * prc) PURE;
  2799. STDMETHOD (OnSize)(THIS_ WPARAM wParam) PURE;
  2800. STDMETHOD (OnCreate)(THIS_ LPCREATESTRUCT pcs) PURE;
  2801. STDMETHOD_(LRESULT, OnCommand)(THIS_ WPARAM wParam, LPARAM lParam) PURE;
  2802. STDMETHOD (OnDestroy)(THIS ) PURE;
  2803. STDMETHOD_(LRESULT, OnNotify)(THIS_ NMHDR * pnm) PURE;
  2804. STDMETHOD (OnSetFocus)(THIS ) PURE;
  2805. STDMETHOD (OnFrameWindowActivateBS)(THIS_ BOOL fActive) PURE;
  2806. STDMETHOD (ReleaseShellView)(THIS ) PURE;
  2807. STDMETHOD (ActivatePendingView)(THIS ) PURE;
  2808. STDMETHOD (CreateViewWindow)(THIS_ IShellView* psvNew, IShellView* psvOld, LPRECT prcView, HWND* phwnd) PURE;
  2809. STDMETHOD (CreateBrowserPropSheetExt)(THIS_ REFIID riid, void **ppv) PURE;
  2810. // these could be base browser only interfaces
  2811. // they are not overridden by anyone, and perhaps only there for the aggregators to get info from the
  2812. // aggregatee. NOTE: where basesb calls these,
  2813. // it does NOT go through _pbsOuter
  2814. STDMETHOD (GetViewWindow)(THIS_ HWND * phwndView) PURE;
  2815. STDMETHOD (GetBaseBrowserData)(THIS_ LPCBASEBROWSERDATA * pbbd) PURE;
  2816. STDMETHOD_(LPBASEBROWSERDATA, PutBaseBrowserData)(THIS) PURE;
  2817. STDMETHOD (InitializeTravelLog)(THIS_ ITravelLog* ptl, DWORD dw) PURE;
  2818. STDMETHOD (SetTopBrowser)(THIS) PURE;
  2819. STDMETHOD (Offline)(THIS_ int iCmd) PURE;
  2820. STDMETHOD (AllowViewResize)(THIS_ BOOL f) PURE;
  2821. STDMETHOD (SetActivateState)(THIS_ UINT u) PURE;
  2822. STDMETHOD (UpdateSecureLockIcon)(THIS_ int eSecureLock) PURE;
  2823. STDMETHOD (InitializeDownloadManager)(THIS) PURE;
  2824. STDMETHOD (InitializeTransitionSite)(THIS) PURE;
  2825. STDMETHOD (_Initialize)(THIS_ HWND hwnd, IUnknown *pauto) PURE;
  2826. // BEGIN REVIEW: review names and need of each.
  2827. //
  2828. // this first set could be basebrowser only members. no one overrides
  2829. // NOTE: where basesb calls these, it does NOT go throug _pbsOuter
  2830. STDMETHOD (_CancelPendingNavigationAsync)(THIS) PURE;
  2831. STDMETHOD (_CancelPendingView)(THIS) PURE;
  2832. STDMETHOD (_MaySaveChanges)(THIS) PURE;
  2833. STDMETHOD (_PauseOrResumeView)(THIS_ BOOL fPaused) PURE;
  2834. STDMETHOD (_DisableModeless)(THIS) PURE;
  2835. // rethink these... are all of these necessary?
  2836. STDMETHOD (_NavigateToPidl)(THIS_ LPCITEMIDLIST pidl, DWORD grfHLNF, DWORD dwFlags)PURE;
  2837. STDMETHOD (_TryShell2Rename)(THIS_ IShellView* psv, LPCITEMIDLIST pidlNew)PURE;
  2838. STDMETHOD (_SwitchActivationNow)(THIS )PURE;
  2839. // this set is overridden and called thru _pbsOuter (and SUPER:_pbsInner)
  2840. STDMETHOD (_ExecChildren)(THIS_ IUnknown *punkBar, BOOL fBroadcast,
  2841. const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt,
  2842. VARIANTARG *pvarargIn, VARIANTARG *pvarargOut)PURE;
  2843. STDMETHOD (_SendChildren)(THIS_ HWND hwndBar, BOOL fBroadcast,
  2844. UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  2845. //END REVIEW:
  2846. // querying from the outer.
  2847. STDMETHOD (GetFolderSetData)(THIS_ struct tagFolderSetData* pfsd) PURE;
  2848. // Toolbar stuff is here temporarily. Eventually it will move out
  2849. // of basesb into commonsb, so I'm keeping the underscore "_"
  2850. // Except those noted below, none of these are overridden by
  2851. // outer guys, so no calls are made through _pbsOuter
  2852. STDMETHOD (_OnFocusChange)(THIS_ UINT itb) PURE;
  2853. STDMETHOD (v_ShowHideChildWindows)(THIS_ BOOL fChildOnly) PURE; // NOTE: overridden and called thru _pbsOuter
  2854. STDMETHOD_(UINT,_get_itbLastFocus)(THIS) PURE;
  2855. STDMETHOD (_put_itbLastFocus)(THIS_ UINT itbLastFocus) PURE;
  2856. STDMETHOD (_UIActivateView)(THIS_ UINT uState) PURE;
  2857. // Check the following functions
  2858. STDMETHOD (_GetViewBorderRect)(THIS_ RECT* prc) PURE;
  2859. STDMETHOD (_UpdateViewRectSize)(THIS) PURE;
  2860. STDMETHOD (_ResizeNextBorder)(THIS_ UINT itb) PURE;
  2861. STDMETHOD (_ResizeView)(THIS) PURE;
  2862. STDMETHOD (_GetEffectiveClientArea)(THIS_ LPRECT lprectBorder, HMONITOR hmon) PURE;
  2863. // Desktop needs to override this from commonsb
  2864. STDMETHOD_(IStream*,v_GetViewStream)(THIS_ LPCITEMIDLIST pidl, DWORD grfMode, LPCWSTR pwszName) PURE;
  2865. // Desktop needs access to these commonsb functions, they are not overridden:
  2866. STDMETHOD_(LRESULT,ForwardViewMsg)(THIS_ UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  2867. STDMETHOD (SetAcceleratorMenu)(THIS_ HACCEL hacc) PURE;
  2868. STDMETHOD_(int,_GetToolbarCount)(THIS) PURE;
  2869. STDMETHOD_(LPTOOLBARITEM,_GetToolbarItem)(THIS_ int itb) PURE;
  2870. STDMETHOD (_SaveToolbars)(THIS_ IStream* pstm) PURE;
  2871. STDMETHOD (_LoadToolbars)(THIS_ IStream* pstm) PURE;
  2872. STDMETHOD (_CloseAndReleaseToolbars)(THIS_ BOOL fClose) PURE;
  2873. STDMETHOD (v_MayGetNextToolbarFocus)(THIS_ LPMSG lpMsg, UINT itbNext, int citb, LPTOOLBARITEM * pptbi, HWND * phwnd) PURE;
  2874. STDMETHOD (_ResizeNextBorderHelper)(THIS_ UINT itb, BOOL bUseHmonitor) PURE;
  2875. STDMETHOD_(UINT,_FindTBar)(THIS_ IUnknown* punkSrc) PURE;
  2876. STDMETHOD (_SetFocus)(THIS_ LPTOOLBARITEM ptbi, HWND hwnd, LPMSG lpMsg) PURE;
  2877. STDMETHOD (v_MayTranslateAccelerator)(THIS_ MSG* pmsg) PURE;
  2878. STDMETHOD (_GetBorderDWHelper)(THIS_ IUnknown* punkSrc, LPRECT lprectBorder, BOOL bUseHmonitor) PURE;
  2879. // Shell browser needs to override this from basesb.
  2880. STDMETHOD (v_CheckZoneCrossing)(THIS_ LPCITEMIDLIST pidl) PURE;
  2881. };
  2882. DECLARE_INTERFACE_(IBrowserService3, IBrowserService2)
  2883. {
  2884. // *** IUnknown methods ***
  2885. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  2886. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  2887. STDMETHOD_(ULONG,Release) (THIS) PURE;
  2888. // *** IBrowserService specific methods ***
  2889. // TODO: break into 3 sections (outer, inner, and both/inherit)
  2890. STDMETHOD(GetParentSite)(THIS_ struct IOleInPlaceSite** ppipsite) PURE;
  2891. STDMETHOD(SetTitle)(THIS_ IShellView* psv, LPCWSTR pszName) PURE;
  2892. STDMETHOD(GetTitle)(THIS_ IShellView* psv, LPWSTR pszName, DWORD cchName) PURE;
  2893. STDMETHOD(GetOleObject)(THIS_ struct IOleObject** ppobjv) PURE;
  2894. // think about this one.. I'm not sure we want to expose this -- Chee
  2895. // My impression is that we won't document this whole interface???
  2896. STDMETHOD(GetTravelLog)(THIS_ ITravelLog** pptl) PURE;
  2897. STDMETHOD(ShowControlWindow)(THIS_ UINT id, BOOL fShow) PURE;
  2898. STDMETHOD(IsControlWindowShown)(THIS_ UINT id, BOOL *pfShown) PURE;
  2899. STDMETHOD(IEGetDisplayName)(THIS_ LPCITEMIDLIST pidl, LPWSTR pwszName, UINT uFlags) PURE;
  2900. STDMETHOD(IEParseDisplayName)(THIS_ UINT uiCP, LPCWSTR pwszPath, LPITEMIDLIST * ppidlOut) PURE;
  2901. STDMETHOD(DisplayParseError)(THIS_ HRESULT hres, LPCWSTR pwszPath) PURE;
  2902. STDMETHOD(NavigateToPidl)(THIS_ LPCITEMIDLIST pidl, DWORD grfHLNF) PURE;
  2903. STDMETHOD (SetNavigateState)(THIS_ BNSTATE bnstate) PURE;
  2904. STDMETHOD (GetNavigateState) (THIS_ BNSTATE *pbnstate) PURE;
  2905. STDMETHOD (NotifyRedirect) (THIS_ struct IShellView* psv, LPCITEMIDLIST pidl, BOOL *pfDidBrowse) PURE;
  2906. STDMETHOD (UpdateWindowList) (THIS) PURE;
  2907. STDMETHOD (UpdateBackForwardState) (THIS) PURE;
  2908. STDMETHOD(SetFlags)(THIS_ DWORD dwFlags, DWORD dwFlagMask) PURE;
  2909. STDMETHOD(GetFlags)(THIS_ DWORD *pdwFlags) PURE;
  2910. // Tells if it can navigate now or not.
  2911. STDMETHOD (CanNavigateNow) (THIS) PURE;
  2912. STDMETHOD (GetPidl) (THIS_ LPITEMIDLIST *ppidl) PURE;
  2913. STDMETHOD (SetReferrer) (THIS_ LPITEMIDLIST pidl) PURE;
  2914. STDMETHOD_(DWORD, GetBrowserIndex)(THIS) PURE;
  2915. STDMETHOD (GetBrowserByIndex)(THIS_ DWORD dwID, IUnknown **ppunk) PURE;
  2916. STDMETHOD (GetHistoryObject)(THIS_ IOleObject **ppole, IStream **pstm, IBindCtx **ppbc) PURE;
  2917. STDMETHOD (SetHistoryObject)(THIS_ IOleObject *pole, BOOL fIsLocalAnchor) PURE;
  2918. STDMETHOD (CacheOLEServer)(THIS_ IOleObject *pole) PURE;
  2919. STDMETHOD (GetSetCodePage)(THIS_ VARIANT* pvarIn, VARIANT* pvarOut) PURE;
  2920. STDMETHOD (OnHttpEquiv)(THIS_ IShellView* psv, BOOL fDone, VARIANT* pvarargIn, VARIANT* pvarargOut) PURE;
  2921. STDMETHOD (GetPalette)( THIS_ HPALETTE * hpal ) PURE;
  2922. STDMETHOD (RegisterWindow)(THIS_ BOOL fUnregister, int swc) PURE;
  2923. // Stuff added for shbrowse->shbrows2 split
  2924. // These remove "friend" functions and classes
  2925. //
  2926. STDMETHOD_(LRESULT, WndProcBS)(THIS_ HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  2927. STDMETHOD (SetAsDefFolderSettings)(THIS) PURE;
  2928. STDMETHOD (GetViewRect)(THIS_ RECT * prc) PURE;
  2929. STDMETHOD (OnSize)(THIS_ WPARAM wParam) PURE;
  2930. STDMETHOD (OnCreate)(THIS_ LPCREATESTRUCT pcs) PURE;
  2931. STDMETHOD_(LRESULT, OnCommand)(THIS_ WPARAM wParam, LPARAM lParam) PURE;
  2932. STDMETHOD (OnDestroy)(THIS ) PURE;
  2933. STDMETHOD_(LRESULT, OnNotify)(THIS_ NMHDR * pnm) PURE;
  2934. STDMETHOD (OnSetFocus)(THIS ) PURE;
  2935. STDMETHOD (OnFrameWindowActivateBS)(THIS_ BOOL fActive) PURE;
  2936. STDMETHOD (ReleaseShellView)(THIS ) PURE;
  2937. STDMETHOD (ActivatePendingView)(THIS ) PURE;
  2938. STDMETHOD (CreateViewWindow)(THIS_ IShellView* psvNew, IShellView* psvOld, LPRECT prcView, HWND* phwnd) PURE;
  2939. STDMETHOD (CreateBrowserPropSheetExt)(THIS_ REFIID riid, void **ppv) PURE;
  2940. // these could be base browser only interfaces
  2941. // they are not overridden by anyone, and perhaps only there for the aggregators to get info from the
  2942. // aggregatee. NOTE: where basesb calls these,
  2943. // it does NOT go through _pbsOuter
  2944. STDMETHOD (GetViewWindow)(THIS_ HWND * phwndView) PURE;
  2945. STDMETHOD (GetBaseBrowserData)(THIS_ LPCBASEBROWSERDATA * pbbd) PURE;
  2946. STDMETHOD_(LPBASEBROWSERDATA, PutBaseBrowserData)(THIS) PURE;
  2947. STDMETHOD (InitializeTravelLog)(THIS_ ITravelLog* ptl, DWORD dw) PURE;
  2948. STDMETHOD (SetTopBrowser)(THIS) PURE;
  2949. STDMETHOD (Offline)(THIS_ int iCmd) PURE;
  2950. STDMETHOD (AllowViewResize)(THIS_ BOOL f) PURE;
  2951. STDMETHOD (SetActivateState)(THIS_ UINT u) PURE;
  2952. STDMETHOD (UpdateSecureLockIcon)(THIS_ int eSecureLock) PURE;
  2953. STDMETHOD (InitializeDownloadManager)(THIS) PURE;
  2954. STDMETHOD (InitializeTransitionSite)(THIS) PURE;
  2955. STDMETHOD (_Initialize)(THIS_ HWND hwnd, IUnknown *pauto) PURE;
  2956. // BEGIN REVIEW: review names and need of each.
  2957. //
  2958. // this first set could be basebrowser only members. no one overrides
  2959. // NOTE: where basesb calls these, it does NOT go throug _pbsOuter
  2960. STDMETHOD (_CancelPendingNavigationAsync)(THIS) PURE;
  2961. STDMETHOD (_CancelPendingView)(THIS) PURE;
  2962. STDMETHOD (_MaySaveChanges)(THIS) PURE;
  2963. STDMETHOD (_PauseOrResumeView)(THIS_ BOOL fPaused) PURE;
  2964. STDMETHOD (_DisableModeless)(THIS) PURE;
  2965. // rethink these... are all of these necessary?
  2966. STDMETHOD (_NavigateToPidl)(THIS_ LPCITEMIDLIST pidl, DWORD grfHLNF, DWORD dwFlags)PURE;
  2967. STDMETHOD (_TryShell2Rename)(THIS_ IShellView* psv, LPCITEMIDLIST pidlNew)PURE;
  2968. STDMETHOD (_SwitchActivationNow)(THIS )PURE;
  2969. // this set is overridden and called thru _pbsOuter (and SUPER:_pbsInner)
  2970. STDMETHOD (_ExecChildren)(THIS_ IUnknown *punkBar, BOOL fBroadcast,
  2971. const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt,
  2972. VARIANTARG *pvarargIn, VARIANTARG *pvarargOut)PURE;
  2973. STDMETHOD (_SendChildren)(THIS_ HWND hwndBar, BOOL fBroadcast,
  2974. UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  2975. //END REVIEW:
  2976. // querying from the outer.
  2977. STDMETHOD (GetFolderSetData)(THIS_ struct tagFolderSetData* pfsd) PURE;
  2978. // Toolbar stuff is here temporarily. Eventually it will move out
  2979. // of basesb into commonsb, so I'm keeping the underscore "_"
  2980. // Except those noted below, none of these are overridden by
  2981. // outer guys, so no calls are made through _pbsOuter
  2982. STDMETHOD (_OnFocusChange)(THIS_ UINT itb) PURE;
  2983. STDMETHOD (v_ShowHideChildWindows)(THIS_ BOOL fChildOnly) PURE; // NOTE: overridden and called thru _pbsOuter
  2984. STDMETHOD_(UINT,_get_itbLastFocus)(THIS) PURE;
  2985. STDMETHOD (_put_itbLastFocus)(THIS_ UINT itbLastFocus) PURE;
  2986. STDMETHOD (_UIActivateView)(THIS_ UINT uState) PURE;
  2987. // Check the following functions
  2988. STDMETHOD (_GetViewBorderRect)(THIS_ RECT* prc) PURE;
  2989. STDMETHOD (_UpdateViewRectSize)(THIS) PURE;
  2990. STDMETHOD (_ResizeNextBorder)(THIS_ UINT itb) PURE;
  2991. STDMETHOD (_ResizeView)(THIS) PURE;
  2992. STDMETHOD (_GetEffectiveClientArea)(THIS_ LPRECT lprectBorder, HMONITOR hmon) PURE;
  2993. // Desktop needs to override this from commonsb
  2994. STDMETHOD_(IStream*,v_GetViewStream)(THIS_ LPCITEMIDLIST pidl, DWORD grfMode, LPCWSTR pwszName) PURE;
  2995. // Desktop needs access to these commonsb functions, they are not overridden:
  2996. STDMETHOD_(LRESULT,ForwardViewMsg)(THIS_ UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
  2997. STDMETHOD (SetAcceleratorMenu)(THIS_ HACCEL hacc) PURE;
  2998. STDMETHOD_(int,_GetToolbarCount)(THIS) PURE;
  2999. STDMETHOD_(LPTOOLBARITEM,_GetToolbarItem)(THIS_ int itb) PURE;
  3000. STDMETHOD (_SaveToolbars)(THIS_ IStream* pstm) PURE;
  3001. STDMETHOD (_LoadToolbars)(THIS_ IStream* pstm) PURE;
  3002. STDMETHOD (_CloseAndReleaseToolbars)(THIS_ BOOL fClose) PURE;
  3003. STDMETHOD (v_MayGetNextToolbarFocus)(THIS_ LPMSG lpMsg, UINT itbNext, int citb, LPTOOLBARITEM * pptbi, HWND * phwnd) PURE;
  3004. STDMETHOD (_ResizeNextBorderHelper)(THIS_ UINT itb, BOOL bUseHmonitor) PURE;
  3005. STDMETHOD_(UINT,_FindTBar)(THIS_ IUnknown* punkSrc) PURE;
  3006. STDMETHOD (_SetFocus)(THIS_ LPTOOLBARITEM ptbi, HWND hwnd, LPMSG lpMsg) PURE;
  3007. STDMETHOD (v_MayTranslateAccelerator)(THIS_ MSG* pmsg) PURE;
  3008. STDMETHOD (_GetBorderDWHelper)(THIS_ IUnknown* punkSrc, LPRECT lprectBorder, BOOL bUseHmonitor) PURE;
  3009. // Shell browser needs to override this from basesb.
  3010. STDMETHOD (v_CheckZoneCrossing)(THIS_ LPCITEMIDLIST pidl) PURE;
  3011. // IBrowserService3
  3012. STDMETHOD (_PositionViewWindow)(THIS_ HWND hwnd, LPRECT prc) PURE; // this was virtual in basesb/shbrowse, but missed this interface!
  3013. };
  3014. typedef enum
  3015. {
  3016. NAVDATA_DONTUPDATETRAVELLOG = 0x00000001,
  3017. NAVDATA_FRAMEWINDOW = 0x00000002,
  3018. NAVDATA_FRAMECREATION = 0x00000004,
  3019. NAVDATA_RESTARTLOAD = 0x00000008,
  3020. } ENUMNAVDATA;
  3021. typedef struct IHTMLWindow2 IHTMLWindow2;
  3022. #undef INTERFACE
  3023. #define INTERFACE ITridentService
  3024. DECLARE_INTERFACE_(ITridentService, IUnknown)
  3025. {
  3026. // *** IUnknown methods ***
  3027. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3028. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3029. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3030. // *** ITridentService specific methods ***
  3031. STDMETHOD(FireBeforeNavigate2)(THIS_
  3032. IDispatch * pDispatch,
  3033. LPCTSTR lpszUrl,
  3034. DWORD dwFlags,
  3035. LPCTSTR lpszFrameName,
  3036. LPBYTE pPostData,
  3037. DWORD cbPostData,
  3038. LPCTSTR lpszHeaders,
  3039. BOOL fPlayNavSound,
  3040. BOOL * pfCancel) PURE;
  3041. STDMETHOD(FireNavigateComplete2)(THIS_ IHTMLWindow2 * pHTMLWindow2,
  3042. DWORD dwFlags) PURE;
  3043. STDMETHOD(FireDownloadBegin)(THIS) PURE;
  3044. STDMETHOD(FireDownloadComplete)(THIS) PURE;
  3045. STDMETHOD(FireDocumentComplete)(THIS_
  3046. IHTMLWindow2 * pHTMLWindow,
  3047. DWORD dwFlags) PURE;
  3048. STDMETHOD(UpdateDesktopComponent)(THIS_ IHTMLWindow2 * pHTMLWindow) PURE;
  3049. STDMETHOD(GetPendingUrl)(THIS_ BSTR * pbstrPendingUrl) PURE;
  3050. STDMETHOD(ActiveElementChanged)(THIS_ IHTMLElement * pHTMLElement) PURE;
  3051. STDMETHOD(GetUrlSearchComponent)(THIS_ BSTR * pbstrSearch) PURE;
  3052. STDMETHOD(IsErrorUrl)(THIS_ LPCTSTR lpszUrl, BOOL *pfIsError) PURE;
  3053. };
  3054. #undef INTERFACE
  3055. #define INTERFACE ITridentService2
  3056. DECLARE_INTERFACE_(ITridentService2, ITridentService)
  3057. {
  3058. // *** ITridentService2 methods ***
  3059. STDMETHOD(AttachMyPics)(THIS_ void *pDoc2, void **ppMyPics) PURE;
  3060. STDMETHOD_(BOOL,ReleaseMyPics)(THIS_ void *pMyPics) PURE;
  3061. STDMETHOD(IsGalleryMeta)(THIS_ BOOL bFlag, void *pMyPics) PURE;
  3062. STDMETHOD(EmailPicture)(THIS_ BSTR bstrURL) PURE;
  3063. STDMETHOD(FireNavigateError)(THIS_ IHTMLWindow2 * pHTMLWindow2,
  3064. BSTR bstrURL,
  3065. BSTR bstrTargetFrameName,
  3066. DWORD dwStatusCode,
  3067. BOOL * pfCancel) PURE;
  3068. STDMETHOD(FirePrintTemplateEvent)(THIS_ IHTMLWindow2 * pHTMLWindow2,
  3069. DISPID dispidPrintEvent) PURE;
  3070. STDMETHOD(FireUpdatePageStatus)(THIS_ IHTMLWindow2 * pHTMLWindow2,
  3071. DWORD nPage,
  3072. BOOL fDone) PURE;
  3073. STDMETHOD(FirePrivacyImpactedStateChange)(THIS_ BOOL bPrivacyImpacted) PURE;
  3074. STDMETHOD(InitAutoImageResize)(THIS) PURE;
  3075. STDMETHOD(UnInitAutoImageResize)(THIS) PURE;
  3076. };
  3077. #undef INTERFACE
  3078. #define INTERFACE IWebBrowserPriv
  3079. DECLARE_INTERFACE_(IWebBrowserPriv, IUnknown)
  3080. {
  3081. // *** IUnknown methods ***
  3082. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3083. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3084. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3085. // *** IWebBrowserPriv specific methods ***
  3086. STDMETHOD(NavigateWithBindCtx)(THIS_ VARIANT *pvarUrl,
  3087. VARIANT *pvarFlags,
  3088. VARIANT *pvarTargetFrameName,
  3089. VARIANT *pvarPostData,
  3090. VARIANT *pvarHeaders,
  3091. IBindCtx * pBindCtx,
  3092. BSTR bstrLocation) PURE;
  3093. STDMETHOD(OnClose)(THIS) PURE;
  3094. };
  3095. // these MUST be listed in the same order a c_szPropNames in deskbar.cpp
  3096. typedef enum {
  3097. PROPDATA_SIDE = 0,
  3098. PROPDATA_MODE,
  3099. PROPDATA_LEFT,
  3100. PROPDATA_TOP,
  3101. PROPDATA_RIGHT,
  3102. PROPDATA_BOTTOM,
  3103. PROPDATA_DELETEABLE,
  3104. PROPDATA_X,
  3105. PROPDATA_Y,
  3106. PROPDATA_CX,
  3107. PROPDATA_CY,
  3108. PROPDATA_COUNT
  3109. } ENUMPROPDATA ;
  3110. // PROPDATA_MODE values:
  3111. // (aka. WBM_* -- webbar modes (_eMode))
  3112. #define WBM_BOTTOMMOST ((UINT) 0x0) // bottommost
  3113. #define WBM_TOPMOST ((UINT) 0x1) // topmost
  3114. #define WBM_FLOATING ((UINT) 0x2) // floating
  3115. #define WBM_NIL ((UINT) 0x7) // nil
  3116. #undef INTERFACE
  3117. #define INTERFACE IDockingBarPropertyBagInit
  3118. DECLARE_INTERFACE_(IDockingBarPropertyBagInit, IUnknown)
  3119. {
  3120. // *** IUnknown methods ***
  3121. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3122. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  3123. STDMETHOD_(ULONG,Release)(THIS) PURE;
  3124. // *** IDockingBarPropertyBag ***
  3125. STDMETHOD(SetDataDWORD)(THIS_ ENUMPROPDATA e, DWORD dwData) PURE;
  3126. } ;
  3127. #if (_WIN32_IE) >= 0x0400
  3128. //===========================================================================
  3129. // IAddressList private COmWindow interface. This should never be exposed.
  3130. #undef INTERFACE
  3131. #define INTERFACE IAddressList
  3132. DECLARE_INTERFACE_(IAddressList, IWinEventHandler)
  3133. {
  3134. // *** IUnknown methods ***
  3135. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3136. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3137. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3138. // *** IWinEventHandler Methods ***
  3139. STDMETHOD(OnWinEvent) (THIS_ HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* plres) PURE;
  3140. STDMETHOD(IsWindowOwner) (THIS_ HWND hwnd) PURE;
  3141. // *** IAddressList Methods ***
  3142. STDMETHOD(Connect) (THIS_ BOOL fConnect, HWND hwnd, IBrowserService* pbs, IBandProxy* pbp, IAutoComplete * pac) PURE;
  3143. STDMETHOD(NavigationComplete) (THIS_ void *pvCShellUrl) PURE;
  3144. STDMETHOD(Refresh) (THIS_ DWORD dwType) PURE;
  3145. STDMETHOD(Load) (THIS) PURE;
  3146. STDMETHOD(Save) (THIS) PURE;
  3147. STDMETHOD(SetToListIndex) (THIS_ int nIndex, void *pvShelLUrl) PURE;
  3148. STDMETHOD(FileSysChangeAL) (THIS_ DWORD dw, LPCITEMIDLIST *ppidl) PURE;
  3149. };
  3150. #endif
  3151. // DOC'ed for DOJ compliance
  3152. #endif
  3153. //===========================================================================
  3154. // IDwnCodePage: This is a private interface to pass codepage info.
  3155. #undef INTERFACE
  3156. #define INTERFACE IDwnCodePage
  3157. DECLARE_INTERFACE_(IDwnCodePage, IUnknown)
  3158. {
  3159. // *** IUnknown methods ***
  3160. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3161. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3162. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3163. // *** IDwnCodePage Methods ***
  3164. STDMETHOD_(UINT,GetCodePage) (THIS) PURE;
  3165. STDMETHOD(SetCodePage) (THIS_ UINT uiCP) PURE;
  3166. };
  3167. SHSTDAPI SHDllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv);
  3168. //===========================================================================
  3169. //----------------------------------------------------------------------------
  3170. #define IsLFNDriveORD 119
  3171. SHSTDAPI_(int) SHOutOfMemoryMessageBox(HWND hwndOwner, LPTSTR pszTitle, UINT fuStyle);
  3172. SHSTDAPI_(BOOL) SHWinHelp(HWND hwndMain, LPCTSTR pszHelp, UINT usCommand, ULONG_PTR ulData);
  3173. SHSTDAPI_(BOOL) RLBuildListOfPaths(void);
  3174. #ifdef WINNT
  3175. SHSTDAPI_(BOOL) RegenerateUserEnvironment(void **pPrevEnv, BOOL bSetCurrentEnv);
  3176. #endif
  3177. #define SHValidateUNCORD 173
  3178. // DOC'ed for DOJ compliance
  3179. //----------------------------------------------------------------------------
  3180. #define OleStrToStrNORD 78
  3181. #define SHCloneSpecialIDListORD 89
  3182. #define SHDllGetClassObjectORD 128
  3183. #define SHLogILFromFSILORD 95
  3184. #define SHMapPIDLToSystemImageListIndexORD 77
  3185. #define SHShellFolderView_MessageORD 73
  3186. #define Shell_GetImageListsORD 71
  3187. #define SHGetSpecialFolderPathORD 175
  3188. #define StrToOleStrNORD 79
  3189. #define ILCloneORD 18
  3190. #define ILCloneFirstORD 19
  3191. #define ILCombineORD 25
  3192. #define ILCreateFromPathORD 157
  3193. #define ILFindChildORD 24
  3194. #define ILFreeORD 155
  3195. #define ILGetNextORD 153
  3196. #define ILGetSizeORD 152
  3197. #define ILIsEqualORD 21
  3198. #define ILRemoveLastIDORD 17
  3199. #define PathAddBackslashORD 32
  3200. #define PathCombineORD 37
  3201. #define PathIsExeORD 43
  3202. #define PathMatchSpecORD 46
  3203. #define SHGetSetSettingsORD 68
  3204. #define SHILCreateFromPathORD 28
  3205. #define SHFreeORD 195
  3206. #define CheckWinIniForAssocsORD 711
  3207. // DOC'ed for DOJ Compliance
  3208. #ifndef WINNT
  3209. // Always usr TerminateThreadEx.
  3210. BOOL APIENTRY TerminateThreadEx(HANDLE hThread, DWORD dwExitCode, BOOL bCleanupFlag);
  3211. #define TerminateThread(hThread, dwExitCode) TerminateThreadEx(hThread, dwExitCode, TRUE)
  3212. #endif
  3213. // DOC'ed for DOJ Compliance
  3214. SHSTDAPI SHCreateSessionKey(REGSAM sam, HKEY *phkOut);
  3215. // Sortof Gross but if we pass this flag in with STGM_CREATE we will fail if file already exists
  3216. // with ERROR_ALREADY_EXISTS
  3217. #define CSOF_FAILIFTHERE 0x80000000L
  3218. //===========================================================================
  3219. // Structure for covert communication
  3220. // between shdocvw's CShellBrowser::Exec()
  3221. // and shell32's DefView WM_COMMAND handler
  3222. // NOTE: this structure is revealed in the KB
  3223. // (articles Q252610 and Q216954). So even though
  3224. // it's in a private section, treat it as public.
  3225. struct _DFVCMDDATA
  3226. {
  3227. HWND hwnd; // Browser hwnd
  3228. VARIANTARG *pva; // Args passed to Exec()
  3229. DWORD nCmdIDTranslated; // Replacement OLECMDID_* value
  3230. };
  3231. typedef struct _DFVCMDDATA DFVCMDDATA;
  3232. typedef struct _DFVCMDDATA *LPDFVCMDDATA;
  3233. typedef const struct _DFVCMDDATA *LPCDFVCMDDATA;
  3234. SHSTDAPI_(DWORD) SHGetProcessDword(DWORD idProcess, LONG iIndex);
  3235. SHSTDAPI_(BOOL) SHSetShellWindowEx(HWND hwnd, HWND hwndChild);
  3236. #define CCH_MENUMAX 80 // DOC: max size of a menu string
  3237. // WinEventHandler message ranges
  3238. #define MBHM_FIRST (0x00000001) // MenuBandHandler
  3239. #define MBHM_LAST (0x000000ff)
  3240. #define MSFM_FIRST (0x00000100) // MenuShellFolder
  3241. #define MSFM_LAST (0x000001ff)
  3242. #define FSFM_FIRST (0x00000200) // FileShellFolder
  3243. #define FSFM_LAST (0x000002ff)
  3244. //-------------------------------------------------------------------------
  3245. //
  3246. // SID_SMenuBandHandler
  3247. //
  3248. // The menuband calls QueryService(SID_SMenuBandHandler, IID_IWinEventHandler)
  3249. // on its shellfolder. If the shellfolder supports this service, the
  3250. // menuband will call the event handler on certain menu events. These
  3251. // events and messages are as follows:
  3252. //
  3253. // MBHM_INITMENUPOPUP sent when a drop-down menu or submenu is
  3254. // about to become active.
  3255. //
  3256. //
  3257. // File-system ShellFolder events:
  3258. //
  3259. // FSFM_COMMAND sent when a file-system item is executed
  3260. //
  3261. //-------------------------------------------------------------------------
  3262. typedef struct tagMBINITMENUPOPUP
  3263. {
  3264. DWORD dwMask; // MBIMP_*
  3265. IShellFolder * psf;
  3266. LPCITEMIDLIST pidl;
  3267. HMENU hmenu;
  3268. int iPos;
  3269. } MBINITMENUPOPUP;
  3270. #define MBIMP_HMENU 0x00000001 // hmenu and iPos are set
  3271. // Messages sent to the WinEventHandler wParam lParam *plRet
  3272. // ------ ------ ---
  3273. #define MBHM_INITMENUPOPUP (MBHM_FIRST+0) // 0 MBINITMENUPOPUP *
  3274. // Messages sent to the WinEventHandler wParam lParam *plRet
  3275. // ------ ------ ------
  3276. #define FSFM_COMMAND (FSFM_FIRST+0) // cmd ID pidl
  3277. //-------------------------------------------------------------------------
  3278. //
  3279. // IAugmentedShellFolder interface
  3280. //
  3281. // This provides methods to add multiple Shell Folder objects to a
  3282. // single augmented object (CLSID_AugmentedShellFolder), which will
  3283. // enumerate them as if they were in a single namespace.
  3284. //
  3285. //
  3286. // [Member functions]
  3287. //
  3288. // IAugmentedShellFolder::AddNameSpace(rguidObject, psf, pidl)
  3289. // Add the object represented by the IShellFolder interface to
  3290. // the augmented list. The rguidObject is used to identify the
  3291. // given object. It may be NULL. The optional pidl refers to
  3292. // the location of the psf.
  3293. //
  3294. // IAugmentedShellFolder::GetNameSpaceID(pidl, rguidOut)
  3295. // This method returns the rguidObject associated with the given
  3296. // pidl. This is how a caller can identify which namespace the
  3297. // pidl resides, given the list of IShellFolder objects that were
  3298. // added to this augmented object.
  3299. //
  3300. // IAugmentedShellFolder::QueryNameSpace(dwNameSpaceID, pguidOut, ppsf)
  3301. // Returns the shellfolder and guid associated with the given ID.
  3302. //
  3303. // IAugmentedShellFolder::EnumNameSpace(uNameSpace, pdwNameSpaceID)
  3304. // Enumerates the namespace shellfolders. If uNameSpace is -1,
  3305. // pdwNameSpaceID is ignored and this method returns the count of
  3306. // shellfolders in the augmented namespace. Call this method with
  3307. // uNameSpace starting at 0 to begin enumerating. Returns S_OK and
  3308. // and namespace ID in *pdwNameSpaceID.
  3309. //
  3310. //-------------------------------------------------------------------------
  3311. // IAugmentedShellFolder::AddNameSpace flags
  3312. enum
  3313. {
  3314. ASFF_DEFAULT = 0x00000000, // There are no applicable Flags
  3315. ASFF_SORTDOWN = 0x00000001, // Sort the items in this ISF to the bottom.
  3316. ASFF_MERGESAMEGUID = 0x00000002, // Merge only namespaces with the same pguidObjects
  3317. ASFF_COMMON = 0x00000004, // this is a "Common" or "All Users" folder
  3318. // the following should all be collapsed to one ASFF_DEFNAMESPACE
  3319. ASFF_DEFNAMESPACE_BINDSTG = 0x00000100, // The namespace is the default handler for BindToStorage() for merged child items.
  3320. ASFF_DEFNAMESPACE_COMPARE = 0x00000200, // The namespace is the default handler for CompareIDs() for merged child items.
  3321. ASFF_DEFNAMESPACE_VIEWOBJ = 0x00000400, // The namespace is the default handler for CreateViewObject() for merged child items.
  3322. ASFF_DEFNAMESPACE_ATTRIB = 0x00001800, // The namespace is the default handler for GetAttributesOf() for merged child items.
  3323. ASFF_DEFNAMESPACE_DISPLAYNAME = 0x00001000, // The namespace is the default handler for GetDisplayNameOf(), SetNameOf() and ParseDisplayName() for merged child items.
  3324. ASFF_DEFNAMESPACE_UIOBJ = 0x00002000, // The namespace is the default handler for GetUIObjectOf() for merged child items.
  3325. ASFF_DEFNAMESPACE_ITEMDATA = 0x00004000, // The namespace is the default handler for GetItemData() for merged child items.
  3326. ASFF_DEFNAMESPACE_ALL = 0x0000FF00 // The namespace is the primary handler for all IShellFolder operations on merged child items.
  3327. };
  3328. enum QUERYNAMESPACEINFO_MASK
  3329. {
  3330. ASFQNSI_FLAGS = 0x00000001,
  3331. ASFQNSI_FOLDER = 0x00000002,
  3332. ASFQNSI_GUID = 0x00000004,
  3333. ASFQNSI_PIDL = 0x00000008,
  3334. };
  3335. #include <pshpack8.h>
  3336. typedef struct QUERYNAMESPACEINFO
  3337. {
  3338. DWORD cbSize;
  3339. DWORD dwMask;
  3340. DWORD dwFlags; // ASFF_*
  3341. IShellFolder *psf;
  3342. GUID guidObject;
  3343. LPITEMIDLIST pidl;
  3344. } QUERYNAMESPACEINFO;
  3345. #include <poppack.h> /* Return to byte packing */
  3346. #undef INTERFACE
  3347. #define INTERFACE IAugmentedShellFolder
  3348. DECLARE_INTERFACE_(IAugmentedShellFolder, IShellFolder)
  3349. {
  3350. // *** IUnknown methods ***
  3351. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3352. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3353. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3354. // *** IShellFolder methods ***
  3355. STDMETHOD(ParseDisplayName) (THIS_ HWND hwndOwner,LPBC pbc, LPOLESTR pszDisplayName,
  3356. ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
  3357. STDMETHOD(EnumObjects) (THIS_ HWND hwndOwner, DWORD grfFlags, IEnumIDList ** ppenumIDList) PURE;
  3358. STDMETHOD(BindToObject) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  3359. STDMETHOD(BindToStorage) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  3360. STDMETHOD(CompareIDs) (THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  3361. STDMETHOD(CreateViewObject) (THIS_ HWND hwndOwner, REFIID riid, void **ppv) PURE;
  3362. STDMETHOD(GetAttributesOf) (THIS_ UINT cidl, LPCITEMIDLIST * apidl, ULONG * rgfInOut) PURE;
  3363. STDMETHOD(GetUIObjectOf) (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  3364. REFIID riid, UINT * prgfInOut, void **ppv) PURE;
  3365. STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
  3366. STDMETHOD(SetNameOf) (THIS_ HWND hwndOwner, LPCITEMIDLIST pidl,
  3367. LPCOLESTR pszName, DWORD uFlags,
  3368. LPITEMIDLIST * ppidlOut) PURE;
  3369. // *** IAugmentedShellFolder methods ***
  3370. STDMETHOD(AddNameSpace) (THIS_ const GUID * pguidObject, IShellFolder * psf,
  3371. LPCITEMIDLIST pidl, DWORD dwFlags) PURE;
  3372. STDMETHOD(GetNameSpaceID) (THIS_ LPCITEMIDLIST pidl, GUID * pguidOut) PURE;
  3373. STDMETHOD(QueryNameSpace) (THIS_ DWORD dwID, GUID * pguidOut, IShellFolder ** ppsf) PURE;
  3374. STDMETHOD(EnumNameSpace) (THIS_ DWORD uNameSpace, DWORD * pdwID) PURE;
  3375. };
  3376. #undef INTERFACE
  3377. #define INTERFACE IAugmentedShellFolder2
  3378. DECLARE_INTERFACE_(IAugmentedShellFolder2, IAugmentedShellFolder)
  3379. {
  3380. // *** IUnknown methods ***
  3381. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3382. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3383. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3384. // *** IShellFolder methods ***
  3385. STDMETHOD(ParseDisplayName) (THIS_ HWND hwndOwner, LPBC pbc, LPOLESTR pszDisplayName,
  3386. ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
  3387. STDMETHOD(EnumObjects) (THIS_ HWND hwndOwner, DWORD grfFlags, IEnumIDList ** ppenumIDList) PURE;
  3388. STDMETHOD(BindToObject) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  3389. STDMETHOD(BindToStorage) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  3390. STDMETHOD(CompareIDs) (THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  3391. STDMETHOD(CreateViewObject) (THIS_ HWND hwndOwner, REFIID riid, void **ppv) PURE;
  3392. STDMETHOD(GetAttributesOf) (THIS_ UINT cidl, LPCITEMIDLIST * apidl,
  3393. ULONG * rgfInOut) PURE;
  3394. STDMETHOD(GetUIObjectOf) (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  3395. REFIID riid, UINT * prgfInOut, void **ppv) PURE;
  3396. STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
  3397. STDMETHOD(SetNameOf) (THIS_ HWND hwndOwner, LPCITEMIDLIST pidl,
  3398. LPCOLESTR pszName, DWORD uFlags,
  3399. LPITEMIDLIST * ppidlOut) PURE;
  3400. // *** IAugmentedShellFolder methods ***
  3401. STDMETHOD(AddNameSpace) (THIS_ const GUID * pguidObject, IShellFolder * psf,
  3402. LPCITEMIDLIST pidl, DWORD dwFlags) PURE;
  3403. STDMETHOD(GetNameSpaceID) (THIS_ LPCITEMIDLIST pidl, GUID * pguidOut) PURE;
  3404. STDMETHOD(QueryNameSpace) (THIS_ DWORD dwID, GUID * pguidOut, IShellFolder ** ppsf) PURE;
  3405. STDMETHOD(EnumNameSpace) (THIS_ DWORD uNameSpace, DWORD * pdwID) PURE;
  3406. // *** IAugmentedShellFolder2 methods ***
  3407. STDMETHOD(UnWrapIDList) (THIS_ LPCITEMIDLIST pidlWrap, LONG cPidls, IShellFolder ** apsf, LPITEMIDLIST * apidlFolder, LPITEMIDLIST * apidlItems, LONG * pcFetched ) PURE ;
  3408. };
  3409. #undef INTERFACE
  3410. #define INTERFACE IAugmentedShellFolder3
  3411. DECLARE_INTERFACE_(IAugmentedShellFolder3, IAugmentedShellFolder2)
  3412. {
  3413. // *** IUnknown methods ***
  3414. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3415. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3416. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3417. // *** IShellFolder methods ***
  3418. STDMETHOD(ParseDisplayName) (THIS_ HWND hwndOwner, LPBC pbc, LPOLESTR pszDisplayName,
  3419. ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
  3420. STDMETHOD(EnumObjects) (THIS_ HWND hwndOwner, DWORD grfFlags, IEnumIDList ** ppenumIDList) PURE;
  3421. STDMETHOD(BindToObject) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  3422. STDMETHOD(BindToStorage) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  3423. STDMETHOD(CompareIDs) (THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  3424. STDMETHOD(CreateViewObject) (THIS_ HWND hwndOwner, REFIID riid, void **ppv) PURE;
  3425. STDMETHOD(GetAttributesOf) (THIS_ UINT cidl, LPCITEMIDLIST * apidl,
  3426. ULONG * rgfInOut) PURE;
  3427. STDMETHOD(GetUIObjectOf) (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  3428. REFIID riid, UINT * prgfInOut, void **ppv) PURE;
  3429. STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
  3430. STDMETHOD(SetNameOf) (THIS_ HWND hwndOwner, LPCITEMIDLIST pidl,
  3431. LPCOLESTR pszName, DWORD uFlags,
  3432. LPITEMIDLIST * ppidlOut) PURE;
  3433. // *** IAugmentedShellFolder methods ***
  3434. STDMETHOD(AddNameSpace) (THIS_ const GUID * pguidObject, IShellFolder * psf,
  3435. LPCITEMIDLIST pidl, DWORD dwFlags) PURE;
  3436. STDMETHOD(GetNameSpaceID) (THIS_ LPCITEMIDLIST pidl, GUID * pguidOut) PURE;
  3437. STDMETHOD(QueryNameSpace) (THIS_ DWORD dwID, GUID * pguidOut, IShellFolder ** ppsf) PURE;
  3438. STDMETHOD(EnumNameSpace) (THIS_ DWORD uNameSpace, DWORD * pdwID) PURE;
  3439. // *** IAugmentedShellFolder2 methods ***
  3440. STDMETHOD(UnWrapIDList) (THIS_ LPCITEMIDLIST pidlWrap, LONG cPidls, IShellFolder ** apsf, LPITEMIDLIST * apidlFolder, LPITEMIDLIST * apidlItems, LONG * pcFetched ) PURE ;
  3441. // *** IAugmentedShellFolder3 methods ***
  3442. STDMETHOD(QueryNameSpace2) (THIS_ DWORD dwID, QUERYNAMESPACEINFO *pqnsi) PURE;
  3443. };
  3444. //-------------------------------------------------------------------------
  3445. //
  3446. // IProxyShellFolder interface
  3447. //
  3448. // This provides methods to set a proxy object which can respond
  3449. // to GetUIObjectOf instead of or in addition to the hosted object
  3450. // the supports IShellFolder. All other methods are forwarded onto
  3451. // the hosted object. The CLSID_HostProxyShellFolder object implements
  3452. // this interface.
  3453. //
  3454. // The Win95 shell does not support aggregation, so this object
  3455. // must be extra careful that it follows the rules of COM.
  3456. //
  3457. // This interface is implemented by an object that wishes to provide
  3458. // more support for GetUIObjectOf on behalf of another object that
  3459. // implements an original IShellFolder.
  3460. //
  3461. // [Member functions]
  3462. //
  3463. // IProxyShellFolder::InitHostProxy(psf, pidl, punk, dwFlags)
  3464. // Set the object that implements IProxyShellFolder. Depending
  3465. // on dwFlags, this object will be called instead of or in addition
  3466. // to the host's method.
  3467. //
  3468. // SPF_PRIORITY - call the proxy's method instead of
  3469. // the host's method.
  3470. // SPF_SECONDARY - call the proxy's method only if the
  3471. // host's method doesn't support it.
  3472. // SPF_INHERIT - create a new object of this class and
  3473. // hand it back for BindToObject.
  3474. // SPF_FOLDERPRECEDENCE - have the proxy give folders priority
  3475. // over files in a call to CompareIDs.
  3476. // SPF_HAVECALLBACK - have the proxy call the owner's
  3477. // IOleCommandTarget on each enumerated
  3478. // object, for filtering.
  3479. //
  3480. // Also sets as the host the given object which fully implements
  3481. // IShellFolder. pidl refers to the shell folder.
  3482. //
  3483. // IProxyShellFolder::CloneProxyPSF(riid, ppv)
  3484. // Tells the object to clone itself. The host proxy will call this
  3485. // whenever IShellFolder::BindToObject is called.
  3486. //
  3487. // IProxyShellFolder::GetUIObjectOfPSF(hwndOwner, cidl, apidl, riid, prgfInOut, ppv)
  3488. // Called by CLSID_HostProxyShellFolder to allow the proxy object
  3489. // an opportunity to respond.
  3490. //
  3491. // IProxyShellFolder::CreateViewObjectPSF(hwndOwner, riid, ppv)
  3492. // Called by CLSID_HostProxyShellFolder to allow the proxy object
  3493. // an opportunity to respond.
  3494. //
  3495. //-------------------------------------------------------------------------
  3496. // SetProxyObject flags
  3497. #define SPF_PRIORITY 0x00000001 // This is mutually exclusive w/ SPF_SECONDARY
  3498. #define SPF_SECONDARY 0x00000002
  3499. #define SPF_INHERIT 0x00000004
  3500. #define SPF_FOLDERPRECEDENCE 0x00000008
  3501. #define SPF_HAVECALLBACK 0x00000010
  3502. //For filtering of Pidls
  3503. #define PHID_FilterOutPidl 0
  3504. #undef INTERFACE
  3505. #define INTERFACE IProxyShellFolder
  3506. DECLARE_INTERFACE_(IProxyShellFolder, IShellFolder)
  3507. {
  3508. // *** IUnknown methods ***
  3509. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3510. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3511. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3512. // *** IShellFolder methods ***
  3513. STDMETHOD(ParseDisplayName) (THIS_ HWND hwndOwner, LPBC pbc, LPOLESTR pszDisplayName,
  3514. ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
  3515. STDMETHOD(EnumObjects) (THIS_ HWND hwndOwner, DWORD grfFlags, IEnumIDList ** ppenumIDList) PURE;
  3516. STDMETHOD(BindToObject) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  3517. STDMETHOD(BindToStorage) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  3518. STDMETHOD(CompareIDs) (THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  3519. STDMETHOD(CreateViewObject) (THIS_ HWND hwndOwner, REFIID riid, void **ppv) PURE;
  3520. STDMETHOD(GetAttributesOf) (THIS_ UINT cidl, LPCITEMIDLIST * apidl,
  3521. ULONG * rgfInOut) PURE;
  3522. STDMETHOD(GetUIObjectOf) (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  3523. REFIID riid, UINT * prgfInOut, void **ppv) PURE;
  3524. STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
  3525. STDMETHOD(SetNameOf) (THIS_ HWND hwndOwner, LPCITEMIDLIST pidl,
  3526. LPCOLESTR pszName, DWORD uFlags,
  3527. LPITEMIDLIST * ppidlOut) PURE;
  3528. // *** IProxyShellFolder methods ***
  3529. STDMETHOD(InitHostProxy) (THIS_ IShellFolder * psf, LPCITEMIDLIST pidl, DWORD dwFlags) PURE;
  3530. STDMETHOD(CloneProxyPSF) (THIS_ REFIID riid, void **ppv) PURE;
  3531. STDMETHOD(GetUIObjectOfPSF) (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  3532. REFIID riid, UINT * prgfInOut, void **ppv) PURE;
  3533. STDMETHOD(CreateViewObjectPSF) (THIS_ HWND hwndOwner, REFIID riid, void **ppv) PURE;
  3534. };
  3535. //-------------------------------------------------------------------------
  3536. //
  3537. // IMenuShellFolder interface
  3538. //
  3539. // This wraps a static HMENU with an IShellFolder interface.
  3540. //
  3541. //
  3542. // [Member functions]
  3543. //
  3544. // IMenuShellFolder::SetMenu(hmenu)
  3545. // Specifies the hmenu to wrap. This may be NULL.
  3546. //
  3547. // IMenuShellFolder::GetMenu(phmenu)
  3548. // Returns the current menu in *phmenu. Returns S_FALSE if no menu is
  3549. // set (*phmenu will be NULL).
  3550. //
  3551. // IMenuShellFolder::SetWindow(hwndOwner)
  3552. // Specifies the window owner. This may be NULL.
  3553. //
  3554. //-------------------------------------------------------------------------
  3555. // Messages sent to the WinEventHandler wParam lParam *plRet
  3556. // ------ ------ ---
  3557. #define MSFM_COMMAND (MSFM_FIRST+0) // cmd ID 0
  3558. #define MSFM_ISDROPTARGET (MSFM_FIRST+1) // id 0 1 if yes
  3559. #undef INTERFACE
  3560. #define INTERFACE IMenuShellFolder
  3561. DECLARE_INTERFACE_(IMenuShellFolder, IShellFolder)
  3562. {
  3563. // *** IUnknown methods ***
  3564. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3565. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3566. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3567. // *** IShellFolder methods ***
  3568. STDMETHOD(ParseDisplayName) (THIS_ HWND hwndOwner, LPBC pbc, LPOLESTR pszDisplayName,
  3569. ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
  3570. STDMETHOD(EnumObjects) (THIS_ HWND hwndOwner, DWORD grfFlags, IEnumIDList ** ppenumIDList) PURE;
  3571. STDMETHOD(BindToObject) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  3572. STDMETHOD(BindToStorage) (THIS_ LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv) PURE;
  3573. STDMETHOD(CompareIDs) (THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  3574. STDMETHOD(CreateViewObject) (THIS_ HWND hwndOwner, REFIID riid, void **ppv) PURE;
  3575. STDMETHOD(GetAttributesOf) (THIS_ UINT cidl, LPCITEMIDLIST * apidl,
  3576. ULONG * rgfInOut) PURE;
  3577. STDMETHOD(GetUIObjectOf) (THIS_ HWND hwndOwner, UINT cidl, LPCITEMIDLIST * apidl,
  3578. REFIID riid, UINT * prgfInOut, void **ppv) PURE;
  3579. STDMETHOD(GetDisplayNameOf) (THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
  3580. STDMETHOD(SetNameOf) (THIS_ HWND hwndOwner, LPCITEMIDLIST pidl,
  3581. LPCOLESTR pszName, DWORD uFlags,
  3582. LPITEMIDLIST * ppidlOut) PURE;
  3583. // *** IMenuShellFolder methods ***
  3584. STDMETHOD(SetMenu) (THIS_ HMENU hmenu) PURE;
  3585. STDMETHOD(GetMenu) (THIS_ HMENU * phmenu) PURE;
  3586. STDMETHOD(SetWindow) (THIS_ HWND hwndOwner) PURE;
  3587. STDMETHOD(GetWindow) (THIS_ HWND *phwndOwner) PURE;
  3588. STDMETHOD(GetIDPosition) (THIS_ LPCITEMIDLIST pidl, int * pnPos) PURE;
  3589. };
  3590. //-------------------------------------------------------------------------
  3591. //
  3592. // ITranslateShellChangeNotify interface
  3593. //
  3594. // This interface allows an object to translate the pidls that are
  3595. // passed to it.
  3596. //
  3597. // Note: IE4 had an interface of the same name but with a different IID,
  3598. // so there is no conflict.
  3599. //
  3600. // [Member functions]
  3601. //
  3602. // ITranslateShellChangeNotify::TranslateIDs(&lEvent, pidl1, pidl2, ppidlOut1, ppidlOut2)
  3603. // Return converted pidls given the event. it also can change the event if appropriate
  3604. //
  3605. //-------------------------------------------------------------------------
  3606. #undef INTERFACE
  3607. #define INTERFACE ITranslateShellChangeNotify
  3608. DECLARE_INTERFACE_(ITranslateShellChangeNotify, IUnknown)
  3609. {
  3610. // *** IUnknown methods ***
  3611. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3612. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3613. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3614. // *** ITranslateShellChangeNotify methods ***
  3615. STDMETHOD(TranslateIDs) (THIS_ LONG *plEvent , LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2, LPITEMIDLIST * ppidlOut1, LPITEMIDLIST * ppidlOut2,
  3616. LONG *plEvent2, LPITEMIDLIST * ppidlOut1Event2, LPITEMIDLIST * ppidlOut2Event2) PURE;
  3617. STDMETHOD(IsChildID)(THIS_ LPCITEMIDLIST pidlKid, BOOL fImmediate) PURE;
  3618. STDMETHOD(IsEqualID)(THIS_ LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
  3619. STDMETHOD(Register)(THIS_ HWND hwnd, UINT uMsg, long lEvents) PURE;
  3620. STDMETHOD(Unregister)(THIS) PURE;
  3621. };
  3622. ////////////////////////////////////////////////////
  3623. //
  3624. // IRegTreeOptions
  3625. //
  3626. typedef enum tagBUTTON_STATES
  3627. {
  3628. IDCHECKED,
  3629. IDUNCHECKED,
  3630. IDRADIOON,
  3631. IDRADIOOFF,
  3632. IDUNKNOWN
  3633. } BUTTON_STATES;
  3634. //
  3635. // Avoid conflicts in the windows\shell project
  3636. //
  3637. #ifndef NO_SHELL_TREE_TYPE
  3638. typedef enum tagTREE_TYPE
  3639. {
  3640. TREE_CHECKBOX,
  3641. TREE_RADIO,
  3642. TREE_GROUP,
  3643. TREE_UNKNOWN
  3644. } TREE_TYPE;
  3645. #endif // NO_SHELL_TREE_TYPE
  3646. typedef enum tagWALK_TREE_CMD
  3647. {
  3648. WALK_TREE_SAVE,
  3649. WALK_TREE_DELETE,
  3650. WALK_TREE_RESTORE,
  3651. WALK_TREE_REFRESH
  3652. } WALK_TREE_CMD;
  3653. enum REG_CMD
  3654. {
  3655. REG_SET,
  3656. REG_GET,
  3657. REG_GETDEFAULT
  3658. };
  3659. #undef INTERFACE
  3660. #define INTERFACE IRegTreeOptions
  3661. DECLARE_INTERFACE_(IRegTreeOptions, IUnknown)
  3662. {
  3663. // *** IUnknown methods ***
  3664. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3665. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3666. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3667. // *** IRegTreeOptions specific methods ***
  3668. STDMETHOD(InitTree)(THIS_ HWND hwndTree, HKEY hkeyRoot, LPCSTR pszRegKey, LPCSTR pszParam) PURE;
  3669. STDMETHOD(WalkTree)(THIS_ WALK_TREE_CMD cmd ) PURE;
  3670. STDMETHOD(ToggleItem)(THIS_ HTREEITEM hti ) PURE;
  3671. STDMETHOD(ShowHelp)(THIS_ HTREEITEM hti , DWORD dwFlags ) PURE;
  3672. };
  3673. //
  3674. // Interface: IShellHotKey
  3675. //
  3676. #undef INTERFACE
  3677. #define INTERFACE IShellHotKey
  3678. DECLARE_INTERFACE_(IShellHotKey, IUnknown)
  3679. {
  3680. // *** IUnknown methods ***
  3681. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3682. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3683. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3684. // *** IShellHotKey methods ***
  3685. STDMETHOD(RegisterHotKey)(THIS_ IShellFolder * psf, LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidl) PURE;
  3686. };
  3687. //
  3688. // Interface: ITrayPriv
  3689. //
  3690. // Purpose: Talks to the new Start Menu code in Shdocvw from explorer.exe
  3691. //
  3692. // For flags on ShowFolder see inc\IETHREAD.H
  3693. //
  3694. #undef INTERFACE
  3695. #define INTERFACE ITrayPriv
  3696. DECLARE_INTERFACE_(ITrayPriv, IOleWindow)
  3697. {
  3698. // *** IUnknown methods ***
  3699. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3700. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3701. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3702. // *** IOleWindow methods ***
  3703. STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  3704. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  3705. // *** ITrayPriv methods ***
  3706. STDMETHOD(ExecItem)(THIS_ IShellFolder* psf, LPCITEMIDLIST pidl) PURE;
  3707. STDMETHOD(GetFindCM)(THIS_ HMENU hmenu, UINT idFirst, UINT idLast, IContextMenu** ppcmFind) PURE;
  3708. STDMETHOD(GetStaticStartMenu)(THIS_ HMENU* phmenu) PURE;
  3709. };
  3710. // ITrayPriv2 - new for Whistler
  3711. //
  3712. // Purpose: Allows Explorer Start Menu object to participate in customdraw.
  3713. //
  3714. #undef INTERFACE
  3715. #define INTERFACE ITrayPriv2
  3716. DECLARE_INTERFACE_(ITrayPriv2, ITrayPriv)
  3717. {
  3718. // *** IUnknown methods ***
  3719. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3720. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3721. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3722. // *** IOleWindow methods ***
  3723. STDMETHOD(GetWindow) (THIS_ HWND * lphwnd) PURE;
  3724. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  3725. // *** ITrayPriv methods ***
  3726. STDMETHOD(ExecItem)(THIS_ IShellFolder* psf, LPCITEMIDLIST pidl) PURE;
  3727. STDMETHOD(GetFindCM)(THIS_ HMENU hmenu, UINT idFirst, UINT idLast, IContextMenu** ppcmFind) PURE;
  3728. STDMETHOD(GetStaticStartMenu)(THIS_ HMENU* phmenu) PURE;
  3729. // *** ITrayPriv2 methods ***
  3730. STDMETHOD(ModifySMInfo)(THIS_ IN LPSMDATA psmd, IN OUT SMINFO *psminfo) PURE;
  3731. };
  3732. //
  3733. // Interface: IFolderShortcutConvert
  3734. //
  3735. // Purpose: Converts between FolderShortcuts and links
  3736. //
  3737. #undef INTERFACE
  3738. #define INTERFACE IFolderShortcutConvert
  3739. DECLARE_INTERFACE_(IFolderShortcutConvert, IUnknown)
  3740. {
  3741. // *** IUnknown methods ***
  3742. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3743. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  3744. STDMETHOD_(ULONG,Release)(THIS) PURE;
  3745. //*** IFolderShortcutConvert methods ***
  3746. STDMETHOD(ConvertToLink)(THIS_ LPCOLESTR pszFSPath, DWORD fFlags) PURE;
  3747. STDMETHOD(ConvertToFolderShortcut)(THIS_ LPCOLESTR pszLinkPath, DWORD fFlags) PURE;
  3748. };
  3749. //
  3750. // Interface: IShellFolderTask
  3751. //
  3752. // Purpose: Initializes a task that does something by enumerating a shellfolder
  3753. //
  3754. #undef INTERFACE
  3755. #define INTERFACE IShellFolderTask
  3756. DECLARE_INTERFACE_(IShellFolderTask, IUnknown)
  3757. {
  3758. // *** IUnknown methods ***
  3759. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3760. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  3761. STDMETHOD_(ULONG,Release)(THIS) PURE;
  3762. // *** IShellFolderTask methods ***
  3763. STDMETHOD(InitTaskSFT)(THIS_ IShellFolder *psfParent, LPITEMIDLIST pidlFull,
  3764. LONG nMaxRecursionLevel, DWORD dwFlags, DWORD dwTaskPriority) PURE;
  3765. };
  3766. // Flags for InitTaskSFT
  3767. #define ITSFT_RECURSE 0x00000001 // recurse into subfolders
  3768. //
  3769. // Interface: IStartMenuTask
  3770. //
  3771. // Purpose: Initializes a task that does something for the start menu
  3772. //
  3773. #undef INTERFACE
  3774. #define INTERFACE IStartMenuTask
  3775. DECLARE_INTERFACE_(IStartMenuTask, IShellFolderTask)
  3776. {
  3777. // *** IUnknown methods ***
  3778. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  3779. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  3780. STDMETHOD_(ULONG,Release)(THIS) PURE;
  3781. // *** IShellFolderTask methods ***
  3782. STDMETHOD(InitTaskSFT)(THIS_ IShellFolder *psfParent, LPITEMIDLIST pidlFull,
  3783. LONG nMaxRecursionLevel, DWORD dwFlags, DWORD dwTaskPriority) PURE;
  3784. // *** IStartMenuTask methods ***
  3785. STDMETHOD(InitTaskSMT)(THIS_ IShellHotKey * photkey, int iThreadPriority) PURE;
  3786. };
  3787. //
  3788. // Interface: IContextMenuCB
  3789. //
  3790. // Purpose: A call defview context menu callback object
  3791. //
  3792. #undef INTERFACE
  3793. #define INTERFACE IContextMenuCB
  3794. DECLARE_INTERFACE_(IContextMenuCB, IUnknown)
  3795. {
  3796. // *** IUnknown methods ***
  3797. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3798. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3799. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3800. // *** IContextMenuCB methods ***
  3801. STDMETHOD(CallBack) (THIS_ IShellFolder *psf, HWND hwndOwner, IDataObject *pdtobj, UINT uMsg,
  3802. WPARAM wParam, LPARAM lParam) PURE;
  3803. };
  3804. //
  3805. // Possible underline settings for shell icons.
  3806. //
  3807. enum
  3808. {
  3809. ICON_YES,
  3810. ICON_NO,
  3811. ICON_HOVER,
  3812. ICON_IE // Use IE hyperlink settings
  3813. };
  3814. //-----------------------------------------------
  3815. // IOleCommand Target Command IDs
  3816. // CGID_BandHandler
  3817. // Get the order stream from parent.
  3818. #define BHCMDID_GetOrderStream 0x00000001
  3819. // CGID_Persist
  3820. // Set the storage key.
  3821. #define MCBID_SetKey 0x00000001
  3822. // CGID_MenuBandItem
  3823. #define MBICMDID_IsVisible 0x00000001
  3824. // CGID_MenuBand
  3825. #define MBANDCID_REFRESH 0x10000000
  3826. //
  3827. // Interface: IShellMallocSpy
  3828. //
  3829. // Purpose: Facilitate IMallocSpy in the shell
  3830. //
  3831. #undef INTERFACE
  3832. #define INTERFACE IShellMallocSpy
  3833. DECLARE_INTERFACE_(IShellMallocSpy, IUnknown)
  3834. {
  3835. // *** IUnknown methods ***
  3836. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3837. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3838. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3839. // *** IShellMallocSpy methods ***
  3840. STDMETHOD(RegisterSpy) (THIS) PURE;
  3841. STDMETHOD(RevokeSpy) (THIS) PURE;
  3842. STDMETHOD(SetTracking) (THIS_ BOOL bTrack) PURE;
  3843. STDMETHOD(AddToList) (THIS_ void *pv, SIZE_T cb) PURE;
  3844. STDMETHOD(RemoveFromList) (THIS_ void *pv) PURE;
  3845. };
  3846. #undef INTERFACE
  3847. #define INTERFACE ISearchProvider
  3848. DECLARE_INTERFACE_(ISearchProvider, IUnknown)
  3849. {
  3850. // *** IUnknown methods ***
  3851. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3852. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3853. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3854. // *** ISearchObject methods ***
  3855. STDMETHOD(GetSearchGUID)(THIS_ LPGUID lpGuid) PURE;
  3856. };
  3857. #undef INTERFACE
  3858. #define INTERFACE ISearchItems
  3859. DECLARE_INTERFACE_(ISearchItems, IUnknown)
  3860. {
  3861. // *** IUnknown methods ***
  3862. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3863. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3864. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3865. // *** ISearchItems methods ***
  3866. //used by CSearchBand
  3867. STDMETHOD(GetDefaultSearchUrl) (THIS_ LPWSTR pwzUrl, UINT cch) PURE;
  3868. };
  3869. #undef INTERFACE
  3870. #define INTERFACE ISearchBandTBHelper50
  3871. DECLARE_INTERFACE_(ISearchBandTBHelper50, IUnknown)
  3872. {
  3873. // *** IUnknown methods ***
  3874. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3875. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3876. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3877. // *** ISearchBandTBHelper50 methods ***
  3878. // implemented by CSearchBand
  3879. STDMETHOD(AddNextMenuItem) (THIS_ LPCWSTR pwszText, int idItem) PURE;
  3880. STDMETHOD(SetOCCallback) (THIS_ IOleCommandTarget *pOleCmdTarget) PURE;
  3881. STDMETHOD(ResetNextMenu) (THIS) PURE;
  3882. };
  3883. #undef INTERFACE
  3884. #define INTERFACE ISearchBandTBHelper
  3885. DECLARE_INTERFACE_(ISearchBandTBHelper, IUnknown)
  3886. {
  3887. // *** IUnknown methods ***
  3888. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3889. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3890. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3891. // *** ISearchBandTBHelper methods ***
  3892. // implemented by CSearchBand
  3893. STDMETHOD(AddNextMenuItem) (THIS_ LPCWSTR pwszText, int idItem) PURE;
  3894. STDMETHOD(SetOCCallback) (THIS_ IOleCommandTarget *pOleCmdTarget) PURE;
  3895. STDMETHOD(ResetNextMenu) (THIS) PURE;
  3896. STDMETHOD(NavigateToPidl) (THIS_ LPCITEMIDLIST pidl) PURE;
  3897. };
  3898. #undef INTERFACE
  3899. #define INTERFACE IEnumUrlSearch
  3900. #include <pshpack8.h>
  3901. typedef struct
  3902. {
  3903. GUID guid;
  3904. WCHAR wszName[80];
  3905. WCHAR wszUrl[2048];
  3906. } URLSEARCH, *LPURLSEARCH;
  3907. #include <poppack.h> /* Return to byte packing */
  3908. DECLARE_INTERFACE_(IEnumUrlSearch, IUnknown)
  3909. {
  3910. // *** IUnknown methods ***
  3911. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE;
  3912. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3913. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3914. // *** IEnumUrlSearch methods ***
  3915. STDMETHOD(Next)(THIS_ ULONG celt, LPURLSEARCH rgelt, ULONG *pceltFetched) PURE;
  3916. STDMETHOD(Skip)(THIS_ ULONG celt) PURE;
  3917. STDMETHOD(Reset)(THIS) PURE;
  3918. STDMETHOD(Clone)(THIS_ IEnumUrlSearch **ppenum) PURE;
  3919. };
  3920. #undef INTERFACE
  3921. #define INTERFACE IFolderSearches
  3922. DECLARE_INTERFACE_(IFolderSearches, IUnknown)
  3923. {
  3924. // *** IUnknown methods ***
  3925. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppvObj) PURE;
  3926. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3927. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3928. // *** IFolderSearches methods ***
  3929. STDMETHOD(EnumSearches) (THIS_ IEnumUrlSearch **ppenum) PURE;
  3930. STDMETHOD(DefaultSearch) (THIS_ GUID *pguid) PURE;
  3931. };
  3932. #undef INTERFACE
  3933. #define INTERFACE IUserAssist
  3934. typedef struct
  3935. {
  3936. DWORD cbSize; // SIZEOF
  3937. DWORD dwMask; // INOUT requested/given (UEIM_*)
  3938. int cHit; // profile count
  3939. DWORD dwAttrs; // attributes (UEIA_*)
  3940. FILETIME ftExecute; // Last execute filetime
  3941. } UEMINFO, *LPUEMINFO;
  3942. #define UEIM_HIT 0x01
  3943. #define UEIM_FILETIME 0x02
  3944. DECLARE_INTERFACE_(IUserAssist, IUnknown)
  3945. {
  3946. // *** IUnknown methods ***
  3947. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3948. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3949. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3950. // *** IUserAssist methods ***
  3951. STDMETHOD(FireEvent)(THIS_ const GUID *pguidGrp, int eCmd, DWORD dwFlags, WPARAM wParam, LPARAM lParam) PURE;
  3952. STDMETHOD(QueryEvent)(THIS_ const GUID *pguidGrp, int eCmd, WPARAM wParam, LPARAM lParam, LPUEMINFO pui) PURE;
  3953. STDMETHOD(SetEvent)(THIS_ const GUID *pguidGrp, int eCmd, WPARAM wParam, LPARAM lParam, LPUEMINFO pui) PURE;
  3954. };
  3955. // This exists for the Internet Control Panel to be able to toggle who is the
  3956. // currently installed handler for FTP for the browser.
  3957. DECLARE_INTERFACE_(IFtpInstaller, IUnknown)
  3958. {
  3959. // *** IUnknown methods ***
  3960. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  3961. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  3962. STDMETHOD_(ULONG,Release) (THIS) PURE;
  3963. // *** IFtpInstaller methods ***
  3964. STDMETHOD(IsIEDefautlFTPClient)(THIS) PURE;
  3965. STDMETHOD(RestoreFTPClient)(THIS) PURE;
  3966. STDMETHOD(MakeIEDefautlFTPClient)(THIS) PURE;
  3967. };
  3968. // DOC'ed for DOJ compliance
  3969. #define CLR_MYINVALID 0x8fffffff // I need to use a special value since CLR_INVALID == CLR_NONE!!!!
  3970. #define ISVALIDCOLOR(a) ((a) != CLR_MYINVALID)
  3971. // The following are used as indexes into the crCustomColors array.
  3972. #define CRID_CUSTOMTEXTBACKGROUND 0
  3973. #define CRID_CUSTOMTEXT 1
  3974. #define CRID_COLORCOUNT 2
  3975. typedef struct _CUSTOMVIEWSDATA
  3976. {
  3977. DWORD cchSizeOfBlock; // size of lpDataBlock in WCHARs
  3978. LPWSTR lpDataBlock; // Pointer to the Strings data block, allocated by the task allocator (SHAlloc)
  3979. // The following are offsets (in WCHARs) to be added to lpDataBlock.
  3980. // If the offset is -1 => That data is not present for this view.
  3981. int acchOffExtViewUIstr[6]; // ID_EXTVIEWSTRCOUNT was 6, but is no longer used
  3982. COLORREF crCustomColors[CRID_COLORCOUNT];
  3983. // Once IE4 ships, we can extend this structure by adding new SFVF_ flags
  3984. // in the main structure that say "customviewsdata contains xxx info".
  3985. } CUSTOMVIEWSDATA;
  3986. //
  3987. // Interface for enumerating "external" views for the ShellFolderView
  3988. //
  3989. typedef struct _SFVVIEWSDATA
  3990. {
  3991. // idView specifies the view. Unless specified in pCustomData, look up
  3992. // HKLM\CLSID\Software\Microsoft\Windows\CurrentVersion\ExtShellFolderViews\idView
  3993. // to find the menu name, help text, tt text.
  3994. //
  3995. // the shell's IShellFolderView implementations get these as
  3996. // subkeys of the shellex\ExtShellFolderViews key under the folder's
  3997. // clsid type (or progid type, depending on the IShellFolderView impl).
  3998. //
  3999. // In desktop.ini, these are keys read from the [ExtShellFolderViews]
  4000. // section, in the form of "{idView}" or "{idView}={idExtShellView}"
  4001. //
  4002. GUID idView; // This is the GUID that specifies the View.
  4003. // idExtShellView specifies the IDefViewExtInit IShellView extension
  4004. // to use for this view.
  4005. //
  4006. // the shell's IShellFolderView implementations get this from
  4007. // the "ISV" value under the shellex\ExtShellFolderViews\{idView}
  4008. // key in the registry.
  4009. //
  4010. // In desktop.ini, this is read from the [ExtShellFolderViews]
  4011. // section, in the form of "{idView}={idExtShellView}"
  4012. //
  4013. GUID idExtShellView; // [optional] This is the GUID for the extended IShellView
  4014. // dwFlags - see the SFVF_ flags below.
  4015. //
  4016. // the shell's IShellFolderView implementations get this from
  4017. // the "Attributes" value under the shellex\ExtShellFolderViews\{idView}
  4018. // key in the registry.
  4019. //
  4020. // In desktop.ini, this is read from the [{idView}] section,
  4021. // from the "Attributes=" line.
  4022. //
  4023. DWORD dwFlags;
  4024. // lParam is passed to IShellView view extensions
  4025. //
  4026. // the shell's IShellFolderView implementations get this from
  4027. // the "lparam" value under the shellex\ExtShellFolderViews\{idView}
  4028. // key in the registry.
  4029. //
  4030. // In desktop.ini, this is read from the [{idView}] section,
  4031. // from the "LParam=" line.
  4032. //
  4033. DWORD lParam;
  4034. // wszMoniker is used to either bind to a docobject extended view,
  4035. // or as the data for an idExtShellView view.
  4036. //
  4037. // the shell's IShellFolderView implementations get this from
  4038. // the "PersistMoniker" value under the shellex\ExtShellFolderViews\{idView}
  4039. // key in the registry.
  4040. //
  4041. // In desktop.ini, this is read from the [{idView}] section,
  4042. // from the "PersistMoniker=" line.
  4043. //
  4044. WCHAR wszMoniker[MAX_PATH];
  4045. // pCustomData overrides/provides menu and other ui options
  4046. // for this view. If a WebViewFolderContents OC appears in the
  4047. // docobject extended view, it pays attention to color and
  4048. // background bitmaps.
  4049. //
  4050. // the shell's IShellFolderView implementations do not fill out this structure.
  4051. //
  4052. // In desktop.ini, this is read from the [{idView}] section,
  4053. // from the "IconArea_Image", "IconArea_TextBackground", and "IconArea_Text".
  4054. //
  4055. CUSTOMVIEWSDATA *pCustomData; //This is valid only if SFVF_CUSTOMIZEDVIEW is set.
  4056. } SFVVIEWSDATA;
  4057. //
  4058. // SFVF_CUSTOMIZEDVIEW - This flag is set only for those views whose
  4059. // data are picked up from the Desktop.ini.
  4060. //
  4061. #define SFVF_CUSTOMIZEDVIEW 0x80000000
  4062. //
  4063. // SFVF_TREATASNORMAL - This flag is set for those views that wish to
  4064. // be treated as normal views, this means they will show up in the file-open/SaveAs
  4065. // Dialogs.
  4066. //
  4067. #define SFVF_TREATASNORMAL 0x40000000
  4068. //
  4069. // SFVF_NOWEBVIEWFOLDERCONTENTS - This is used to detect those views that
  4070. // never host the WebViewFolderContents OC and so cannot toggle on and off,
  4071. // ie, they are exclusive views such as Thumbnail View.
  4072. //
  4073. #define SFVF_NOWEBVIEWFOLDERCONTENTS 0x20000000
  4074. #undef INTERFACE
  4075. #define INTERFACE IEnumSFVViews
  4076. DECLARE_INTERFACE_(IEnumSFVViews, IUnknown)
  4077. {
  4078. // *** IUnknown methods ***
  4079. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  4080. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  4081. STDMETHOD_(ULONG,Release) (THIS) PURE;
  4082. // *** IEnumSFVViews methods ***
  4083. STDMETHOD(Next) (THIS_ ULONG celt,
  4084. SFVVIEWSDATA **ppData,
  4085. ULONG *pceltFetched) PURE;
  4086. STDMETHOD(Skip) (THIS_ ULONG celt) PURE;
  4087. STDMETHOD(Reset) (THIS) PURE;
  4088. STDMETHOD(Clone) (THIS_ IEnumSFVViews **ppenum) PURE;
  4089. };
  4090. #undef INTERFACE
  4091. #define INTERFACE IPersistString
  4092. DECLARE_INTERFACE_(IPersistString, IUnknown)
  4093. {
  4094. // *** IUnknown methods ***
  4095. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  4096. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  4097. STDMETHOD_(ULONG,Release) (THIS) PURE;
  4098. // *** IPersist methods ***
  4099. STDMETHOD(GetClassID) (THIS_ LPCLSID lpClassID) PURE;
  4100. // *** IPersistString methods ***
  4101. STDMETHOD(Initialize) (THIS_ LPCWSTR pwszInit) PURE;
  4102. };
  4103. #pragma warning (disable: 4200)
  4104. #pragma warning (disable: 4510)
  4105. #pragma warning (disable: 4512)
  4106. #pragma warning (disable: 4610)
  4107. // From sdkinc\platform.h
  4108. // We can't simply include that file because it breaks other projects
  4109. // that include platform.h.
  4110. // DOC'ed for DOJ compliance:
  4111. #include <pshpack8.h>
  4112. typedef struct _SFVM_SELCHANGE_DATA
  4113. {
  4114. UINT uOldState;
  4115. UINT uNewState;
  4116. LPARAM lParamItem;
  4117. } SFVM_SELCHANGE_DATA;
  4118. typedef struct _COPYHOOKINFO
  4119. {
  4120. HWND hwnd;
  4121. DWORD wFunc;
  4122. DWORD wFlags;
  4123. LPCTSTR pszSrcFile;
  4124. DWORD dwSrcAttribs;
  4125. LPCTSTR pszDestFile;
  4126. DWORD dwDestAttribs;
  4127. } COPYHOOKINFO;
  4128. typedef struct
  4129. {
  4130. DWORD bWantWebview; // in: caller should return template
  4131. DWORD dwOptions; // out: SFVMQVI_ flags
  4132. WCHAR szWebView[MAX_PATH]; // out: webview template path
  4133. } SFVM_VIEWINFO_DATA;
  4134. typedef struct
  4135. {
  4136. DWORD dwOptions; // out: SFVMQVI_ flags for the [in,wParam]uViewMode
  4137. } SFVM_VIEW_DATA;
  4138. // dwOptions control the state of corresponding [in,wParam]uViewMode:
  4139. #define SFVMQVI_NORMAL 0x0 // out: let defview decide what to do
  4140. #define SFVMQVI_INCLUDE 0x1 // out: force include
  4141. #define SFVMQVI_EXCLUDE 0x2 // out: force exclude
  4142. typedef struct
  4143. {
  4144. FOLDERVIEWMODE fvm; // out: view mode
  4145. BOOL fGroupView; // out: group view on/off
  4146. UINT uSortCol; // out: sort by scid
  4147. int iSortDirection; // out: ascending or descending sort
  4148. FOLDERFLAGS fFlags; // out: folder flags to set (supports FWF_AUTOARRANGE)
  4149. } SFVM_DEFERRED_VIEW_SETTINGS;
  4150. typedef struct
  4151. {
  4152. WCHAR szWebView[MAX_PATH]; // out: webview template path for [in,wParam]uViewMode
  4153. } SFVM_WEBVIEW_TEMPLATE_DATA;
  4154. typedef struct _SFVM_CUSTOMVIEWINFO_DATA
  4155. {
  4156. COLORREF crCustomColors[CRID_COLORCOUNT];
  4157. WCHAR szIconAreaImage[MAX_PATH]; // Note: the old struct used INTERNET_MAX_URL_LENGTH, but we only use local cases so this isn't needed
  4158. } SFVM_CUSTOMVIEWINFO_DATA;
  4159. typedef struct
  4160. {
  4161. DWORD dwLayout; // out: SFVMWLV_ for [in,wParam]uViewMode
  4162. IUnknown* punkPreview; // out: IUnknown of preview control, if SFVMWVL_PREVIEW specified
  4163. } SFVM_WEBVIEW_LAYOUT_DATA;
  4164. // dwLayout:
  4165. #define SFVMWVL_NORMAL 0 // standard Web View format
  4166. #define SFVMWVL_PREVIEW 1 // "preview" Web View format
  4167. #define SFVMWVL_DETAILS 2 // standard Web View format with details expanded by default
  4168. #define SFVMWVL_ITEMS 0x00000000 // HACK (added for Whistler, remove in BlackComb): item Web View format
  4169. #define SFVMWVL_FILES 0x00010000 // HACK (added for Whistler, remove in BlackComb): file Web View format
  4170. #define SFVMWVL_NOPRINT 0x00020000 // HACK (added for Whistler, remove in BlackComb): unconditionally hide "Print this file" folder task
  4171. #define SFVMWVL_NOPUBLISH 0x00040000 // HACK (added for Whistler, remove in BlackComb): unconditionally hide "Publish this file" folder task
  4172. #define SFVMWVL_ORDINAL_MASK 0x0000ffff // HACK (added for Whistler, remove in BlackComb): overload dwLayout for ordinals and flags
  4173. #define SFVMWVL_FLAGS_MASK 0xffff0000 // HACK (added for Whistler, remove in BlackComb): overload dwLayout for ordinals and flags
  4174. typedef struct
  4175. {
  4176. DWORD dwFlags;
  4177. IUIElement* pIntroText; // can be NULL for no explanatory text
  4178. IUIElement* pSpecialTaskHeader; // can be NULL for no special task section
  4179. IUIElement* pFolderTaskHeader; // if NULL, defview will provide a default folder task section
  4180. IEnumIDList* penumOtherPlaces; // if NULL, defview will provide a default Other Places list
  4181. } SFVM_WEBVIEW_CONTENT_DATA;
  4182. // dwFlags:
  4183. #define SFVMWVF_BARRICADE 0x00000001 // this is a barricaded folder
  4184. #define SFVMWVF_ENUMTASKS 0x00000002 // Folder uses non-standard tasks. Will enumerate.
  4185. #define SFVMWVF_NOMORETASKS 0x00000004 // No more tasks in enumeration.
  4186. #define SFVMWVF_SPECIALTASK 0x00000008 // Used in ENUMTASKSECTION_DATA.dwFlags.
  4187. #define SFVMWVF_CONTENTSCHANGE 0x00000010 // Refresh WV content when folder contents change.
  4188. typedef struct
  4189. {
  4190. IEnumUICommand* penumSpecialTasks; // can be NULL for no special task section
  4191. IEnumUICommand* penumFolderTasks; // if NULL, defview will provide a default folder task section
  4192. DWORD dwUpdateFlags; // bitmask of the extra special events that we should listen to
  4193. } SFVM_WEBVIEW_TASKSECTION_DATA;
  4194. // dwUpdateFlags:
  4195. #define SFVMWVTSDF_CONTENTSCHANGE 0x00000001
  4196. typedef struct
  4197. {
  4198. LPCWSTR pszThemeID; // [out] fill with a pointer a string who's lifetime is at least as long as your IShellFolderViewCB object.
  4199. } SFVM_WEBVIEW_THEME_DATA;
  4200. //
  4201. // To replace the standard webview tasks with a set enumerated by the view
  4202. // callback, the callback sets the SFVMWVF_ENUMTASKS flag in the dwFlags
  4203. // member of SFVM_WEBVIEWCONTENT_DATA. This causes the shell to send
  4204. // SFVM_ENUMWEBVIEWTASKS repeatedly in place of SFVM_GETWEBVIEWCONTENT and
  4205. // SFVM_GETWEBVIEWTASKS. Each time SFVM_ENUMWEBVIEWTASKS is sent,
  4206. // the view callback provides a header and task enumerator via a
  4207. // SFVM_WEBVIEW_ENUMTASKSECTION_DATA structure. The message is sent to the
  4208. // view repeatedly until the handler sets the SFVMWVF_NOMORETASKS flag
  4209. // in SFVM_WEBVIEW_ENUMTASKSECTION_DATA.dwFlags. The top-down display order
  4210. // of task sections is the same as the order in which they are provided by
  4211. // the view callback.
  4212. //
  4213. // The dwFlags member of SFVM_WEBVIEW_ENUMTASKSECTION_DATA supports
  4214. // the following values:
  4215. // SFVMWVF_SPECIALTASK - Use the 'special' task section style.
  4216. // If not set, use the 'normal' style.
  4217. // SFVMWVF_NOMORETASKS - Terminate the enumeration.
  4218. //
  4219. typedef struct
  4220. {
  4221. DWORD dwFlags; // SFVMWVF_XXXX flags. See above.
  4222. IUIElement *pHeader;
  4223. IEnumUICommand *penumTasks;
  4224. int idBitmap; // Valid only for SPECIALTASK sections.
  4225. int idWatermark; // Valid only for SPECIALTASK sections.
  4226. } SFVM_WEBVIEW_ENUMTASKSECTION_DATA;
  4227. // WebView Task helper functions provided by shell32
  4228. // to help answer SFVM_GETWEBVIEWCONTENT and SFVM_GETWEBVIEWTASKS messages.
  4229. //
  4230. // The idea here being that you provide task implementations in the static
  4231. // functions with a pv parameter that gets passed through to your static functions
  4232. // so they can get back to your IShellFolderViewCB object. These helper
  4233. // functions assume that all strings are resources to be loaded out of your DLL.
  4234. //
  4235. typedef HRESULT (*PFN_get_State)(IUnknown* pv,IShellItemArray *psiItemArray, BOOL fOkToBeSlow, UISTATE* puisState);
  4236. typedef HRESULT (*PFN_Invoke)(IUnknown* pv,IShellItemArray *psiItemArray, IBindCtx *pbc);
  4237. typedef struct {
  4238. const GUID* pguidCanonicalName;
  4239. LPCWSTR pszDllName;
  4240. DWORD dwTitleIndexNoSelection;
  4241. DWORD dwTitleIndexFileSelected;
  4242. DWORD dwTitleIndexFolderSelected;
  4243. DWORD dwTitleIndexMultiSelected;
  4244. DWORD dwTooltipIndex;
  4245. DWORD dwIconIndex;
  4246. PFN_get_State pfn_get_State;
  4247. PFN_Invoke pfn_Invoke;
  4248. } WVTASKITEM;
  4249. // Use for tasks that want to be displayed when something is selected, where the UI is independent of the selection
  4250. #define WVTI_ENTRY(g, d, t, p, i, s, k) {&(g), (d), (0), (t), (t), (t), (p), (i), (s), (k)}
  4251. // Use for tasks that want to be displayed when nothing is selected
  4252. #define WVTI_ENTRY_NOSELECTION(g, d, t, p, i, s, k) {&(g), (d), (t), 0, 0, 0, (p), (i), (s), (k)}
  4253. // Use for tasks that want to be displayed when a file is selected
  4254. #define WVTI_ENTRY_FILE(g, d, t, p, i, s, k) {&(g), (d), (0), (t), (0), (0), (p), (i), (s), (k)}
  4255. // Use for tasks that want to be displayed when something is selected, and you want different UI depending on the selection
  4256. // Use this one if you want to control the title, but the tooltip is constant:
  4257. #define WVTI_ENTRY_TITLE(g, d, t2, t3, t4, p, i, s, k) {&(g), (d), (0), (t2), (t3), (t4), (p), (i), (s), (k)}
  4258. // Use this one if you want the same text everywhere:
  4259. #define WVTI_ENTRY_ALL(g, d, t, p, i, s, k) {&(g), (d), (t), (t), (t), (t), (p), (i), (s), (k)}
  4260. // Use this one if you want to control everything:
  4261. #define WVTI_ENTRY_ALL_TITLE(g, d, t1, t2, t3, t4, p, i, s, k) {&(g), (d), (t1), (t2), (t3), (t4), (p), (i), (s), (k)}
  4262. // Use this one for a header:
  4263. #define WVTI_HEADER(d, t, p) {&(CLSID_NULL), (d), (t), (t), (t), (t), (p), 0, NULL, NULL}
  4264. // Use this one for a header that changes with the selection:
  4265. #define WVTI_HEADER_ENTRY(d, t1, t2, t3, t4, p) {&(CLSID_NULL), (d), (t1), (t2), (t3), (t4), (p), 0, NULL, NULL}
  4266. // Creates an IEnumUICommand over an array of WVTASKITEM structures.
  4267. // The enumerator/objects hold a ref on the pv param for the lifetime of the enumerator/objects.
  4268. // The pv param gets passed through to the static WVTASKITEM.pfn functions.
  4269. //
  4270. HRESULT Create_IEnumUICommand(IUnknown *pv, const WVTASKITEM* rgwvti, UINT cwvti, IEnumUICommand**ppenum);
  4271. // Creates an IUICommand out of a single WVTASKITEM, never calling the pfn functions
  4272. HRESULT Create_IUIElement(const WVTASKITEM* pwvti, IUIElement**ppuie);
  4273. // SFVM_GETNOTIFY: The shell will use the pidl returned from this message to synch
  4274. // change notifies. Folders in Folder Shortcuts should return pidlTarget
  4275. // because that is where the change notifies are sent.
  4276. //
  4277. // DOC'ed for DOJ compliance:
  4278. #define SFVM_SELCHANGE 8 // idCmdFirst,nItem SFVM_SELCHANGE_DATA*
  4279. #define SFVM_DRAWITEM 9 // idCmdFirst DRAWITEMSTRUCT*
  4280. #define SFVM_MEASUREITEM 10 // idCmdFirst MEASUREITEMSTRUCT*
  4281. #define SFVM_EXITMENULOOP 11 // - -
  4282. #define SFVM_PRERELEASE 12 // - -
  4283. #define SFVM_GETCCHMAX 13 // LPCITEMIDLIST pcchMax
  4284. // DOC'ed for DOJ compliance:
  4285. #define SFVM_WINDOWDESTROY 16 // hwnd -
  4286. #define SFVM_REFRESH 17 // BOOL fPreOrPost - NB: this may be called multiple times in a row
  4287. #define SFVM_SETFOCUS 18 // - -
  4288. #define SFVM_QUERYCOPYHOOK 20 // - -
  4289. #define SFVM_NOTIFYCOPYHOOK 21 // - COPYHOOKINFO*
  4290. // DOC'ed for DOJ compliance:
  4291. #define SFVM_INSERTITEM 29 // pidl -
  4292. #define SFVM_DELETEITEM 30 // pidl -
  4293. // DOC'ed for DOJ compliance:
  4294. #define SFVM_GETWORKINGDIR 33 // uMax pszDir
  4295. #define SFVM_GETCOLSAVESTREAM 34 // flags IStream **
  4296. #define SFVM_SELECTALL 35 // - -
  4297. // DOC'ed for DOJ compliance:
  4298. #define SFVM_SUPPORTSIDENTITY 37 // - - // NOT USED: must support IShellFolder2
  4299. #define SFVM_FOLDERISPARENT 38 // - pidlChild
  4300. // DOC'ed for DOJ compliance:
  4301. #define SFVM_GETVIEWS 40 // SHELLVIEWID* IEnumSFVViews **
  4302. // DOC'ed for DOJ compliance:
  4303. #define SFVM_GETITEMIDLIST 42 // iItem LPITMIDLIST*
  4304. #define SFVM_SETITEMIDLIST 43 // iItem LPITEMIDLIST
  4305. #define SFVM_INDEXOFITEMIDLIST 44 // *iItem LPITEMIDLIST
  4306. #define SFVM_ODFINDITEM 45 // *iItem NM_FINDITEM*
  4307. #define SFVM_HWNDMAIN 46 // hwndMain
  4308. // DOC'ed for DOJ compliance:
  4309. #define SFVM_ARRANGE 50 // - lParamSort
  4310. #define SFVM_QUERYSTANDARDVIEWS 51 // - BOOL * // NOT USED: must use SFVM_GETVIEWDATA instead
  4311. #define SFVM_QUERYREUSEEXTVIEW 52 // - BOOL * // NOT USED
  4312. // DOC'ed for DOJ compliance:
  4313. #define SFVM_GETEMPTYTEXT 54 // cchMax pszText
  4314. #define SFVM_GETITEMICONINDEX 55 // iItem int *piIcon
  4315. #define SFVM_DONTCUSTOMIZE 56 // - BOOL *pbDontCustomize // NOT USED
  4316. // DOC'ed for DOJ compliance:
  4317. #define SFVM_ISOWNERDATA 60 // ISOWNERDATA BOOL *
  4318. #define SFVM_GETODRANGEOBJECT 61 // iWhich ILVRange **
  4319. #define SFVM_ODCACHEHINT 62 // - NMLVCACHEHINT *
  4320. // DOC'ed for DOJ compliance:
  4321. #define SFVM_OVERRIDEITEMCOUNT 64 // - UINT* // NOT USED: allowed override of actual item count for sizing calculations
  4322. #define SFVM_GETHELPTEXTW 65 // idCmd,cchMax pszText - unicode
  4323. #define SFVM_GETTOOLTIPTEXTW 66 // idCmd,cchMax pszText - unicode
  4324. #define SFVM_GETIPERSISTHISTORY 67 // IPersistHistory **
  4325. #define SFVM_GETHELPTEXTA 69 // idCmd,cchMax pszText - ansi
  4326. #define SFVM_GETTOOLTIPTEXTA 70 // idCmd,cchMax pszText - ansi
  4327. // The below two messages are only used in ownder data case, i.e. when SFVM_ISOWNERDATA returns TRUE
  4328. #define SFVM_GETICONOVERLAY 71 // iItem int iOverlayIndex
  4329. #define SFVM_SETICONOVERLAY 72 // iItem int * piOverlayIndex
  4330. #define SFVM_ALTERDROPEFFECT 73 // DWORD* IDataObject*
  4331. #define SFVM_DELAYWINDOWCREATE 74 // HWND - posted version of SFVM_WINDOWCREATED, no params
  4332. #define SFVM_FORCEWEBVIEW 75 // BOOL* -
  4333. #define SFVM_GETVIEWINFO 76 // fvm.uViewMode SFVM_VIEWINFO_DATA* // NOT USED: shipped in Whistler Beta 1 only, remove soon
  4334. #define SFVM_GETCUSTOMVIEWINFO 77 // - SFVM_CUSTOMVIEWINFO_DATA*
  4335. #define SFVM_FOLDERSETTINGSFLAGS 78 // - DWORD * (FWF_ flags)
  4336. #define SFVM_ENUMERATEDITEMS 79 // UINT celt LPCITEMIDLIST* rgpidl // fired once at view creation, before first SFVM_GETVIEWDATA SFVM_GETDEFERREDVIEWSETTINGS
  4337. #define SFVM_GETVIEWDATA 80 // fvm.uViewMode SFVM_VIEW_DATA*
  4338. #define SFVM_GETWEBVIEW_TEMPLATE 81 // fvm.uViewMode SFVM_WEBVIEW_TEMPLATE_DATA* // NOTE: going away soon
  4339. #define SFVM_GETWEBVIEWLAYOUT 82 // fvm.uViewMode SFVM_WEBVIEW_LAYOUT_DATA*
  4340. #define SFVM_GETWEBVIEWCONTENT 83 // - SFVM_WEBVIEW_CONTENT_DATA*
  4341. #define SFVM_GETWEBVIEWTASKS 84 // - SFVM_WEBVIEW_TASKSECTION_DATA*
  4342. #define SFVM_GETWEBVIEWTHEME 86 // - SFVM_WEBVIEW_THEME_DATA* // HACK for Whistler, will remove when DirectUI goes DLL
  4343. #define SFVM_SORTLISTDATA 87 // PFNLVCOMPARE lParamSort
  4344. #define SFVM_GETWEBVIEWBARRICADE 88 // - Element* // HACK for Whistler, will remove when DirectUI goes DLL
  4345. #define SFVM_ENUMWEBVIEWTASKS 90 // - SFVM_WEBVIEW_ENUMTASKSECTION_DATA*
  4346. #define SFVM_SETEMPTYTEXT 91 // - pszText
  4347. #define SFVM_GETDEFERREDVIEWSETTINGS 92 // - SFVM_DEFERRED_VIEW_SETTINGS* // set the default view settings
  4348. // All of these macros are compatible with HANDLE_MSG in WINDOWSX.H
  4349. #define HANDLE_SFVM_MERGEMENU(pv, wP, lP, fn) \
  4350. ((fn)((pv), (QCMINFO*)(lP)))
  4351. #define HANDLE_SFVM_INVOKECOMMAND(pv, wP, lP, fn) \
  4352. ((fn)((pv), (UINT)(wP)))
  4353. #define HANDLE_SFVM_GETHELPTEXT(pv, wP, lP, fn) \
  4354. ((fn)((pv), LOWORD(wP), HIWORD(wP), (LPTSTR)(lP)))
  4355. #define HANDLE_SFVM_GETTOOLTIPTEXT(pv, wP, lP, fn) \
  4356. ((fn)((pv), LOWORD(wP), HIWORD(wP), (LPTSTR)(lP)))
  4357. #define HANDLE_SFVM_GETBUTTONINFO(pv, wP, lP, fn) \
  4358. ((fn)((pv), (TBINFO*)(lP)))
  4359. #define HANDLE_SFVM_GETBUTTONS(pv, wP, lP, fn) \
  4360. ((fn)((pv), LOWORD(wP), HIWORD(wP), (TBBUTTON*)(lP)))
  4361. #define HANDLE_SFVM_INITMENUPOPUP(pv, wP, lP, fn) \
  4362. ((fn)((pv), LOWORD(wP), HIWORD(wP), (HMENU)(lP)))
  4363. #define HANDLE_SFVM_SELCHANGE(pv, wP, lP, fn) \
  4364. ((fn)((pv), LOWORD(wP), HIWORD(wP), (SFVM_SELCHANGE_DATA*)(lP)))
  4365. #define HANDLE_SFVM_DRAWITEM(pv, wP, lP, fn) \
  4366. ((fn)((pv), (UINT)(wP), (DRAWITEMSTRUCT*)(lP)))
  4367. #define HANDLE_SFVM_MEASUREITEM(pv, wP, lP, fn) \
  4368. ((fn)((pv), (UINT)(wP), (MEASUREITEMSTRUCT*)(lP)))
  4369. #define HANDLE_SFVM_EXITMENULOOP(pv, wP, lP, fn) \
  4370. ((fn)(pv))
  4371. #define HANDLE_SFVM_PRERELEASE(pv, wP, lP, fn) \
  4372. ((fn)(pv))
  4373. #define HANDLE_SFVM_GETCCHMAX(pv, wP, lP, fn) \
  4374. ((fn)((pv), (LPCITEMIDLIST)(wP), (UINT*)(lP)))
  4375. #define HANDLE_SFVM_FSNOTIFY(pv, wP, lP, fn) \
  4376. ((fn)((pv), (LPCITEMIDLIST*)(wP), (lP)))
  4377. #define HANDLE_SFVM_WINDOWCREATED(pv, wP, lP, fn) \
  4378. ((fn)((pv), (HWND)(wP)))
  4379. #define HANDLE_SFVM_WINDOWDESTROY(pv, wP, lP, fn) \
  4380. ((fn)((pv), (HWND)(wP)))
  4381. #define HANDLE_SFVM_REFRESH(pv, wP, lP, fn) \
  4382. ((fn)((pv), (BOOL) wP))
  4383. #define HANDLE_SFVM_SETFOCUS(pv, wP, lP, fn) \
  4384. ((fn)(pv))
  4385. #define HANDLE_SFVM_QUERYCOPYHOOK(pv, wP, lP, fn) \
  4386. ((fn)(pv))
  4387. #define HANDLE_SFVM_NOTIFYCOPYHOOK(pv, wP, lP, fn) \
  4388. ((fn)((pv), (COPYHOOKINFO*)(lP)))
  4389. #define HANDLE_SFVM_GETDETAILSOF(pv, wP, lP, fn) \
  4390. ((fn)((pv), (UINT)(wP), (DETAILSINFO*)(lP)))
  4391. #define HANDLE_SFVM_COLUMNCLICK(pv, wP, lP, fn) \
  4392. ((fn)((pv), (UINT)(wP)))
  4393. #define HANDLE_SFVM_QUERYFSNOTIFY(pv, wP, lP, fn) \
  4394. ((fn)((pv), (SHChangeNotifyEntry*)(lP)))
  4395. #define HANDLE_SFVM_DEFITEMCOUNT(pv, wP, lP, fn) \
  4396. ((fn)((pv), (UINT*)(lP)))
  4397. #define HANDLE_SFVM_OVERRIDEITEMCOUNT(pv, wP, lP, fn) \
  4398. ((fn)((pv), (UINT*)(lP)))
  4399. #define HANDLE_SFVM_DEFVIEWMODE(pv, wP, lP, fn) \
  4400. ((fn)((pv), (FOLDERVIEWMODE*)(lP)))
  4401. #define HANDLE_SFVM_UNMERGEMENU(pv, wP, lP, fn) \
  4402. ((fn)((pv), (HMENU)(lP)))
  4403. #define HANDLE_SFVM_INSERTITEM(pv, wP, lP, fn) \
  4404. ((fn)((pv), (LPCITEMIDLIST)(lP)))
  4405. #define HANDLE_SFVM_DELETEITEM(pv, wP, lP, fn) \
  4406. ((fn)((pv), (LPCITEMIDLIST)(lP)))
  4407. #define HANDLE_SFVM_UPDATESTATUSBAR(pv, wP, lP, fn) \
  4408. ((fn)((pv), (BOOL)(wP)))
  4409. #define HANDLE_SFVM_BACKGROUNDENUM(pv, wP, lP, fn) \
  4410. ((fn)(pv))
  4411. #define HANDLE_SFVM_GETWORKINGDIR(pv, wP, lP, fn) \
  4412. ((fn)((pv), (UINT)(wP), (LPTSTR)(lP)))
  4413. #define HANDLE_SFVM_GETCOLSAVESTREAM(pv, wP, lP, fn) \
  4414. ((fn)((pv), (wP), (IStream**)(lP)))
  4415. #define HANDLE_SFVM_SELECTALL(pv, wP, lP, fn) \
  4416. ((fn)(pv))
  4417. #define HANDLE_SFVM_DIDDRAGDROP(pv, wP, lP, fn) \
  4418. ((fn)((pv), (DWORD)(wP), (IDataObject*)(lP)))
  4419. #define HANDLE_SFVM_SUPPORTSIDENTITY(pv, wp, lP, fn) \
  4420. ((fn)(pv)) /* Only 1 parameter */
  4421. #define HANDLE_SFVM_HWNDMAIN(pv, wP, lP, fn) \
  4422. ((fn)((pv), (HWND)(lP)))
  4423. #define HANDLE_SFVM_GETNOTIFY(pv, wP, lP, fn) \
  4424. ((fn)((pv), (LPITEMIDLIST*)(wP), (LONG*)(lP)))
  4425. #define HANDLE_SFVM_SETISFV(pv, wP, lP, fn) \
  4426. ((fn)((pv), (IShellFolderView*)(lP)))
  4427. #define HANDLE_SFVM_GETVIEWS(pv, wP, lP, fn) \
  4428. ((fn)((pv), (SHELLVIEWID*)(wP), (IEnumSFVViews**)(lP)))
  4429. #define HANDLE_SFVM_THISIDLIST(pv, wP, lP, fn) \
  4430. ((fn)((pv), (LPITEMIDLIST*)(lP)))
  4431. #define HANDLE_SFVM_GETITEMIDLIST(pv, wP, lP, fn) \
  4432. ((fn)((pv), (wP), (LPITEMIDLIST*)(lP)))
  4433. #define HANDLE_SFVM_SETITEMIDLIST(pv, wP, lP, fn) \
  4434. ((fn)((pv), (wP), (LPITEMIDLIST)(lP)))
  4435. #define HANDLE_SFVM_INDEXOFITEMIDLIST(pv, wP, lP, fn) \
  4436. ((fn)((pv), (int*)(wP), (LPITEMIDLIST)(lP)))
  4437. #define HANDLE_SFVM_ODFINDITEM(pv, wP, lP, fn) \
  4438. ((fn)((pv), (int*)(wP), (NM_FINDITEM*)(lP)))
  4439. #define HANDLE_SFVM_ADDPROPERTYPAGES(pv, wP, lP, fn) \
  4440. ((fn)((pv), (SFVM_PROPPAGE_DATA *)(lP)))
  4441. #define HANDLE_SFVM_FOLDERISPARENT(pv, wP, lP, fn) \
  4442. ((fn)((pv), (LPITEMIDLIST)(lP)))
  4443. #define HANDLE_SFVM_ARRANGE(pv, wP, lP, fn) \
  4444. ((fn)((pv), (LPARAM)(lP)))
  4445. #define HANDLE_SFVM_QUERYSTANDARDVIEWS(pv, wP, lP, fn) \
  4446. ((fn)((pv), (BOOL*)(lP)))
  4447. #define HANDLE_SFVM_QUERYREUSEEXTVIEW(pv, wP, lP, fn) \
  4448. ((fn)((pv), (BOOL*)(lP)))
  4449. #define HANDLE_SFVM_GETEMPTYTEXT(pv, wP, lP, fn) \
  4450. ((fn)((pv), (UINT)(wP), (LPTSTR)(lP)))
  4451. #define HANDLE_SFVM_GETITEMICONINDEX(pv, wP, lP, fn) \
  4452. ((fn)((pv), (wP), (int*)(lP)))
  4453. #define HANDLE_SFVM_SIZE(pv, wP, lP, fn) \
  4454. ((fn)((pv), LOWORD(lP), HIWORD(lP)))
  4455. #define HANDLE_SFVM_GETZONE(pv, wP, lP, fn) \
  4456. ((fn)((pv), (DWORD *)(lP)))
  4457. #define HANDLE_SFVM_GETPANE(pv, wP, lP, fn) \
  4458. ((fn)((pv), (wP), (DWORD *)(lP)))
  4459. #define HANDLE_SFVM_ISOWNERDATA(pv, wP, lP, fn) \
  4460. ((fn)((pv), (BOOL*)(lP)))
  4461. #define HANDLE_SFVM_GETODRANGEOBJECT(pv, wP, lP, fn) \
  4462. ((fn)((pv), (wP), (ILVRange **)(lP)))
  4463. #define HANDLE_SFVM_ODCACHEHINT(pv, wP, lP, fn) \
  4464. ((fn)((pv), (NMLVCACHEHINT*)(lP)))
  4465. #define HANDLE_SFVM_GETHELPTOPIC(pv, wP, lP, fn) \
  4466. ((fn)((pv), (SFVM_HELPTOPIC_DATA *)(lP)))
  4467. #define HANDLE_SFVM_GETIPERSISTHISTORY(pv, wP, lP, fn) \
  4468. ((fn)((pv), (IPersistHistory **)(lP)))
  4469. #define HANDLE_SFVM_SETICONOVERLAY(pv, wP, lP, fn) \
  4470. ((fn)((pv), (wP), (int)(lP)))
  4471. #define HANDLE_SFVM_GETICONOVERLAY(pv, wP, lP, fn) \
  4472. ((fn)((pv), (wP), (int *)(lP)))
  4473. #define HANDLE_SFVM_ALTERDROPEFFECT(pv, wP, lP, fn) \
  4474. ((fn)((pv), (DWORD *)(wP), (IDataObject *)(lP)))
  4475. #define HANDLE_SFVM_DELAYWINDOWCREATE(pv, wP, lP, fn) \
  4476. ((fn)((pv), (HWND)(wP)))
  4477. #define HANDLE_SFVM_FORCEWEBVIEW(pv, wP, lP, fn) \
  4478. ((fn)((pv), (BOOL*)(wP)))
  4479. #define HANDLE_SFVM_GETVIEWINFO(pv, wP, lP, fn) \
  4480. ((fn)((pv), (UINT)(wP), (SFVM_VIEWINFO_DATA*)lP))
  4481. #define HANDLE_SFVM_GETCUSTOMVIEWINFO(pv, wP, lP, fn) \
  4482. ((fn)((pv), (SFVM_CUSTOMVIEWINFO_DATA*)(lP)))
  4483. #define HANDLE_SFVM_FOLDERSETTINGSFLAGS(pv, wP, lP, fn) \
  4484. ((fn)((pv), (DWORD*)(lP)))
  4485. #define HANDLE_SFVM_ENUMERATEDITEMS(pv, wP, lP, fn) \
  4486. ((fn)((pv), (UINT)(wP), (LPCITEMIDLIST*)(lP)))
  4487. #define HANDLE_SFVM_GETVIEWDATA(pv, wP, lP, fn) \
  4488. ((fn)((pv), (UINT)(wP), (SFVM_VIEW_DATA*)lP))
  4489. #define HANDLE_SFVM_GETWEBVIEW_TEMPLATE(pv, wP, lP, fn) \
  4490. ((fn)((pv), (UINT)(wP), (SFVM_WEBVIEW_TEMPLATE_DATA*)(lP)))
  4491. #define HANDLE_SFVM_GETWEBVIEWLAYOUT(pv, wP, lP, fn) \
  4492. ((fn)((pv), (UINT)(wP), (SFVM_WEBVIEW_LAYOUT_DATA*)(lP)))
  4493. #define HANDLE_SFVM_GETWEBVIEWCONTENT(pv, wP, lP, fn) \
  4494. ((fn)((pv), (SFVM_WEBVIEW_CONTENT_DATA*)(lP)))
  4495. #define HANDLE_SFVM_GETWEBVIEWTASKS(pv, wP, lP, fn) \
  4496. ((fn)((pv), (SFVM_WEBVIEW_TASKSECTION_DATA*)(lP)))
  4497. #define HANDLE_SFVM_ENUMWEBVIEWTASKS(pv, wP, lP, fn) \
  4498. ((fn)((pv), (SFVM_WEBVIEW_ENUMTASKSECTION_DATA*)(lP)))
  4499. #define HANDLE_SFVM_GETWEBVIEWTHEME(pv, wP, lP, fn) \
  4500. ((fn)((pv), (SFVM_WEBVIEW_THEME_DATA*)(lP)))
  4501. #define HANDLE_SFVM_SORTLISTDATA(pv, wP, lP, fn) \
  4502. ((fn)((pv), (PFNLVCOMPARE)(wP), (lP)))
  4503. #define HANDLE_SFVM_GETDEFERREDVIEWSETTINGS(pv, wP, lP, fn) \
  4504. ((fn)((pv), (SFVM_DEFERRED_VIEW_SETTINGS*)(lP)))
  4505. #define HANDLE_SFVM_SETEMPTYTEXT(pv, wP, lP, fn) \
  4506. ((fn)((pv), (UINT)(wP), (LPCTSTR)(lP)))
  4507. //
  4508. // Return values for SFVM_GETICONOVERLAY:
  4509. // If the icon overlay is not set and you want the shell to set it for you.
  4510. // return SFVOVERLAY_UNSET. This will cause the shell to retrieve the overlay and
  4511. // send SFVM_SETICONOVERLAY.
  4512. // If there is no overlay for this item at all, the correct return value is
  4513. // SFVOVERLAY_DEFAULT
  4514. // If you return SFVOVERLAY_UNSET every time for SFVM_GETICONOVERLAY, the
  4515. // shell will keep setting it indefinitely, so there is a danger of infinite loop
  4516. //
  4517. #define SFV_ICONOVERLAY_DEFAULT 0
  4518. #define SFV_ICONOVERLAY_UNSET 0xFFFFFFFF
  4519. //
  4520. // What you can return from SFVM_UPDATESTATUSBAR:
  4521. //
  4522. // E_NOTIMPL - Message not handled; DefView should manage status bar
  4523. //
  4524. // Otherwise, update the status bar yourself and return a bitmask of the
  4525. // following codes indicating what you want DefView to do for you.
  4526. //
  4527. #define SFVUSB_HANDLED 0x0000 // Client handled completely - DefView does nothing
  4528. #define SFVUSB_INITED 0x0001 // Client initialized parts - DefView will set text
  4529. #define SFVUSB_ALL 0x0001
  4530. // IShellFolderView interface for getting the SFV to do things
  4531. //
  4532. typedef struct _ITEMSPACING
  4533. {
  4534. int cxSmall;
  4535. int cySmall;
  4536. int cxLarge;
  4537. int cyLarge;
  4538. } ITEMSPACING;
  4539. // Define OPtions for SetObjectCount
  4540. #define SFVSOC_INVALIDATE_ALL 0x00000001 // Assumed to reset only what is neccessary...
  4541. #define SFVSOC_NOSCROLL LVSICF_NOSCROLL
  4542. // defines for IShellFolderView::SelectItems()
  4543. #define SFVS_SELECT_NONE 0x0 // unselect all
  4544. #define SFVS_SELECT_ALLITEMS 0x1 // select all
  4545. #define SFVS_SELECT_INVERT 0x2 // Inver the selection
  4546. // defines for IShellFolderView::QuerySupport()
  4547. // allows a view to be queried to see if it supports various operations (useful for
  4548. // enabling menu items)
  4549. #define SFVQS_AUTO_ARRANGE 0x0001
  4550. #define SFVQS_ARRANGE_GRID 0x0002
  4551. #define SFVQS_SELECT_ALL 0x0004
  4552. #define SFVQS_SELECT_NONE 0x0008
  4553. #define SFVQS_SELECT_INVERT 0x0010
  4554. #undef INTERFACE
  4555. #define INTERFACE IShellFolderView
  4556. DECLARE_INTERFACE_(IShellFolderView, IUnknown)
  4557. {
  4558. // *** IUnknown methods ***
  4559. STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
  4560. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  4561. STDMETHOD_(ULONG,Release) (THIS) PURE;
  4562. // *** IShellFolderView methods ***
  4563. STDMETHOD(Rearrange) (THIS_ LPARAM lParamSort) PURE;
  4564. STDMETHOD(GetArrangeParam) (THIS_ LPARAM *plParamSort) PURE;
  4565. STDMETHOD(ArrangeGrid) (THIS) PURE;
  4566. STDMETHOD(AutoArrange) (THIS) PURE;
  4567. STDMETHOD(GetAutoArrange) (THIS) PURE;
  4568. STDMETHOD(AddObject) (THIS_ LPITEMIDLIST pidl, UINT *puItem) PURE;
  4569. STDMETHOD(GetObject) (THIS_ LPITEMIDLIST *ppidl, UINT uItem) PURE;
  4570. STDMETHOD(RemoveObject) (THIS_ LPITEMIDLIST pidl, UINT *puItem) PURE;
  4571. STDMETHOD(GetObjectCount) (THIS_ UINT *puCount) PURE;
  4572. STDMETHOD(SetObjectCount) (THIS_ UINT uCount, UINT dwFlags) PURE;
  4573. STDMETHOD(UpdateObject) (THIS_ LPITEMIDLIST pidlOld, LPITEMIDLIST pidlNew, UINT *puItem) PURE;
  4574. STDMETHOD(RefreshObject) (THIS_ LPITEMIDLIST pidl, UINT *puItem) PURE;
  4575. STDMETHOD(SetRedraw) (THIS_ BOOL bRedraw) PURE;
  4576. STDMETHOD(GetSelectedCount) (THIS_ UINT *puSelected) PURE;
  4577. STDMETHOD(GetSelectedObjects) (THIS_ LPCITEMIDLIST **pppidl, UINT *puItems) PURE;
  4578. STDMETHOD(IsDropOnSource) (THIS_ IDropTarget *pDropTarget) PURE;
  4579. STDMETHOD(GetDragPoint) (THIS_ POINT *ppt) PURE;
  4580. STDMETHOD(GetDropPoint) (THIS_ POINT *ppt) PURE;
  4581. STDMETHOD(MoveIcons) (THIS_ IDataObject *pDataObject) PURE;
  4582. STDMETHOD(SetItemPos) (THIS_ LPCITEMIDLIST pidl, POINT *ppt) PURE;
  4583. STDMETHOD(IsBkDropTarget) (THIS_ IDropTarget *pDropTarget) PURE;
  4584. STDMETHOD(SetClipboard) (THIS_ BOOL bMove) PURE;
  4585. STDMETHOD(SetPoints) (THIS_ IDataObject *pDataObject) PURE;
  4586. STDMETHOD(GetItemSpacing) (THIS_ ITEMSPACING *pSpacing) PURE;
  4587. STDMETHOD(SetCallback) (THIS_ IShellFolderViewCB* pNewCB, IShellFolderViewCB** ppOldCB) PURE;
  4588. STDMETHOD(Select) ( THIS_ UINT dwFlags ) PURE;
  4589. STDMETHOD(QuerySupport) (THIS_ UINT * pdwSupport ) PURE;
  4590. STDMETHOD(SetAutomationObject)(THIS_ IDispatch* pdisp) PURE;
  4591. } ;
  4592. // DOC'ed for DOJ compliance:
  4593. #define SHCreateShellFolderViewORD 256
  4594. SHSTDAPI_(IShellFolderViewCB*) SHGetShellFolderViewCB(HWND hwndMain);
  4595. #define SHGetShellFolderViewCBORD 257
  4596. //===========================================================================
  4597. // Defview APIs to make name space author lives somewhat easier
  4598. // DOC'ed for DOJ compliance
  4599. // structure for lParam of DFM_INFOKECOMMANDEX
  4600. typedef struct
  4601. {
  4602. DWORD cbSize;
  4603. DWORD fMask; // CMIC_MASK_ values for the invoke
  4604. LPARAM lParam; // same as lParam of DFM_INFOKECOMMAND
  4605. UINT idCmdFirst;
  4606. UINT idDefMax;
  4607. LPCMINVOKECOMMANDINFO pici; // the whole thing so you can re-invoke on a child
  4608. } DFMICS, *PDFMICS;
  4609. // Note on context menus ranges:
  4610. // Standard Items // DFM_MERGECONTEXTMENU, context menu extensions, DFM_MERGECONTEXTMENU_TOP
  4611. // Separator
  4612. // View Items // context menu extensions can get here
  4613. // Separator
  4614. // (defcm S_FALSE "default" items, if applicable)
  4615. // Separator
  4616. // Folder Items // context menu extensions can get here
  4617. // Separator
  4618. // Bottom Items // DFM_MERGECONTEXTMENU_BOTTOM
  4619. // DOC'ed for DOJ compliance
  4620. #define DFM_ADDREF 3 // 0 0
  4621. #define DFM_RELEASE 4 // 0 0
  4622. #define DFM_GETHELPTEXT 5 // idCmd,cchMax pszText -Ansi
  4623. #define DFM_WM_MEASUREITEM 6 // ---from the message---
  4624. #define DFM_WM_DRAWITEM 7 // ---from the message---
  4625. #define DFM_WM_INITMENUPOPUP 8 // ---from the message---
  4626. #define DFM_VALIDATECMD 9 // idCmd 0
  4627. #define DFM_MERGECONTEXTMENU_TOP 10 // uFlags LPQCMINFO
  4628. #define DFM_GETHELPTEXTW 11 // idCmd,cchMax pszText -Unicode
  4629. #define DFM_INVOKECOMMANDEX 12 // idCmd PDFMICS
  4630. #define DFM_MAPCOMMANDNAME 13 // idCmd * pszCommandName
  4631. #define DFM_GETVERBW 15 // idCmd,cchMax pszText -Unicode
  4632. #define DFM_GETVERBA 16 // idCmd,cchMax pszText -Ansi
  4633. #define DFM_MERGECONTEXTMENU_BOTTOM 17 // uFlags LPQCMINFO
  4634. #define DFM_CMD_DELETE ((UINT)-1)
  4635. #define DFM_CMD_MOVE ((UINT)-2)
  4636. #define DFM_CMD_COPY ((UINT)-3)
  4637. #define DFM_CMD_LINK ((UINT)-4)
  4638. #define DFM_CMD_NEWFOLDER ((UINT)-6)
  4639. #define DFM_CMD_PASTE ((UINT)-7)
  4640. #define DFM_CMD_VIEWLIST ((UINT)-8)
  4641. #define DFM_CMD_VIEWDETAILS ((UINT)-9)
  4642. #define DFM_CMD_PASTELINK ((UINT)-10)
  4643. #define DFM_CMD_PASTESPECIAL ((UINT)-11)
  4644. #define DFM_CMD_MODALPROP ((UINT)-12)
  4645. #define DFM_CMD_RENAME ((UINT)-13)
  4646. SHSTDAPI CDefFolderMenu_Create(LPCITEMIDLIST pidlFolder,
  4647. HWND hwndOwner,
  4648. UINT cidl, LPCITEMIDLIST * apidl,
  4649. IShellFolder *psf,
  4650. LPFNDFMCALLBACK lpfn,
  4651. HKEY hkeyProgID, HKEY hkeyBaseProgID,
  4652. IContextMenu ** ppcm);
  4653. SHSTDAPI_(void) CDefFolderMenu_MergeMenu(HINSTANCE hinst, UINT idMainMerge, UINT idPopupMerge,
  4654. LPQCMINFO pqcm);
  4655. STDAPI_(void) Def_InitFileCommands(ULONG dwAttr, HMENU hmInit, UINT idCmdFirst,
  4656. BOOL bContext);
  4657. STDAPI_(void) Def_InitEditCommands(ULONG dwAttr, HMENU hmInit, UINT idCmdFirst,
  4658. IDropTarget *pdtgt, UINT fContext);
  4659. // indeces in bitmap strip
  4660. #define VIEW_MOVETO 24
  4661. #define VIEW_COPYTO 25
  4662. #define VIEW_OPTIONS 26
  4663. //===========================================================================
  4664. // Default IShellView for IShellFolder
  4665. //===========================================================================
  4666. // Menu ID's
  4667. #define SFVIDM_FIRST (FCIDM_SHVIEWLAST-0x0fff)
  4668. #define SFVIDM_LAST (FCIDM_SHVIEWLAST)
  4669. // Hardcoded message values => This range can be used for messages that we
  4670. // pass from shdoc401 to shell32
  4671. #define SFVIDM_HARDCODED_FIRST (SFVIDM_LAST-0x0010)
  4672. #define SFVIDM_HARDCODED_LAST (SFVIDM_LAST)
  4673. #define SFVIDM_MISC_SETWEBVIEW (SFVIDM_HARDCODED_FIRST)
  4674. // Popup menu ID's used in merging menus
  4675. #define SFVIDM_MENU_ARRANGE (SFVIDM_FIRST + 0x0001)
  4676. #define SFVIDM_MENU_VIEW (SFVIDM_FIRST + 0x0002)
  4677. #define SFVIDM_MENU_SELECT (SFVIDM_FIRST + 0x0003)
  4678. #define SHARED_FILE_FIRST 0x0010
  4679. #define SHARED_FILE_LINK (SHARED_FILE_FIRST + 0x0000)
  4680. #define SHARED_FILE_DELETE (SHARED_FILE_FIRST + 0x0001)
  4681. #define SHARED_FILE_RENAME (SHARED_FILE_FIRST + 0x0002)
  4682. #define SHARED_FILE_PROPERTIES (SHARED_FILE_FIRST + 0x0003)
  4683. #define SHARED_EDIT_FIRST 0x0018
  4684. #define SHARED_EDIT_CUT (SHARED_EDIT_FIRST + 0x0000)
  4685. #define SHARED_EDIT_COPY (SHARED_EDIT_FIRST + 0x0001)
  4686. #define SHARED_EDIT_PASTE (SHARED_EDIT_FIRST + 0x0002)
  4687. #define SHARED_EDIT_UNDO (SHARED_EDIT_FIRST + 0x0003)
  4688. #define SHARED_EDIT_PASTELINK (SHARED_EDIT_FIRST + 0x0004)
  4689. #define SHARED_EDIT_PASTESPECIAL (SHARED_EDIT_FIRST + 0x0005)
  4690. #define SHARED_EDIT_COPYTO (SHARED_EDIT_FIRST + 0x0006)
  4691. #define SHARED_EDIT_MOVETO (SHARED_EDIT_FIRST + 0x0007)
  4692. #define SFVIDM_FILE_FIRST (SFVIDM_FIRST + SHARED_FILE_FIRST)
  4693. #define SFVIDM_FILE_LINK (SFVIDM_FIRST + SHARED_FILE_LINK)
  4694. #define SFVIDM_FILE_DELETE (SFVIDM_FIRST + SHARED_FILE_DELETE)
  4695. #define SFVIDM_FILE_RENAME (SFVIDM_FIRST + SHARED_FILE_RENAME)
  4696. #define SFVIDM_FILE_PROPERTIES (SFVIDM_FIRST + SHARED_FILE_PROPERTIES)
  4697. #define SFVIDM_EDIT_FIRST (SFVIDM_FIRST + SHARED_EDIT_FIRST)
  4698. #define SFVIDM_EDIT_CUT (SFVIDM_FIRST + SHARED_EDIT_CUT)
  4699. #define SFVIDM_EDIT_COPY (SFVIDM_FIRST + SHARED_EDIT_COPY)
  4700. #define SFVIDM_EDIT_PASTE (SFVIDM_FIRST + SHARED_EDIT_PASTE)
  4701. #define SFVIDM_EDIT_UNDO (SFVIDM_FIRST + SHARED_EDIT_UNDO)
  4702. #define SFVIDM_EDIT_PASTELINK (SFVIDM_FIRST + SHARED_EDIT_PASTELINK)
  4703. #define SFVIDM_EDIT_PASTESPECIAL (SFVIDM_FIRST + SHARED_EDIT_PASTESPECIAL)
  4704. #define SFVIDM_EDIT_COPYTO (SFVIDM_FIRST + SHARED_EDIT_COPYTO)
  4705. #define SFVIDM_EDIT_MOVETO (SFVIDM_FIRST + SHARED_EDIT_MOVETO)
  4706. #define SFVIDM_SELECT_FIRST (SFVIDM_FIRST + 0x0020)
  4707. #define SFVIDM_SELECT_ALL (SFVIDM_SELECT_FIRST + 0x0001)
  4708. #define SFVIDM_SELECT_INVERT (SFVIDM_SELECT_FIRST + 0x0002)
  4709. #define SFVIDM_DESELECT_ALL (SFVIDM_SELECT_FIRST + 0x0003)
  4710. #define SFVIDM_VIEW_FIRST (SFVIDM_FIRST + 0x0028)
  4711. #define SFVIDM_VIEW_FIRSTVIEW (SFVIDM_VIEW_FIRST + 1)
  4712. #define SFVIDM_VIEW_ICON (SFVIDM_VIEW_FIRST + 1)
  4713. #define SFVIDM_VIEW_SMALLICON (SFVIDM_VIEW_FIRST + 2)
  4714. #define SFVIDM_VIEW_LIST (SFVIDM_VIEW_FIRST + 3)
  4715. #define SFVIDM_VIEW_DETAILS (SFVIDM_VIEW_FIRST + 4)
  4716. #define SFVIDM_VIEW_THUMBNAIL (SFVIDM_VIEW_FIRST + 5)
  4717. #define SFVIDM_VIEW_TILE (SFVIDM_VIEW_FIRST + 6)
  4718. #define SFVIDM_VIEW_THUMBSTRIP (SFVIDM_VIEW_FIRST + 7)
  4719. #define SFVIDM_VIEW_LASTVIEW (SFVIDM_VIEW_FIRST + 7)
  4720. // TileView
  4721. // One more for safe keeping
  4722. #define SFVIDM_VIEW_OPTIONS (SFVIDM_VIEW_FIRST + 0x0008)
  4723. #define SFVIDM_VIEW_VIEWMENU (SFVIDM_VIEW_FIRST + 0x0009)
  4724. #define SFVIDM_VIEW_CUSTOMWIZARD (SFVIDM_VIEW_FIRST + 0x000A)
  4725. #define SFVIDM_VIEW_COLSETTINGS (SFVIDM_VIEW_FIRST + 0x000B)
  4726. #define SFVIDM_VIEW_EXTFIRST (SFVIDM_VIEW_FIRST + 0x000C)
  4727. #define SFVIDM_VIEW_EXTLAST (SFVIDM_VIEW_EXTFIRST + 0x0017)
  4728. #define SFVIDM_VIEW_SVEXTFIRST (SFVIDM_VIEW_EXTFIRST)
  4729. #define SFVIDM_VIEW_SVEXTLAST (SFVIDM_VIEW_EXTFIRST + 0x000F)
  4730. #define SFVIDM_VIEW_EXTENDEDFIRST (SFVIDM_VIEW_EXTFIRST + 0x0010)
  4731. #define SFVIDM_VIEW_EXTENDEDLAST (SFVIDM_VIEW_EXTLAST)
  4732. // #define SFVIDM_VIEW_THUMBNAIL (SFVIDM_VIEW_FIRST + 0x0021) defined above
  4733. #define SFVIDM_ARRANGE_FIRST (SFVIDM_FIRST + 0x0050)
  4734. #define SFVIDM_ARRANGE_AUTO (SFVIDM_ARRANGE_FIRST + 0x0001)
  4735. #define SFVIDM_ARRANGE_GRID (SFVIDM_ARRANGE_FIRST + 0x0002)
  4736. #define SFVIDM_ARRANGE_DISPLAYICONS (SFVIDM_ARRANGE_FIRST + 0x0003)
  4737. #define SFVIDM_ARRANGE_AUTOGRID (SFVIDM_ARRANGE_FIRST + 0x0004)
  4738. #define SFVIDM_TOOL_FIRST (SFVIDM_FIRST + 0x0060)
  4739. #define SFVIDM_TOOL_CONNECT (SFVIDM_TOOL_FIRST + 0x0001)
  4740. #define SFVIDM_TOOL_DISCONNECT (SFVIDM_TOOL_FIRST + 0x0002)
  4741. #define SFVIDM_TOOL_OPTIONS (SFVIDM_TOOL_FIRST + 0x0003)
  4742. #define SFVIDM_DEBUG_WEBVIEW (SFVIDM_TOOL_FIRST + 0x0004)
  4743. #define SFVIDM_HELP_FIRST (SFVIDM_FIRST + 0x0070)
  4744. #define SFVIDM_HELP_TOPIC (SFVIDM_HELP_FIRST + 0x0001)
  4745. #define SFVIDM_MISC_FIRST (SFVIDM_FIRST + 0x0100)
  4746. #define SFVIDM_MISC_REFRESH (SFVIDM_MISC_FIRST + 0x0003)
  4747. #define SFVIDM_MISC_HARDREFRESH (SFVIDM_MISC_FIRST + 0x0004)
  4748. // Range for the client's additional menus
  4749. #define SFVIDM_CLIENT_FIRST (SFVIDM_FIRST + 0x0200)
  4750. #define SFVIDM_CLIENT_LAST (SFVIDM_FIRST + 0x02ff)
  4751. // ---- SFVIDM_UNUSED_FIRST (SFVIDM_FIRST + 0x0300)
  4752. #define SFVIDM_DESKTOP_FIRST (SFVIDM_FIRST + 0x0400)
  4753. #define SFVIDM_DESKTOPHTML_WEBCONTENT (SFVIDM_DESKTOP_FIRST + 0x0001)
  4754. #define SFVIDM_DESKTOPHTML_ICONS (SFVIDM_DESKTOP_FIRST + 0x0002)
  4755. #define SFVIDM_DESKTOPHTML_LOCK (SFVIDM_DESKTOP_FIRST + 0x0003)
  4756. #define SFVIDM_DESKTOPHTML_WIZARD (SFVIDM_DESKTOP_FIRST + 0x0004)
  4757. #define SFVIDM_DESKTOP_LAST (SFVIDM_FIRST + 0x04ff)
  4758. #define SFVIDM_COLUMN_FIRST (SFVIDM_FIRST + 0x0500)
  4759. #define SFVIDM_COLUMN_LAST (SFVIDM_FIRST + 0x05ff)
  4760. #define SFVIDM_GROUPSEP (SFVIDM_FIRST + 0x0600)
  4761. #define SFVIDM_GROUPBY (SFVIDM_FIRST + 0x0601)
  4762. #define SFVIDM_GROUPSFIRST (SFVIDM_FIRST + 0x0602)
  4763. #define SFVIDM_GROUPSLAST (SFVIDM_FIRST + 0x067f)
  4764. #define SFVIDM_GROUPSEXTENDEDFIRST (SFVIDM_FIRST + 0x0680)
  4765. #define SFVIDM_GROUPSEXTENDEDLAST (SFVIDM_FIRST + 0x06ff)
  4766. // Range for context menu id's
  4767. #define SFVIDM_CONTEXT_FIRST (SFVIDM_FIRST + 0x0800)
  4768. #define SFVIDM_CONTEXT_LAST (SFVIDM_FIRST + 0x0900)
  4769. #define SFVIDM_BACK_CONTEXT_FIRST (SFVIDM_FIRST + 0x0901)
  4770. #define SFVIDM_BACK_CONTEXT_LAST (SFVIDM_FIRST + 0x09ff)
  4771. // DOC'ed for DOJ compliance:
  4772. typedef COPYHOOKINFO *LPCOPYHOOKINFO;
  4773. // uMsg wParam lParam
  4774. #define DVM_MERGEMENU SFVM_MERGEMENU // uFlags LPQCMINFO
  4775. #define DVM_INVOKECOMMAND SFVM_INVOKECOMMAND // idCmd 0
  4776. #define DVM_GETHELPTEXT SFVM_GETHELPTEXT // idCmd,cchMax pszText - Ansi
  4777. #define DVM_GETTOOLTIPTEXT SFVM_GETTOOLTIPTEXT // idCmd,cchMax pszText
  4778. #define DVM_GETBUTTONINFO SFVM_GETBUTTONINFO // 0 LPTBINFO
  4779. #define DVM_GETBUTTONS SFVM_GETBUTTONS // idCmdFirst,cbtnMax LPTBBUTTON
  4780. #define DVM_INITMENUPOPUP SFVM_INITMENUPOPUP // idCmdFirst,nIndex hmenu
  4781. #define DVM_SELCHANGE SFVM_SELCHANGE // idCmdFirst,nItem PDVSELCHANGEINFO
  4782. #define DVM_DRAWITEM SFVM_DRAWITEM // idCmdFirst pdis
  4783. #define DVM_MEASUREITEM SFVM_MEASUREITEM // idCmdFirst pmis
  4784. #define DVM_EXITMENULOOP SFVM_EXITMENULOOP // - -
  4785. #define DVM_RELEASE SFVM_PRERELEASE // - lSelChangeInfo (ShellFolder private)
  4786. #define DVM_GETCCHMAX SFVM_GETCCHMAX // pidlItem pcchMax
  4787. #define DVM_FSNOTIFY SFVM_FSNOTIFY // LPITEMIDLIST* lEvent
  4788. #define DVM_WINDOWCREATED SFVM_WINDOWCREATED // hwnd PDVSELCHANGEINFO
  4789. #define DVM_WINDOWDESTROY SFVM_WINDOWDESTROY // hwnd PDVSELCHANGEINFO
  4790. #define DVM_REFRESH SFVM_REFRESH // - lSelChangeInfo
  4791. #define DVM_SETFOCUS SFVM_SETFOCUS // - lSelChangeInfo
  4792. #define DVM_KILLFOCUS 19 // unused
  4793. #define DVM_QUERYCOPYHOOK SFVM_QUERYCOPYHOOK // - -
  4794. #define DVM_NOTIFYCOPYHOOK SFVM_NOTIFYCOPYHOOK // - LPCOPYHOOKINFO
  4795. #define DVM_NOTIFY SFVM_NOTIFY // idFrom LPNOTIFY
  4796. #define DVM_GETDETAILSOF SFVM_GETDETAILSOF // iColumn PDETAILSINFO
  4797. #define DVM_COLUMNCLICK SFVM_COLUMNCLICK // iColumn -
  4798. #define DVM_QUERYFSNOTIFY SFVM_QUERYFSNOTIFY // - FSNotifyEntry *
  4799. #define DVM_DEFITEMCOUNT SFVM_DEFITEMCOUNT // - PINT
  4800. #define DVM_DEFVIEWMODE SFVM_DEFVIEWMODE // - PFOLDERVIEWMODE
  4801. #define DVM_UNMERGEMENU SFVM_UNMERGEMENU // uFlags
  4802. #define DVM_INSERTITEM SFVM_INSERTITEM // pidl PDVSELCHANGEINFO
  4803. #define DVM_DELETEITEM SFVM_DELETEITEM // pidl PDVSELCHANGEINFO
  4804. #define DVM_UPDATESTATUSBAR SFVM_UPDATESTATUSBAR // - lSelChangeInfo
  4805. #define DVM_BACKGROUNDENUM SFVM_BACKGROUNDENUM //
  4806. #define DVM_GETWORKINGDIR SFVM_GETWORKINGDIR //
  4807. #define DVM_GETCOLSAVESTREAM SFVM_GETCOLSAVESTREAM // flags IStream **
  4808. #define DVM_SELECTALL SFVM_SELECTALL // lSelChangeInfo
  4809. #define DVM_DIDDRAGDROP SFVM_DIDDRAGDROP // dwEffect IDataObject *
  4810. #define DVM_SUPPORTSIDENTIFY SFVM_SUPPORTSIDENTITY // - -
  4811. #define DVM_FOLDERISPARENT SFVM_FOLDERISPARENT // - pidlChild
  4812. // max length for guid strings
  4813. #define GUIDSTR_MAX (1+ 8 + 1 + 4 + 1 + 4 + 1 + 4 + 1 + 12 + 1 + 1)
  4814. typedef struct _DVSELCHANGEINFO {
  4815. UINT uOldState;
  4816. UINT uNewState;
  4817. LPARAM lParamItem;
  4818. LPARAM* plParam;
  4819. } DVSELCHANGEINFO, *PDVSELCHANGEINFO;
  4820. // DOC'ed for DOJ compliance:
  4821. // DOC'ed for DOJ Compliance
  4822. // Get the last sorting parameter given to FolderView
  4823. #define SFVM_GETARRANGEPARAM 0x00000002
  4824. #define ShellFolderView_GetArrangeParam(_hwnd) \
  4825. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETARRANGEPARAM, 0L)
  4826. // DOC'ed for DOJ Compliance
  4827. // Gets the count of objects in the view
  4828. #define SFVM_GETOBJECTCOUNT 0x00000004
  4829. #define ShellFolderView_GetObjectCount(_hwnd) \
  4830. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETOBJECTCOUNT, (LPARAM)0)
  4831. // Returns a pointer to the Idlist associated with the specified index
  4832. // Returns NULL if at end of list.
  4833. #define SFVM_GETOBJECT 0x00000005
  4834. #define ShellFolderView_GetObject(_hwnd, _iObject) \
  4835. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_GETOBJECT, _iObject)
  4836. // DOC'ed for DOJ Compliance
  4837. // Sets the redraw mode for the window that is displaying the information
  4838. #define SFVM_SETREDRAW 0x00000008
  4839. #define ShellFolderView_SetRedraw(_hwnd, fRedraw) \
  4840. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_SETREDRAW, (LPARAM)fRedraw)
  4841. // DOC'ed for DOJ Compliance
  4842. // Checks if the current drop is on the view window
  4843. // lparam is unused
  4844. // return value is TRUE if the current drop is upon the background of the
  4845. // view window, FALSE otherwise
  4846. #define SFVM_ISDROPONSOURCE 0x0000000a
  4847. #define ShellFolderView_IsDropOnSource(_hwnd, _pdtgt) \
  4848. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_ISDROPONSOURCE, (LPARAM)_pdtgt)
  4849. // Moves the selected icons in the listview
  4850. // lparam is a pointer to a drop target
  4851. // return value is unused
  4852. #define SFVM_MOVEICONS 0x0000000b
  4853. #define ShellFolderView_MoveIcons(_hwnd, _pdt) \
  4854. (void)SHShellFolderView_Message(_hwnd, SFVM_MOVEICONS, (LPARAM)(LPDROPTARGET)_pdt)
  4855. // Gets the start point of a drag-drop
  4856. // lparam is a pointer to a point
  4857. // return value is unused
  4858. #define SFVM_GETDRAGPOINT 0x0000000c
  4859. #define ShellFolderView_GetDragPoint(_hwnd, _ppt) \
  4860. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_GETDRAGPOINT, (LPARAM)(LPPOINT)_ppt)
  4861. // Gets the end point of a drag-drop
  4862. // lparam is a pointer to a point
  4863. // return value is unused
  4864. #define SFVM_GETDROPPOINT 0x0000000d
  4865. #define ShellFolderView_GetDropPoint(_hwnd, _ppt) \
  4866. SHShellFolderView_Message(_hwnd, SFVM_GETDROPPOINT, (LPARAM)(LPPOINT)_ppt)
  4867. #define ShellFolderView_GetAnchorPoint(_hwnd, _fStart, _ppt) \
  4868. (BOOL)((_fStart) ? ShellFolderView_GetDragPoint(_hwnd, _ppt) : ShellFolderView_GetDropPoint(_hwnd, _ppt))
  4869. // DOC'ed for DOJ Compliance
  4870. // Determines if a given drop target interface is the one being used for
  4871. // the background of the ShellFolderView (as opposed to an object in the
  4872. // view)
  4873. // lparam is a pointer to a drop target interface
  4874. // return value is TRUE if it is the background drop target, FALSE otherwise
  4875. #define SFVM_ISBKDROPTARGET 0x0000000f
  4876. #define ShellFolderView_IsBkDropTarget(_hwnd, _pdptgt) \
  4877. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_ISBKDROPTARGET, (LPARAM)(LPDROPTARGET)_pdptgt)
  4878. // DOC'ed for DOJ Compliance
  4879. // called by defcm.c when it does a copy/cut
  4880. // sets auto arrange
  4881. #define SFVM_AUTOARRANGE 0x00000011
  4882. #define ShellFolderView_AutoArrange(_hwnd) \
  4883. (void)SHShellFolderView_Message(_hwnd, SFVM_AUTOARRANGE, 0)
  4884. // sets snap to grid
  4885. #define SFVM_ARRANGEGRID 0x00000012
  4886. #define ShellFolderView_ArrangeGrid(_hwnd) \
  4887. (void)SHShellFolderView_Message(_hwnd, SFVM_ARRANGEGRID, 0)
  4888. #define SFVM_GETAUTOARRANGE 0x00000013
  4889. #define ShellFolderView_GetAutoArrange(_hwnd) \
  4890. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_GETAUTOARRANGE, 0)
  4891. #define SFVM_GETSELECTEDCOUNT 0x00000014
  4892. #define ShellFolderView_GetSelectedCount(_hwnd) \
  4893. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_GETSELECTEDCOUNT, 0)
  4894. typedef ITEMSPACING *LPITEMSPACING;
  4895. #define SFVM_GETITEMSPACING 0x00000015
  4896. #define ShellFolderView_GetItemSpacing(_hwnd, lpis) \
  4897. (BOOL)SHShellFolderView_Message(_hwnd, SFVM_GETITEMSPACING, (LPARAM)lpis)
  4898. // Causes an object to be repainted
  4899. #define SFVM_REFRESHOBJECT 0x00000016
  4900. #define ShellFolderView_RefreshObject(_hwnd, _ppidl) \
  4901. (LPARAM)SHShellFolderView_Message(_hwnd, SFVM_REFRESHOBJECT, (LPARAM)_ppidl)
  4902. // Causes the the whole view to be refreshed
  4903. #define ShellFolderView_RefreshAll(_hwnd) \
  4904. (LPARAM)PostMessage(_hwnd, WM_KEYDOWN, (WPARAM)VK_F5, (LPARAM)0);
  4905. // DOC'ed for DOJ Compliance
  4906. // SVM_SELECTANDPOSITIONITEM lParam
  4907. typedef struct
  4908. {
  4909. LPCITEMIDLIST pidl; // relative pidl to the view
  4910. UINT uSelectFlags; // select flags
  4911. BOOL fMove; // if true, we should also move it to point pt
  4912. POINT pt;
  4913. } SFM_SAP;
  4914. // shell view messages
  4915. #define SVM_SELECTITEM (WM_USER + 1)
  4916. #define SVM_SELECTANDPOSITIONITEM (WM_USER + 5)
  4917. #include <poppack.h> /* Return to byte packing */
  4918. //===========================================================================
  4919. // CDefShellFolder members (for easy subclassing)
  4920. //===========================================================================
  4921. // Default implementation (no dependencies to the instance data)
  4922. STDMETHODIMP CDefShellFolder_QueryInterface(IShellFolder *psf, REFIID riid, void **ppv);
  4923. STDMETHODIMP CDefShellFolder_BindToStorage(IShellFolder *psf, LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv);
  4924. STDMETHODIMP CDefShellFolder_BindToObject(IShellFolder *psf, LPCITEMIDLIST pidl, LPBC pbc, REFIID riid, void **ppv);
  4925. STDMETHODIMP CDefShellFolder_GetAttributesOf(IShellFolder *psf, UINT cidl, LPCITEMIDLIST * apidl, ULONG * rgfOut);
  4926. STDMETHODIMP CDefShellFolder_SetNameOf(IShellFolder *psf, HWND hwndOwner, LPCITEMIDLIST pidl, LPCOLESTR pszName, DWORD dwReserved, LPITEMIDLIST * ppidlOut);
  4927. // File Search APIS
  4928. // DOC'ed for DOJ compliance
  4929. SHSTDAPI_(void) Control_RunDLL(HWND hwndStub, HINSTANCE hAppInstance, LPSTR pszCmdLine, int nCmdShow);
  4930. SHSTDAPI_(void) Control_RunDLLW(HWND hwndStub, HINSTANCE hAppInstance, LPWSTR pszCmdLine, int nCmdShow);
  4931. SHSTDAPI_(void) Control_RunDLLAsUserW(HWND hwndStub, HINSTANCE hAppInstance, LPWSTR lpwszCmdLine, int nCmdShow);
  4932. // to add 16 bit pages to 32bit things. hGlobal can be NULL
  4933. SHSTDAPI_(UINT) SHAddPages16(HGLOBAL hGlobal, LPCTSTR pszDllEntry, LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam);
  4934. // DOC'ed for DOJ compliance
  4935. // Access to MSHMTL's ditherer
  4936. /* Definition of interface: IIntDitherer */
  4937. #undef INTERFACE
  4938. #define INTERFACE IIntDitherer
  4939. DECLARE_INTERFACE_(IIntDitherer, IUnknown)
  4940. {
  4941. #ifndef NO_BASEINTERFACE_FUNCS
  4942. // *** IUnknown methods ***
  4943. STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE;
  4944. STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  4945. STDMETHOD_(ULONG, Release)(THIS) PURE;
  4946. #endif
  4947. // *** IIntDitherer methods ***
  4948. STDMETHOD(DitherTo8bpp)(THIS_ BYTE * pDestBits, LONG nDestPitch,
  4949. BYTE * pSrcBits, LONG nSrcPitch, REFGUID bfidSrc,
  4950. RGBQUAD * prgbDestColors, RGBQUAD * prgbSrcColors,
  4951. BYTE * pbDestInvMap,
  4952. LONG x, LONG y, LONG cx, LONG cy,
  4953. LONG lDestTrans, LONG lSrcTrans) PURE;
  4954. };
  4955. #ifdef COBJMACROS
  4956. #define IntDitherer_QueryInterface(This,riid,ppvObject) \
  4957. (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
  4958. #define IntDitherer_AddRef(This) \
  4959. (This)->lpVtbl -> AddRef(This)
  4960. #define IntDitherer_Release(This) \
  4961. (This)->lpVtbl -> Release(This)
  4962. #define IntDitherer_DitherTo8bpp(This, pDestBits, nDestPitch, \
  4963. pSrcBits, nSrcPitch, bfidSrc, \
  4964. prgbDestColors, prgbSrcColors, \
  4965. pbDestInvMap, x, y, cx, cy, \
  4966. lDestTrans, lSrcTrans) \
  4967. (This)->lpVtbl -> DitherTo8bpp(This, pDestBits, nDestPitch, pSrcBits, nSrcPitch, bfidSrc, \
  4968. prgbDestColors, prgbSrcColors, pbDestInvMap, x, y, cx, cy, lDestTrans, lSrcTrans)
  4969. #endif
  4970. // PID_IS_SCHEME [VT_UI4] Scheme value
  4971. #define PID_IS_FIRST 2
  4972. #define PID_IS_SCHEME 3
  4973. #define PID_IS_IDLIST 14
  4974. #define PID_IS_LAST 14
  4975. // PID_INTSITE_FLAGS [VT_UI4] PIDISF_ flags
  4976. // PID_INTSITE_CONTENTLEN [VT_UI4] Content length
  4977. // PID_INTSITE_CONTENTCODE [VT_UI8] Content code
  4978. // PID_INTSITE_FRAGMENT [VT_NULL] Fragments
  4979. #define PID_INTSITE_FIRST 2
  4980. #define PID_INTSITE_FRAGMENT 17
  4981. #define PID_INTSITE_LAST 21
  4982. //Is URL entered in IE history bucket?
  4983. #define PIDISF_HISTORY 0x10000000
  4984. // Athena needs this to determine whether to double click or not.
  4985. //
  4986. // NOTE: if user uninstalls IE4, the Win95 code will
  4987. // realize that the size has changed (even though it's not
  4988. // in this struct, it is saved) and drop back to default state.
  4989. //
  4990. // Since we're exporting this so ISVs can get access to our flags,
  4991. // let's avoid the need for a thunk and export the beginning section
  4992. // of this structure ONLY. Here are the A and W versions for internal use:
  4993. //
  4994. // DOC'ed for DOJ compliance
  4995. // These were in Win95 //
  4996. // The below were added for IE4 //
  4997. // These must have been an OSR release, as they aren't on \\guilo\slmadd\src\dev\inc16\shsemip.h
  4998. // This was added for IE4
  4999. // If you need a new flag, steal a bit from from fSpareFlags.
  5000. //
  5001. // If you add any fields to this structure, you
  5002. // must also add upgrade code to shell32\util.cpp.
  5003. //
  5004. //
  5005. // If you add any fields to this structure, you
  5006. // must also add upgrade code to shell32\util.cpp.
  5007. //
  5008. #define SHELLSTATEVERSION 13 // rev if defaults change but size doesn't //
  5009. // And here's the beginning portion for public use:
  5010. // CmdID's for CGID_MENUDESKBAR
  5011. #define MBCID_GETSIDE 1
  5012. #define MBCID_RESIZE 2
  5013. #define MBCID_SETEXPAND 3
  5014. #define MBCID_SETFLAT 4
  5015. #define MBCID_NOBORDER 5
  5016. // menubar orientation
  5017. #define MENUBAR_LEFT ABE_LEFT
  5018. #define MENUBAR_TOP ABE_TOP
  5019. #define MENUBAR_RIGHT ABE_RIGHT
  5020. #define MENUBAR_BOTTOM ABE_BOTTOM
  5021. //
  5022. // Net Access Wizard - called from NetID and WinLogon.
  5023. //
  5024. #define NAW_NETID 0x00 // called from netid tab
  5025. #define NAW_PSDOMAINJOINED 0x02 // post setup (joined domain)
  5026. #define NAW_PSDOMAINJOINFAILED 0x03 // post setup (domain joined failed)
  5027. STDAPI NetAccessWizard(HWND hwnd, UINT uType, BOOL *pfReboot);
  5028. typedef HRESULT (CALLBACK *LPNETACCESSWIZARD)(HWND hwnd, UINT uType, BOOL *pfReboot);
  5029. STDAPI ClearAutoLogon(VOID);
  5030. //
  5031. // Net Places API's called from mpr.
  5032. //
  5033. typedef enum
  5034. {
  5035. NETPLACES_WIZARD_MAPDRIVE = 0,
  5036. NETPLACES_WIZARD_ADDPLACE,
  5037. } NETPLACESWIZARDTYPE;
  5038. STDAPI_(DWORD)
  5039. NetPlacesWizardDoModal(
  5040. LPCONNECTDLGSTRUCTW lpConnDlgStruct,
  5041. NETPLACESWIZARDTYPE npwt,
  5042. BOOL fIsRoPath
  5043. );
  5044. // Definition for the exported function types (for GetProcAddress)
  5045. typedef DWORD (STDAPICALLTYPE*NetPlacesWizardDoModal_t)(LPCONNECTDLGSTRUCTW lpConnDlgStruct, NETPLACESWIZARDTYPE npwt, BOOL fIsROPath);
  5046. //
  5047. // moved here from nettarg.h (shell\inc)
  5048. //
  5049. // nCmdID
  5050. #define CFCID_SETENUMTYPE 0
  5051. //nCmdExecOpt
  5052. #define CFCOPT_ENUMINCOMING 1
  5053. #define CFCOPT_ENUMOUTGOING 2
  5054. #define CFCOPT_ENUMALL 3
  5055. /****************************************************
  5056. Items to display in the shutdown dialog (dwItems)
  5057. -------------------------------------------------
  5058. These flags can be |'d when passed in. A single
  5059. value will be returned, with NONE indicating an
  5060. error or the user clicked cancel.
  5061. -dsheldon
  5062. ****************************************************/
  5063. #define SHTDN_NONE 0x000000000
  5064. #define SHTDN_LOGOFF 0x000000001
  5065. #define SHTDN_SHUTDOWN 0x000000002
  5066. #define SHTDN_RESTART 0x000000004
  5067. #define SHTDN_RESTART_DOS 0x000000008
  5068. #define SHTDN_SLEEP 0x000000010
  5069. #define SHTDN_SLEEP2 0x000000020
  5070. #define SHTDN_HIBERNATE 0x000000040
  5071. #define SHTDN_DISCONNECT 0x000000080
  5072. // Shutdown dialog function exported from MSGINA.dll
  5073. STDAPI_(DWORD) ShellShutdownDialog(HWND hwndParent, LPCTSTR szUsername, DWORD dwExcludeItems);
  5074. typedef DWORD (STDAPICALLTYPE*PFNSHELLSHUTDOWNDIALOG)(HWND hwndParent, LPCTSTR szUsername, DWORD dwExcludeItems);
  5075. // Define a clipboard format for a data object to pass a user's SID
  5076. // A data object supporting this format is passed to IShellExtInit::Initialize
  5077. // before calling IShellPropSheetExt::AddPages.
  5078. #define CFSTR_USERPROPPAGESSID TEXT("UserPropertyPagesSid")
  5079. // Registry paths where extra IShellPropSheetExt handlers can be put so that
  5080. // extended pages are added to the CPL or User Properties
  5081. #define REGSTR_USERSANDPASSWORDS_CPL \
  5082. /* HKLM\\ */ TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Users and Passwords")
  5083. // CLSIDs go in HKLM\Software\Microsoft\Windows\CurrentVersion\Control Panel\Users and Passwords\shellex\PropertySheetHandlers
  5084. #define REGSTR_USERPROPERTIES_SHEET \
  5085. /* HKLM\\ */ TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Users and Passwords\\User Properties")
  5086. // CLSIDs go in HKLM\Software\Microsoft\Windows\CurrentVersion\Control Panel\Users and Passwords\User Properties\shellex\PropertySheetHandlers
  5087. //
  5088. // SHFileSysBindToStorage()
  5089. // Wrap of file system IShellFolder::BindToStorage
  5090. //
  5091. // pszPath // storage path
  5092. // grfFileAttrib // optional Win32/64 file attribute bits. Use 0 to specify default behavior
  5093. // grfMode // STGM_ mode flags.
  5094. // grfFlags // BIND_xxx bind flags
  5095. // riid // storage interface ID
  5096. // **ppv // outbound storage interface pointer.
  5097. //
  5098. SHSTDAPI SHFileSysBindToStorage(LPCWSTR pszPath, DWORD grfFileAttrib, DWORD grfMode, DWORD grfFlags, REFIID riid, void **ppv);
  5099. // DOC'ed for DOJ compliance
  5100. // SHIsLegacyAnsiProperty()
  5101. //
  5102. // Determine whether the property is a legacy ANSI property, and if so,
  5103. // compute a conversion type for the property.
  5104. //
  5105. // fmtid, // property set identifier
  5106. // propid, // property identifier
  5107. // pvt, // optional: if non-null, contains on input the VARTYPE for the property; on output,
  5108. // the converted type. (e.g., VT_LPSTR <--> VT_LPWSTR).
  5109. SHSTDAPI_(BOOL) SHIsLegacyAnsiProperty( REFFMTID fmtid, PROPID propid, IN OUT OPTIONAL VARTYPE* pvt );
  5110. //-------------------------------------------------------------------------//
  5111. // linkwnd.h - declaration of LinkWindow control
  5112. //
  5113. // LinkWindow supports HTML-like embedded links in the caption text.
  5114. // (e.g. "<a>Click Here</a> to see something cool"
  5115. //
  5116. // An unlimited number of embedded links are supported. When the user clicks
  5117. // on a link, an WM_NOTIFY - LWN_CLICK notification message is sent to the
  5118. // parent window. The message data includes the zero-based index
  5119. // (left to right orientation) of the link that was clicked.
  5120. //
  5121. // scotthan: author/owner
  5122. // dsheldon: moved this to shlobjp.h. Eventually destined for comctl32.
  5123. EXTERN_C BOOL WINAPI LinkWindow_RegisterClass() ;
  5124. EXTERN_C BOOL WINAPI LinkWindow_UnregisterClass( HINSTANCE ) ;
  5125. #define INVALID_LINK_INDEX (-1)
  5126. #define MAX_LINKID_TEXT 48
  5127. #define LINKWINDOW_CLASS TEXT("Link Window")
  5128. #define LWS_TRANSPARENT 0x0001
  5129. #define LWS_HOTTRACK 0x0002
  5130. #define LWIF_ITEMINDEX 0x00000001
  5131. #define LWIF_STATE 0x00000002
  5132. #define LWIF_ITEMID 0x00000004
  5133. #define LWIF_URL 0x00000008
  5134. #define LWIS_FOCUSED 0x0001
  5135. #define LWIS_ENABLED 0x0002
  5136. #define LWIS_VISITED 0x0004
  5137. #define LWIS_SHELLEXECURL 0x00000008 // If the caller didn't handle the msg (NM_CLICK), then ShellExecute the szURL
  5138. // wininet.h::INTERNET_MAX_URL_LENGTH.
  5139. // Currently, this breaks various dependents.
  5140. #define LW_MAX_URL_LENGTH (2048 + 32 + sizeof("://"))
  5141. // LWITEM
  5142. typedef struct tagLWITEMA {
  5143. UINT mask ;
  5144. int iLink ;
  5145. UINT state ;
  5146. UINT stateMask ;
  5147. CHAR szID[MAX_LINKID_TEXT] ;
  5148. CHAR szUrl[LW_MAX_URL_LENGTH] ;
  5149. } LWITEMA, *LPLWITEMA;
  5150. typedef struct tagLWITEMW {
  5151. UINT mask ;
  5152. int iLink ;
  5153. UINT state ;
  5154. UINT stateMask ;
  5155. WCHAR szID[MAX_LINKID_TEXT] ;
  5156. WCHAR szUrl[LW_MAX_URL_LENGTH] ;
  5157. } LWITEMW, *LPLWITEMW;
  5158. // LWHITTESTINFO
  5159. typedef struct tagLWHITTESTINFOA {
  5160. POINT pt ;
  5161. LWITEMA item ;
  5162. } LWHITTESTINFOA, *LPLWHITTESTINFOA;
  5163. // LWHITTESTINFO
  5164. typedef struct tagLWHITTESTINFOW {
  5165. POINT pt ;
  5166. LWITEMW item ;
  5167. } LWHITTESTINFOW, *LPLWHITTESTINFOW;
  5168. // NMLINKWND
  5169. typedef struct tagNMLINKWNDA {
  5170. NMHDR hdr;
  5171. LWITEMA item ;
  5172. } NMLINKWNDA, *LPNMLINKWNDA;
  5173. typedef struct tagNMLINKWNDW {
  5174. NMHDR hdr;
  5175. LWITEMW item ;
  5176. } NMLINKWNDW, *LPNMLINKWNDW;
  5177. #ifdef UNICODE
  5178. #define LWITEM LWITEMW
  5179. #define LPLWITEM LPLWITEMW
  5180. #define LWHITTESTINFO LWHITTESTINFOW
  5181. #define LPLWHITTESTINFO LPLWHITTESTINFOW
  5182. #define NMLINKWND NMLINKWNDW
  5183. #define LPNMLINKWND LPNMLINKWNDW
  5184. #else //UNICODE
  5185. #define LWITEM LWITEMA
  5186. #define LPLWITEM LPLWITEMA
  5187. #define LWHITTESTINFO LWHITTESTINFOA
  5188. #define LPLWHITTESTINFO LPLWHITTESTINFOA
  5189. #define NMLINKWND NMLINKWNDA
  5190. #define LPNMLINKWND LPNMLINKWNDA
  5191. #endif //UNICODE
  5192. // LinkWindow notifications
  5193. // NM_CLICK // wParam: n/a, lParam: LPLWITEM, ret: ignored.
  5194. // LinkWindow messages
  5195. #define LWM_HITTEST (WM_USER+0x300) // wParam: n/a, lparam: LPLWHITTESTINFO, ret: BOOL
  5196. #define LWM_GETIDEALHEIGHT (WM_USER+0x301) // wParam: n/a, lparam: n/a, ret: cy
  5197. #define LWM_SETITEM (WM_USER+0x302) // wParam: n/a, lparam: LWITEM*, ret: BOOL
  5198. #define LWM_GETITEM (WM_USER+0x303) // wParam: n/a, lparam: LWITEM*, ret: BOOL
  5199. //-------------------------------------------------------------------------//
  5200. // INTERNAL: Darwin link tracking for start menu
  5201. // lives in unicpp\startmnu.cpp
  5202. #if _WIN32_IE >= 0x0600
  5203. // Note: SHRegisterDarwinLink takes ownership of pidlFull. fUpdate means: update the Darwin state right away
  5204. SHSTDAPI_(BOOL) SHRegisterDarwinLink(LPITEMIDLIST pidlFull, LPWSTR pszDarwinID, BOOL fUpdate);
  5205. // Use this function to update the Darwin state for all registered Darwin shortcuts.
  5206. SHSTDAPI_(void) SHReValidateDarwinCache();
  5207. SHSTDAPI SHParseDarwinIDFromCacheW(LPWSTR pszDarwinDescriptor, LPWSTR *ppwszOut);
  5208. #endif
  5209. //
  5210. // GroupButton is a variation of a group box control but supports a link-like
  5211. // caption bar, and optionally, can be buddied to a containee window for
  5212. // auto-positioning behavior.
  5213. //
  5214. // scotthan: author/owner
  5215. #define GROUPBUTTON_CLASS TEXT("GroupButton")
  5216. EXTERN_C ATOM WINAPI GroupButton_RegisterClass() ;
  5217. EXTERN_C BOOL WINAPI GroupButton_UnregisterClass() ;
  5218. #include <pshpack8.h>
  5219. typedef struct tagGBPLACEMENT
  5220. {
  5221. LONG x ; // in: top left; -1 to ignore
  5222. LONG y ; // in: top right; -1 to ignore
  5223. LONG cx ; // in: width to assign; -1 to ignore.
  5224. // If cx != -1, cxContain and cxMax are ignored.
  5225. LONG cy ; // in: height to assign; -1 to ignore.
  5226. // If cy != -1, cyContain and cyMax are ignored.
  5227. LONG cxBuddy ; // in: width of buddy area; -1 to ignore
  5228. LONG cyBuddy ; // in: height of buddy area; -1 to ignore
  5229. LONG cxBuddyMargin ;// in: width of buddy margin; -1 to ignore
  5230. LONG cyBuddyMargin ;// in: height of buddy margin; -1 to ignore
  5231. RECT rcBuddy ; // out: new buddy rect in parent coords.
  5232. RECT rcWindow ; // out: new window rect in parent coords.
  5233. HDWP hdwp ; // optional in: Non-NULL => DeferWindowPos,
  5234. // NULL => SetWindowPos
  5235. } GBPLACEMENT, *PGBPLACEMENT, *LPGBPLACEMENT ;
  5236. #include <poppack.h> /* Return to byte packing */
  5237. // Buddy flags
  5238. #define GBBF_HRESIZE 0x00000001
  5239. #define GBBF_VRESIZE 0x00000002
  5240. #define GBBF_HSCROLL 0x00000004
  5241. #define GBBF_VSCROLL 0x00000008
  5242. #define GBBF_HSLAVE 0x00000010
  5243. #define GBBF_VSLAVE 0x00000020
  5244. // Group button messages
  5245. #define GBM_FIRST (WM_USER+0x400) // arbitrary
  5246. #define GBM_SETPLACEMENT (GBM_FIRST+0) // WPARAM: n/a, LPARAM: PGBPLACEMENT, return: BOOL
  5247. #define GBM_SETBUDDY (GBM_FIRST+1) // WPARAM: HWND hwndBuddy, LPARAM: dwBuddyFlags, return: BOOL
  5248. #define GBM_GETBUDDY (GBM_FIRST+2) // WPARAM: n/a, LPARAM: n/a, return: HWND
  5249. #define GBM_SETDROPSTATE (GBM_FIRST+3) // WPARAM: BOOL fDropped, LPARAM: n/a, return: BOOL
  5250. #define GBM_GETDROPSTATE (GBM_FIRST+4) // WPARAM: n/a, LPARAM: n/a, return: BOOL fDropped
  5251. #define GBM_LAST GBM_GETDROPSTATE
  5252. typedef struct tagGBNQUERYBUDDYSIZE
  5253. {
  5254. NMHDR hdr;
  5255. LONG cx ;
  5256. LONG cy ;
  5257. } GBNQUERYBUDDYSIZE, *LPGBNQUERYBUDDYSIZE, *PGBNQUERYBUDDYSIZE ;
  5258. // Group button notifications
  5259. #define GBN_FIRST 2000U
  5260. #define GBN_LAST 2020U
  5261. #define GBN_QUERYBUDDYHEIGHT (GBN_FIRST+0) // LPARAM: LPGBNQUERYBUDDYSIZE
  5262. #define GBN_QUERYBUDDYWIDTH (GBN_FIRST+1) // LPARAM: LPGBNQUERYBUDDYSIZE.
  5263. // create standard IExtractIcon for file system like things (that does not really exist)
  5264. // DOC'ed for DOJ compliance
  5265. // Limit Input Mask values:
  5266. #define LIM_FLAGS 0x00000001 // dwFlags contains valid data. Otherwise all default values are used.
  5267. #define LIM_FILTER 0x00000002 // pszFilter contains valid data. At least one of the filter and mask fields must be used. Both can be used it desired.
  5268. #define LIM_HINST 0x00000008 // hinst contains valid data
  5269. #define LIM_TITLE 0x00000010 // pszTitle contains valid data. This data will be shown in bold at the top of any tooltips displayed.
  5270. #define LIM_MESSAGE 0x00000020 // pszMessage contains valid data. This data will be shown in default font below the title if a title is also used.
  5271. #define LIM_ICON 0x00000040 // hicon contains valid data. This icon will be displayed in front of the title if a title is given.
  5272. #define LIM_NOTIFY 0x00000080 // hwndNotify contains the window handle that should receive any notification messages. By default, the parent of hwndEdit recieves notifications.
  5273. #define LIM_TIMEOUT 0x00000100 // iTimeout is valid. Otherwise the default timeout of 10 seconds is used.
  5274. #define LIM_TIPWIDTH 0x00000200 // cxTipWidth is valid. Otherwiser the default is 500 pixels.
  5275. // Limit Input Flags values:
  5276. #define LIF_INCLUDEFILTER 0x00000000 // default value. pszFilter is a string of allowable characters.
  5277. #define LIF_EXCLUDEFILTER 0x00000001 // pszFilter is a string of excluded characters.
  5278. #define LIF_CATEGORYFILTER 0x00000002 // pszFilter is not a pointer, but rather its a bitfield indicating types or characters. If combined with LIF_EXCLUDEFILTER these are excluded categories, otherwise they are allowed categories.
  5279. #define LIF_WARNINGBELOW 0x00000000 // default value. Balloon tooltips will be shown below the window by default.
  5280. #define LIF_WARNINGABOVE 0x00000004 // Ballon tooltips will be shown above the window by default.
  5281. #define LIF_WARNINGCENTERED 0x00000008 // Ballon tooltips will be shown pointing to the center of the window.
  5282. #define LIF_WARNINGOFF 0x00000010 // no balloon tooltip will be displayed upon invalid input.
  5283. #define LIF_FORCEUPPERCASE 0x00000020 // all characters will be converted to upper case. Cannot be use with LIF_FORCELOWERCASE.
  5284. #define LIF_FORCELOWERCASE 0x00000040 // all characters will be converted to lower case. Cannot be use with LIF_FORCEUPPERCASE.
  5285. #define LIF_MEESAGEBEEP 0x00000000 // default value. A tone will be played to alert the user if they attemp invalid input.
  5286. #define LIF_SILENT 0x00000080 // No tone will be played.
  5287. #define LIF_NOTIFYONBADCHAR 0x00000100 // a notify message will be sent to hwndNotify when invalid input is attempted.
  5288. #define LIF_HIDETIPONVALID 0x00000200 // if the tooltip is displayed, it should be hidden when the next valid character is entered. By default, the tip remains visible for iTimeOut milliseconds.
  5289. #define LIF_PASTESKIP 0x00000000 // default value. When pasting, skip the bad characters and paste all of the good characters.
  5290. #define LIF_PASTESTOP 0x00000400 // When pasting, stop when the first bad character is incountered. Valid characters in front of this will get pasted.
  5291. #define LIF_PASTECANCEL 0x00000800 // When pasting, abort the entire paste if any characters are invalid.
  5292. #define LIF_KEEPCLIPBOARD 0x00001000 // When pasting, don't modify the contents of the clipboard when there are invalid characters. By defualt the clipboard is changed. How it is changed depends on which LIF_PASTE* flag is used.
  5293. // Limit Input Category Filters:
  5294. // these flags use the result of GetStringTypeEx with CT_TYPE1:
  5295. #define LICF_UPPER 0x00000001 // Uppercase
  5296. #define LICF_LOWER 0x00000002 // Lowercase
  5297. #define LICF_DIGIT 0x00000004 // Decimal digits
  5298. #define LICF_SPACE 0x00000008 // Space characters
  5299. #define LICF_PUNCT 0x00000010 // Punctuation
  5300. #define LICF_CNTRL 0x00000020 // Control characters
  5301. #define LICF_BLANK 0x00000040 // Blank characters
  5302. #define LICF_XDIGIT 0x00000080 // Hexadecimal digits
  5303. #define LICF_ALPHA 0x00000100 // Any linguistic character: alphabetic, syllabary, or ideographic
  5304. // these flags check for a few things that GetStringTypeEx doesn't check
  5305. #define LICF_BINARYDIGIT 0x00010000 // 0-1
  5306. #define LICF_OCTALDIGIT 0x00020000 // 0-7
  5307. #define LICF_ATOZUPPER 0x00100000 // A-Z (use LICF_ALPHA for language independent check)
  5308. #define LICF_ATOZLOWER 0x00200000 // a-z (use LICF_ALPHA for language independent check)
  5309. #define LICF_ATOZ (LICF_ATOZUPPER|LICF_ATOZLOWER) // a-z, A-Z
  5310. #include <pshpack8.h>
  5311. typedef struct tagLIMITINPUT
  5312. {
  5313. DWORD cbSize;
  5314. DWORD dwMask;
  5315. DWORD dwFlags;
  5316. HINSTANCE hinst;
  5317. LPWSTR pszFilter; // pointer to a string, or the ID of a string resource if hinst is also given, or LPSTR_TEXTCALLBACK if the parent window should be notified to provide a string.
  5318. LPWSTR pszTitle; // pointer to a string, or the ID of a string resource if hinst is also given, or LPSTR_TEXTCALLBACK if the parent window should be notified to provide a string.
  5319. LPWSTR pszMessage; // pointer to a string, or the ID of a string resource if hinst is also given, or LPSTR_TEXTCALLBACK if the parent window should be notified to provide a string.
  5320. HICON hIcon; // handle to an icon, or I_ICONCALLBACK if the notify window should be asked to provide an icon.
  5321. HWND hwndNotify; // handle to a window to process notify messages
  5322. INT iTimeout; // time in milliseconds to display the tooltip
  5323. INT cxTipWidth; // max width of the tooltip in pixels. Defaults to 500.
  5324. } LIMITINPUT;
  5325. typedef struct tagNMLIDISPINFO
  5326. {
  5327. NMHDR hdr; // standard notification header structure
  5328. LIMITINPUT li; // the mask member indicates which fields must be filled out.
  5329. } NMLIDISPINFO, * LPNMLIDISPINFO, NMLIFILTERINFO, * LPNMLIFILTERINFO;
  5330. #define LIN_GETDISPINFO 0x01 // notify code sent to retrieve tooltip display info
  5331. #define LIN_GETFILTERINFO 0x02 // notify code sent to retrieve filter or mask info
  5332. typedef struct tagNMLIBADCHAR
  5333. {
  5334. NMHDR hdr; // standard notification header structure
  5335. WPARAM wParam; // wParam sent in WM_CHAR message
  5336. LPARAM lParam; // lParam sent in WM_CHAR message
  5337. } NMLIBADCHAR, * LPNMLIBADCHAR;
  5338. #define LIN_BADCHAR 0x03 // notify code sent when a character is filtered out
  5339. #define I_ICONCALLBACK ((HICON)-1L)
  5340. // Helpers which prevent entry of invalid (as defined by the folder) characters. Call on LVN_BEGIN_INPUT_EDIT
  5341. // DOC'ed for DOJ compliance
  5342. SHSTDAPI SHLimitInputEditWithFlags(HWND hwndEdit, LIMITINPUT * pil);
  5343. SHSTDAPI SHLimitInputEditChars(HWND hwndEdit, LPCWSTR pszValidChars, LPCWSTR pszInvalidChars);
  5344. SHSTDAPI SHLimitInputCombo(HWND hwndComboBox, IShellFolder *psf);
  5345. // DOC'ed for DOJ Compliance
  5346. // DOC'ed for DOJ Compliance
  5347. int _cdecl ShellMessageBoxWrapW(HINSTANCE hInst, HWND hWnd, LPCWSTR pszMsg, LPCWSTR pszTitle, UINT fuStyle, ...);
  5348. #ifdef UNICODE
  5349. #define ShellMessageBoxWrap ShellMessageBoxWrapW
  5350. #else
  5351. #define ShellMessageBoxWrap ShellMessageBoxA
  5352. #endif
  5353. // Helpers for handling IDataObject stuff - from shell32.dll
  5354. // DOC'ed for DOJ compliance
  5355. STDAPI SHSimulateDropOnClsid(REFCLSID clsidDrop, IUnknown* punkSite, IDataObject* pdo);
  5356. #include <poppack.h> /* Return to byte packing */
  5357. #ifdef __cplusplus
  5358. }
  5359. #endif /* __cplusplus */
  5360. #include <poppack.h>
  5361. #endif // _SHLOBJP_H_