shell32/tests: Add verification of known folders categories.
[wine] / include / shobjidl.idl
1 /*
2  * COM interfaces for shell objects
3  *
4  * Copyright (C) 1999 Juergen Schmied
5  * Copyright (C) 2003 Alexandre Julliard
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21
22 import "objidl.idl";
23 import "oleidl.idl";
24 import "oaidl.idl";
25 import "docobj.idl";
26 import "shtypes.idl";
27 import "servprov.idl";
28 import "comcat.idl";
29 import "propidl.idl";
30 /* FIXME: import "prsht.idl";*/
31 import "msxml.idl";
32 import "wtypes.idl";
33 import "propsys.idl";
34 import "objectarray.idl";
35 /* FIXME: import "structuredquery.idl"; */
36
37 cpp_quote("/* FIXME: #include <sherrors.h> */")
38
39
40 /*****************************************************************************
41  * IPersistFolder interface
42  */
43 [
44     object,
45     uuid(000214ea-0000-0000-c000-000000000046),
46     pointer_default(unique)
47 ]
48 interface IPersistFolder : IPersist
49 {
50     typedef IPersistFolder *LPPERSISTFOLDER;
51
52     HRESULT Initialize( [in] LPCITEMIDLIST pidl );
53 }
54
55
56 /*****************************************************************************
57  * IPersistFolder2 interface
58  */
59 [
60     object,
61     uuid(1ac3d9f0-175c-11d1-95be-00609797ea4f),
62     pointer_default(unique)
63 ]
64 interface IPersistFolder2 : IPersistFolder
65 {
66     typedef IPersistFolder2 *LPPERSISTFOLDER2;
67
68     HRESULT GetCurFolder( [out] LPITEMIDLIST *ppidl );
69 }
70
71
72 /*****************************************************************************
73  * IPersistIDList interface
74  */
75 [
76     object,
77     uuid(1079acfc-29bd-11d3-8e0d-00c04f6837d5),
78     pointer_default(unique)
79 ]
80 interface IPersistIDList : IPersist
81 {
82     HRESULT SetIDList( [in] LPCITEMIDLIST pidl );
83     HRESULT GetIDList( [out] LPITEMIDLIST *ppidl );
84 }
85
86
87 /*****************************************************************************
88  * IEnumIDList interface
89  */
90 [
91     object,
92     uuid(000214f2-0000-0000-c000-000000000046),
93     pointer_default(unique)
94 ]
95 interface IEnumIDList : IUnknown
96 {
97     typedef IEnumIDList *LPENUMIDLIST;
98
99     HRESULT Next(
100         [in] ULONG celt,
101         [out, size_is(celt), length_is(*pceltFetched)] LPITEMIDLIST *rgelt,
102         [out] ULONG *pceltFetched);
103
104     HRESULT Skip( [in] ULONG celt );
105     HRESULT Reset();
106     HRESULT Clone( [out] IEnumIDList **ppenum );
107 }
108
109 /*****************************************************************************
110  * IShellPropSheetExt interface
111  */
112 cpp_quote("#if 0")
113     typedef LPARAM LPFNSVADDPROPSHEETPAGE;
114 cpp_quote("#else")
115 cpp_quote("#include <prsht.h>")
116 cpp_quote("typedef LPFNADDPROPSHEETPAGE LPFNSVADDPROPSHEETPAGE;")
117 cpp_quote("#endif")
118
119 [
120     object,
121     uuid(000214E9-0000-0000-C000-000000000046),
122     pointer_default(unique),
123     local
124 ]
125 interface IShellPropSheetExt : IUnknown
126 {
127     enum tagSHELLPROPSHEETEXTPAGEID {
128         EXPPS_FILETYPES = 0x1
129     };
130
131     typedef UINT EXPPS;
132
133     HRESULT AddPages(
134         [in] LPFNSVADDPROPSHEETPAGE pfnAddPage,
135         [in] LPARAM lParam);
136     HRESULT ReplacePage(
137         [in] EXPPS uPageID,
138         [in] LPFNSVADDPROPSHEETPAGE pfnReplaceWith,
139         [in] LPARAM lParam);
140 }
141 typedef IShellPropSheetExt *LPSHELLPROPSHEETEXT;
142
143 /*****************************************************************************
144  * IShellFolder interface
145  */
146 [
147     object,
148     uuid(000214e6-0000-0000-c000-000000000046),
149     pointer_default(unique)
150 ]
151 interface IShellFolder : IUnknown
152 {
153     typedef IShellFolder * LPSHELLFOLDER;
154
155     typedef enum tagSHGDN
156     {
157         SHGDN_NORMAL = 0,
158         SHGDN_INFOLDER = 1,
159         SHGDN_FOREDITING = 0x1000,
160         SHGDN_INCLUDE_NONFILESYS = 0x2000,
161         SHGDN_FORADDRESSBAR = 0x4000,
162         SHGDN_FORPARSING = 0x8000
163     } SHGNO;
164
165     typedef DWORD SHGDNF;
166
167     enum tagSHCONTF
168     {
169         SHCONTF_FOLDERS = 32,
170         SHCONTF_NONFOLDERS = 64,
171         SHCONTF_INCLUDEHIDDEN = 128,
172         SHCONTF_INIT_ON_FIRST_NEXT = 256,
173         SHCONTF_NETPRINTERSRCH = 512,
174         SHCONTF_SHAREABLE = 1024,
175         SHCONTF_STORAGE = 2048
176     };
177
178     typedef DWORD SHCONTF;
179
180     cpp_quote("#define SFGAO_CANCOPY           DROPEFFECT_COPY")
181     cpp_quote("#define SFGAO_CANMOVE           DROPEFFECT_MOVE")
182     cpp_quote("#define SFGAO_CANLINK           DROPEFFECT_LINK")
183     cpp_quote("#define SFGAO_STORAGE           0x00000008L")
184     cpp_quote("#define SFGAO_CANRENAME         0x00000010L")
185     cpp_quote("#define SFGAO_CANDELETE         0x00000020L")
186     cpp_quote("#define SFGAO_HASPROPSHEET      0x00000040L")
187     cpp_quote("#define SFGAO_DROPTARGET        0x00000100L")
188     cpp_quote("#define SFGAO_CAPABILITYMASK    0x00000177L")
189     cpp_quote("#define SFGAO_ENCRYPTED         0x00002000L")
190     cpp_quote("#define SFGAO_ISSLOW            0x00004000L")
191     cpp_quote("#define SFGAO_GHOSTED           0x00008000L")
192     cpp_quote("#define SFGAO_LINK              0x00010000L")
193     cpp_quote("#define SFGAO_SHARE             0x00020000L")
194     cpp_quote("#define SFGAO_READONLY          0x00040000L")
195     cpp_quote("#define SFGAO_HIDDEN            0x00080000L")
196     cpp_quote("#define SFGAO_DISPLAYATTRMASK   0x000FC000L")
197     cpp_quote("#define SFGAO_FILESYSANCESTOR   0x10000000L")
198     cpp_quote("#define SFGAO_FOLDER            0x20000000L")
199     cpp_quote("#define SFGAO_FILESYSTEM        0x40000000L")
200     cpp_quote("#define SFGAO_HASSUBFOLDER      0x80000000L")
201     cpp_quote("#define SFGAO_CONTENTSMASK      0x80000000L")
202     cpp_quote("#define SFGAO_VALIDATE          0x01000000L")
203     cpp_quote("#define SFGAO_REMOVABLE         0x02000000L")
204     cpp_quote("#define SFGAO_COMPRESSED        0x04000000L")
205     cpp_quote("#define SFGAO_BROWSABLE         0x08000000L")
206     cpp_quote("#define SFGAO_NONENUMERATED     0x00100000L")
207     cpp_quote("#define SFGAO_NEWCONTENT        0x00200000L")
208     cpp_quote("#define SFGAO_STREAM            0x00400000L")
209     cpp_quote("#define SFGAO_STORAGEANCESTOR   0x00800000L")
210
211     typedef ULONG SFGAOF;
212
213     HRESULT ParseDisplayName(
214         [in] HWND hwndOwner,
215         [in] LPBC pbcReserved,
216         [in, string] LPOLESTR lpszDisplayName,
217         [out] ULONG *pchEaten,
218         [out] LPITEMIDLIST *ppidl,
219         [in, out, unique] ULONG *pdwAttributes);
220
221     HRESULT EnumObjects(
222         [in] HWND hwndOwner,
223         [in] SHCONTF grfFlags,
224         [out] IEnumIDList **ppenumIDList);
225
226     HRESULT BindToObject(
227         [in] LPCITEMIDLIST pidl,
228         [in] LPBC pbcReserved,
229         [in] REFIID riid,
230         [out, iid_is(riid)] void **ppvOut);
231
232     HRESULT BindToStorage(
233         [in] LPCITEMIDLIST pidl,
234         [in] LPBC pbcReserved,
235         [in] REFIID riid,
236         [out, iid_is(riid)] void **ppvObj);
237
238     HRESULT CompareIDs(
239         [in] LPARAM lParam,
240         [in] LPCITEMIDLIST pidl1,
241         [in] LPCITEMIDLIST pidl2);
242
243     HRESULT CreateViewObject(
244         [in] HWND hwndOwner,
245         [in] REFIID riid,
246         [out, iid_is(riid)] void **ppvOut);
247
248     HRESULT GetAttributesOf(
249         [in] UINT cidl,
250         [in, size_is(cidl)] LPCITEMIDLIST *apidl,
251         [in, out] SFGAOF *rgfInOut);
252
253     HRESULT GetUIObjectOf(
254         [in] HWND hwndOwner,
255         [in] UINT cidl,
256         [in, size_is(cidl)] LPCITEMIDLIST *apidl,
257         [in] REFIID riid,
258         [in, out, unique] UINT *prgfInOut,
259         [out, iid_is(riid)] void **ppvOut);
260
261     HRESULT GetDisplayNameOf(
262         [in] LPCITEMIDLIST pidl,
263         [in] SHGDNF uFlags,
264         [out] STRRET *lpName);
265
266     HRESULT SetNameOf(
267         [in] HWND hwnd,
268         [in] LPCITEMIDLIST pidl,
269         [in, string] LPCOLESTR lpszName,
270         [in] SHGDNF uFlags,
271         [out] LPITEMIDLIST *ppidlOut);
272 }
273
274
275 /*****************************************************************************
276  * IEnumExtraSearch interface
277  */
278 [
279     object,
280     uuid(0e700be1-9db6-11d1-a1ce-00c04fd75d13),
281     pointer_default(unique)
282 ]
283 interface IEnumExtraSearch : IUnknown
284 {
285     typedef IEnumExtraSearch *LPENUMEXTRASEARCH;
286
287     typedef struct
288     {
289         GUID guidSearch;
290         WCHAR wszFriendlyName[80];
291         /*
292          *WCHAR wszMenuText[80];
293          *WCHAR wszHelpText[MAX_PATH];
294          */
295         WCHAR wszUrl[2084];
296         /*
297          *WCHAR wszIcon[MAX_PATH+10];
298          *WCHAR wszGreyIcon[MAX_PATH+10];
299          *WCHAR wszClrIcon[MAX_PATH+10];
300          */
301     } EXTRASEARCH, *LPEXTRASEARCH;
302
303     HRESULT Next(
304         [in] ULONG celt,
305         [out, size_is(celt), length_is(*pceltFetched)] EXTRASEARCH *rgelt,
306         [out] ULONG *pceltFetched);
307
308     HRESULT Skip( [in] ULONG celt );
309     HRESULT Reset();
310     HRESULT Clone( [out] IEnumExtraSearch **ppenum );
311 }
312
313
314 /*****************************************************************************
315  * IShellFolder2 interface
316  */
317 [
318     object,
319     uuid(93f2f68c-1d1b-11d3-a30e-00c04f79abd1),
320     pointer_default(unique)
321 ]
322 interface IShellFolder2 : IShellFolder
323 {
324     typedef struct
325     {
326         GUID    fmtid;
327         DWORD   pid;
328     } SHCOLUMNID, *LPSHCOLUMNID;
329     typedef const SHCOLUMNID *LPCSHCOLUMNID;
330
331     HRESULT GetDefaultSearchGUID( [out] GUID *lpguid );
332     HRESULT EnumSearches( [out] IEnumExtraSearch **ppenum );
333     HRESULT GetDefaultColumn( [in] DWORD dwReserved, [out] ULONG *pSort, [out] ULONG *pDisplay );
334     HRESULT GetDefaultColumnState( [in] UINT iColumn, [out] SHCOLSTATEF *pcsFlags );
335     HRESULT GetDetailsEx( [in] LPCITEMIDLIST pidl, [in] const SHCOLUMNID *pscid, [out] VARIANT *pv);
336     HRESULT GetDetailsOf( [in] LPCITEMIDLIST pidl, [in] UINT iColumn, [out] SHELLDETAILS *psd);
337     HRESULT MapColumnToSCID( [in] UINT iColumn, [in] SHCOLUMNID *pscid );
338 }
339
340 /*****************************************************************************
341  * IShellItem interface
342  */
343 [
344     object,
345     uuid(43826d1e-e718-42ee-bc55-a1e261c37bfe),
346     pointer_default(unique)
347 ]
348 interface IShellItem : IUnknown
349 {
350     typedef [v1_enum] enum {
351         SIGDN_NORMALDISPLAY                = 0,
352         SIGDN_PARENTRELATIVEPARSING        = 0x80018001,
353         SIGDN_DESKTOPABSOLUTEPARSING       = 0x80028000,
354         SIGDN_PARENTRELATIVEEDITING        = 0x80031001,
355         SIGDN_DESKTOPABSOLUTEEDITING       = 0x8004c000,
356         SIGDN_FILESYSPATH                  = 0x80058000,
357         SIGDN_URL                          = 0x80068000,
358         SIGDN_PARENTRELATIVEFORADDRESSBAR  = 0x8007c001,
359         SIGDN_PARENTRELATIVE               = 0x80080001
360     } SIGDN; /* & 0xFFFF => SHGDN */
361
362     [v1_enum] enum _SICHINTF
363     {
364         SICHINT_DISPLAY                       = 0x00000000,
365         SICHINT_CANONICAL                     = 0x10000000,
366         SICHINT_TEST_FILESYSPATH_IF_NOT_EQUAL = 0x20000000,
367         SICHINT_ALLFIELDS                     = 0x80000000
368     };
369     typedef DWORD SICHINTF;
370
371     HRESULT BindToHandler(
372         [in] IBindCtx *pbc,
373         [in] REFGUID rbhid,
374         [in] REFIID riid,
375         [out, iid_is(riid)] void **ppvOut);
376
377     HRESULT GetParent( [out] IShellItem **ppsi );
378
379     HRESULT GetDisplayName(
380         [in] SIGDN sigdnName,
381         [out] LPWSTR *ppszName);
382
383     HRESULT GetAttributes(
384         [in] SFGAOF sfgaoMask,
385         [out] SFGAOF *psfgaoAttribs);
386
387     HRESULT Compare(
388         [in] IShellItem *psi,
389         [in] SICHINTF hint,
390         [out] int *piOrder);
391 }
392
393 /*****************************************************************************
394  * IShellItem2 interface
395  */
396 [
397     object,
398     uuid(7E9FB0D3-919F-4307-AB2E-9B1860310C93),
399     pointer_default(unique)
400 ]
401 interface IShellItem2 : IShellItem
402 {
403     HRESULT GetPropertyStore(
404         [in] GETPROPERTYSTOREFLAGS flags,
405         [in] REFIID riid,
406         [out, iid_is(riid)] void **ppv);
407
408     HRESULT GetPropertyStoreWithCreateObject(
409         [in] GETPROPERTYSTOREFLAGS flags,
410         [in] IUnknown *punkCreateObject,
411         [in] REFIID riid,
412         [out, iid_is(riid)] void **ppv);
413
414     HRESULT GetPropertyStoreForKeys(
415         [in, size_is(cKeys)] const PROPERTYKEY *rgKeys,
416         [in] UINT cKeys,
417         [in] GETPROPERTYSTOREFLAGS flags,
418         [in] REFIID riid,
419         [out, iid_is(riid)] void **ppv);
420
421     HRESULT GetPropertyDescriptionList(
422         [in] REFPROPERTYKEY keyType,
423         [in] REFIID riid,
424         [out, iid_is(riid)] void **ppv);
425
426     HRESULT Update(
427         [in, unique] IBindCtx *pbc);
428
429     HRESULT GetProperty(
430         [in] REFPROPERTYKEY key,
431         [out] PROPVARIANT *ppropvar);
432
433     HRESULT GetCLSID(
434         [in] REFPROPERTYKEY key,
435         [out] CLSID *pclsid);
436
437     HRESULT GetFileTime (
438         [in] REFPROPERTYKEY key,
439         [out] FILETIME *pft);
440
441     HRESULT GetInt32(
442         [in] REFPROPERTYKEY key,
443         [out] int *pi);
444
445     HRESULT GetString(
446         [in] REFPROPERTYKEY key,
447         [out, string] LPWSTR *ppsz);
448
449     HRESULT GetUInt32(
450         [in] REFPROPERTYKEY key,
451         [out] ULONG *pui);
452
453     HRESULT GetUInt64(
454         [in] REFPROPERTYKEY key,
455         [out] ULONGLONG *pull);
456
457     HRESULT GetBool(
458         [in] REFPROPERTYKEY key,
459         [out] BOOL *pf);
460 }
461
462 typedef enum tagNWMF {
463     NWMF_UNLOADING        = 0x0001,
464     NWMF_USERINITED       = 0x0002,
465     NWMF_FIRST            = 0x0004,
466     NWMF_OVERRIDEKEY      = 0x0008,
467     NWMF_SHOWHELP         = 0x0010,
468     NWMF_HTMLDIALOG       = 0x0020,
469     NWMF_FROMDIALOGCHILD  = 0x0040,
470     NWMF_USERREQUESTED    = 0x0080,
471     NWMF_USERALLOWED      = 0x0100
472 } NWMF;
473
474 [
475     uuid(d2bc4c84-3f72-4a52-a604-7bcbf3982cbb),
476     object,
477     pointer_default(unique)
478 ]
479 interface INewWindowManager : IUnknown
480 {
481     HRESULT EvaluateNewWindow(
482         [in, string] LPCWSTR pszUrl,
483         [in, string] LPCWSTR pszName,
484         [in, string] LPCWSTR pszUrlContext,
485         [in, string] LPCWSTR pszFeatures,
486         [in]         BOOL fReplace,
487         [in]         DWORD dwFlags,
488         [in]         DWORD dwUserActionTime);
489 }
490
491 cpp_quote("#define SID_SNewWindowManager IID_INewWindowManager")
492
493 /*****************************************************************************
494  * IEnumShellItems interface
495  */
496 [
497  object,
498  uuid(70629033-E363-4A28-A567-0DB78006E6D7),
499  pointer_default(unique)
500 ]
501 interface IEnumShellItems : IUnknown
502 {
503     [local] HRESULT Next(
504         [in] ULONG celt,
505         [out, size_is(celt), length_is(*pceltFetched)] IShellItem **rgelt,
506         [out] ULONG *pceltFetched);
507
508     [call_as(Next)] HRESULT RemoteNext(
509         [in] ULONG celt,
510         [out, size_is(celt), length_is(*pceltFetched)] IShellItem **rgelt,
511         [out] ULONG *pceltFetched);
512
513     HRESULT Skip(
514         [in] ULONG celt);
515
516     HRESULT Reset();
517
518     HRESULT Clone(
519         [out] IEnumShellItems **ppenum);
520 }
521
522 /*****************************************************************************
523  * IShellItemArray interface
524  */
525 [
526  object,
527  uuid(B63EA76D-1F85-456F-A19C-48159EFA858B),
528  pointer_default(unique)
529 ]
530 interface IShellItemArray : IUnknown
531 {
532     typedef [v1_enum] enum SIATTRIBFLAGS {
533         SIATTRIBFLAGS_AND            = 0x0001,
534         SIATTRIBFLAGS_OR             = 0x0002,
535         SIATTRIBFLAGS_APPCOMPAT      = 0x0003,
536         SIATTRIBFLAGS_MASK           = 0x0003,
537         SIATTRIBFLAGS_ALLITEMS       = 0x4000
538     } SIATTRIBFLAGS;
539     cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(SIATTRIBFLAGS)")
540
541     HRESULT BindToHandler(
542         [in, unique] IBindCtx *pbc,
543         [in] REFGUID bhid,
544         [in] REFIID riid,
545         [out, iid_is(riid)] void **ppvOut);
546
547     HRESULT GetPropertyStore(
548         [in] GETPROPERTYSTOREFLAGS flags,
549         [in] REFIID riid,
550         [out, iid_is(riid)] void **ppv);
551
552     HRESULT GetPropertyDescriptionList(
553         [in] REFPROPERTYKEY keyType,
554         [in] REFIID riid,
555         [out, iid_is(riid)] void **ppv);
556
557     HRESULT GetAttributes(
558         [in] SIATTRIBFLAGS AttribFlags,
559         [in] SFGAOF sfgaoMask,
560         [out] SFGAOF *psfgaoAttribs);
561
562     HRESULT GetCount(
563         [out] DWORD *pdwNumItems);
564
565     HRESULT GetItemAt(
566         [in] DWORD dwIndex,
567         [out] IShellItem **ppsi);
568
569     HRESULT EnumItems(
570         [out] IEnumShellItems **ppenumShellItems);
571
572 }
573
574 typedef [v1_enum] enum DATAOBJ_GET_ITEM_FLAGS
575 {
576     DOGIF_DEFAULT       = 0x0,
577     DOGIF_TRAVERSE_LINK = 0x1,
578     DOGIF_NO_HDROP      = 0x2,
579     DOGIF_NO_URL        = 0x4,
580     DOGIF_ONLY_IF_ONE   = 0x8
581 } DATAOBJ_GET_ITEM_FLAGS;
582 cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DATAOBJ_GET_ITEM_FLAGS)")
583
584 cpp_quote("HRESULT WINAPI SHGetNameFromIDList(PCIDLIST_ABSOLUTE pidl, SIGDN sigdnName, PWSTR *ppszName);")
585 cpp_quote("HRESULT WINAPI SHCreateItemFromParsingName(PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv);")
586 cpp_quote("HRESULT WINAPI SHCreateItemFromIDList(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv);")
587 cpp_quote("HRESULT WINAPI SHGetItemFromDataObject(IDataObject *pdtobj, DATAOBJ_GET_ITEM_FLAGS dwFlags, REFIID riid, void **ppv);")
588 cpp_quote("HRESULT WINAPI SHGetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl);")
589 cpp_quote("HRESULT WINAPI SHGetItemFromObject(IUnknown *punk, REFIID riid, void **ppv);")
590 cpp_quote("HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent, IShellFolder* psf, UINT cidl, PCUITEMID_CHILD_ARRAY ppidl, IShellItemArray **ppsiItemArray);")
591 cpp_quote("HRESULT WINAPI SHCreateShellItemArrayFromShellItem(IShellItem *psi, REFIID riid, void **ppv);")
592 cpp_quote("HRESULT WINAPI SHCreateShellItemArrayFromDataObject(IDataObject *pdo, REFIID riid, void **ppv);")
593
594 /*****************************************************************************
595  * IShellItemFilter interface
596  */
597 [
598  object,
599  uuid(2659B475-EEB8-48B7-8F07-B378810F48CF),
600  pointer_default(unique)
601 ]
602 interface IShellItemFilter : IUnknown
603 {
604     HRESULT IncludeItem(
605         [in] IShellItem *psi);
606
607     HRESULT GetEnumFlagsForItem(
608         [in] IShellItem *psi,
609         [out] SHCONTF *pgrfFlags);
610 }
611
612 /*****************************************************************************
613  * FOLDERSETTINGS
614  */
615 typedef char *LPVIEWSETTINGS;
616
617 typedef enum
618 {
619     FWF_AUTOARRANGE         = 0x00000001,
620     FWF_ABBREVIATEDNAMES    = 0x00000002,
621     FWF_SNAPTOGRID          = 0x00000004,
622     FWF_OWNERDATA           = 0x00000008,
623     FWF_BESTFITWINDOW       = 0x00000010,
624     FWF_DESKTOP             = 0x00000020,
625     FWF_SINGLESEL           = 0x00000040,
626     FWF_NOSUBFOLDERS        = 0x00000080,
627     FWF_TRANSPARENT         = 0x00000100,
628     FWF_NOCLIENTEDGE        = 0x00000200,
629     FWF_NOSCROLL            = 0x00000400,
630     FWF_ALIGNLEFT           = 0x00000800,
631     FWF_NOICONS             = 0x00001000,
632     FWF_SHOWSELALWAYS       = 0x00002000,
633     FWF_NOVISIBLE           = 0x00004000,
634     FWF_SINGLECLICKACTIVATE = 0x00008000,
635     FWF_NOWEBVIEW           = 0x00010000,
636     FWF_HIDEFILENAMES       = 0x00020000,
637     FWF_CHECKSELECT         = 0x00040000,
638     FWF_NOENUMREFRESH       = 0x00080000,
639     FWF_NOGROUPING          = 0x00100000,
640     FWF_FULLROWSELECT       = 0x00200000,
641     FWF_NOFILTERS           = 0x00400000,
642     FWF_NOCOLUMNHEADER      = 0x00800000,
643     FWF_NOHEADERINALLVIEWS  = 0x01000000,
644     FWF_EXTENDEDTILES       = 0x02000000,
645     FWF_TRICHECKSELECT      = 0x04000000,
646     FWF_AUTOCHECKSELECT     = 0x08000000,
647     FWF_NOBROWSERVIEWSTATE  = 0x10000000,
648     FWF_SUBSETGROUPS        = 0x20000000,
649     FWF_USESEARCHFOLDER     = 0x40000000,
650     FWF_ALLOWRTLREADING     = 0x80000000
651 } FOLDERFLAGS;
652
653 typedef enum
654 {
655     FVM_AUTO       =-1,
656     FVM_ICON       = 1,
657     FVM_FIRST      = FVM_ICON,
658     FVM_SMALLICON  = 2,
659     FVM_LIST       = 3,
660     FVM_DETAILS    = 4,
661     FVM_THUMBNAIL  = 5,
662     FVM_TILE       = 6,
663     FVM_THUMBSTRIP = 7,
664     FVM_CONTENT    = 8,
665     FVM_LAST       = FVM_CONTENT
666 } FOLDERVIEWMODE;
667
668 typedef struct
669 {
670     UINT ViewMode;
671     UINT fFlags;
672 } FOLDERSETTINGS, *PFOLDERSETTINGS, *LPFOLDERSETTINGS;
673 typedef const FOLDERSETTINGS *LPCFOLDERSETTINGS;
674
675 /*****************************************************************************
676  * IShellIcon interface
677  */
678 [
679     uuid(000214e5-0000-0000-c000-000000000046),
680     object,
681     pointer_default(unique)
682 ]
683 interface IShellIcon : IUnknown
684 {
685     HRESULT GetIconOf(
686         [in] PCUITEMID_CHILD pidl,
687         [in] UINT flags,
688         [out] int *pIconIndex);
689 }
690
691 /*****************************************************************************
692  * IShellView interface
693  */
694 interface IShellBrowser;  /* forward declaration */
695 [
696     object,
697     uuid(000214e3-0000-0000-c000-000000000046),
698     pointer_default(unique)
699 ]
700 interface IShellView : IOleWindow
701 {
702     typedef IShellView *LPSHELLVIEW;
703
704     cpp_quote("#define SVSI_DESELECT       0x00000000")
705     cpp_quote("#define SVSI_SELECT         0x00000001")
706     cpp_quote("#define SVSI_EDIT           0x00000003")
707     cpp_quote("#define SVSI_DESELECTOTHERS 0x00000004")
708     cpp_quote("#define SVSI_ENSUREVISIBLE  0x00000008")
709     cpp_quote("#define SVSI_FOCUSED        0x00000010")
710     cpp_quote("#define SVSI_TRANSLATEPT    0x00000020")
711     cpp_quote("#define SVSI_SELECTIONMARK  0x00000040")
712     cpp_quote("#define SVSI_POSITIONITEM   0x00000080")
713     cpp_quote("#define SVSI_CHECK          0x00000100")
714     cpp_quote("#define SVSI_NOSTATECHANGE  0x80000000")
715
716     typedef UINT SVSIF;
717
718     typedef enum
719     {
720         SVGIO_BACKGROUND     = 0x00000000,
721         SVGIO_SELECTION      = 0x00000001,
722         SVGIO_ALLVIEW        = 0x00000002,
723         SVGIO_CHECKED        = 0x00000003,
724         SVGIO_TYPE_MASK      = 0x0000000f,
725         SVGIO_FLAG_VIEWORDER = 0x80000000,
726     } SVGIO;
727
728     typedef enum
729     {
730         SVUIA_DEACTIVATE       = 0,
731         SVUIA_ACTIVATE_NOFOCUS = 1,
732         SVUIA_ACTIVATE_FOCUS   = 2,
733         SVUIA_INPLACEACTIVATE  = 3
734     } SVUIA_STATUS;
735
736     HRESULT TranslateAccelerator( [in] MSG *pmsg );
737     HRESULT EnableModeless( [in] BOOL fEnable );
738     HRESULT UIActivate( [in] UINT uState );
739     HRESULT Refresh();
740     HRESULT CreateViewWindow(
741         [in] IShellView *psvPrevious,
742         [in] LPCFOLDERSETTINGS lpfs,
743         [in] IShellBrowser *psb,
744         [out] RECT *prcView,
745         [out] HWND *phWnd);
746
747     HRESULT DestroyViewWindow();
748     HRESULT GetCurrentInfo( [out] LPFOLDERSETTINGS lpfs );
749
750     [local] HRESULT AddPropertySheetPages(
751         [in] DWORD dwReserved,
752         [in] LPFNSVADDPROPSHEETPAGE pfn,
753         [in] LPARAM lparam);
754
755     HRESULT SaveViewState();
756     HRESULT SelectItem(
757         [in] LPCITEMIDLIST pidlItem,
758         [in] SVSIF uFlags);
759     HRESULT GetItemObject(
760         [in] UINT uItem,
761         [in] REFIID riid,
762         [out, iid_is(riid)] void **ppv);
763 }
764
765 [
766     object,
767     uuid(88e39e80-3578-11cf-ae69-08002b2e1262),
768     pointer_default(unique)
769 ]
770 interface IShellView2 : IShellView
771 {
772     typedef GUID SHELLVIEWID;
773 cpp_quote("#include <pshpack8.h>")
774     typedef struct _SV2CVW2_PARAMS
775     {
776         DWORD cbSize;
777         IShellView *psvPrev;
778         LPCFOLDERSETTINGS pfs;
779         IShellBrowser *psbOwner;
780         RECT *prcView;
781         SHELLVIEWID const *pvid;
782         HWND hwndView;
783     } SV2CVW2_PARAMS, *LPSV2CVW2_PARAMS;
784 cpp_quote("#include <poppack.h>")
785
786     HRESULT GetView(
787         [in, out] SHELLVIEWID *view_guid,
788         [in] ULONG view_type
789     );
790     HRESULT CreateViewWindow2(
791         [in] LPSV2CVW2_PARAMS view_params
792     );
793     HRESULT HandleRename(
794         [in] LPCITEMIDLIST new_pidl
795     );
796     HRESULT SelectAndPositionItem(
797         [in] LPCITEMIDLIST item,
798         [in] UINT flags,
799         [in] POINT *point
800     );
801 }
802
803 /*****************************************************************************
804  * IFolderView interface
805  */
806 [
807     uuid(cde725b0-ccc9-4519-917e-325d72fab4ce),
808     object,
809     pointer_default(unique)
810 ]
811 interface IFolderView : IUnknown
812 {
813     HRESULT GetCurrentViewMode( [out] UINT *mode );
814     HRESULT SetCurrentViewMode( [in] UINT mode );
815     HRESULT GetFolder( [in] REFIID riid, [out, iid_is(riid)] void **ppv );
816     HRESULT Item(
817         [in] int index,
818         [out] PITEMID_CHILD *ppidl
819     );
820     HRESULT ItemCount(
821         [in] UINT flags,
822         [out] int *items
823     );
824     HRESULT Items(
825         [in] UINT flags,
826         [in] REFIID riid,
827         [out, iid_is(riid)] void **ppv
828     );
829     HRESULT GetSelectionMarkedItem( [out] int *item );
830     HRESULT GetFocusedItem( [out] int *item );
831     HRESULT GetItemPosition(
832         [in] PCUITEMID_CHILD pidl,
833         [out] POINT* ppt
834     );
835     HRESULT GetSpacing( [in, out, unique] POINT* pt );
836     HRESULT GetDefaultSpacing( [out] POINT* pt );
837     HRESULT GetAutoArrange();
838     HRESULT SelectItem(
839         [in] int item,
840         [in] DWORD flags
841     );
842     HRESULT SelectAndPositionItems(
843         [in] UINT cidl,
844         [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl,
845         [in, unique, size_is(cidl)] POINT* apt,
846         [in] DWORD flags
847     );
848 }
849
850 /*****************************************************************************
851  * IShellBrowser interface
852  */
853 [
854     object,
855     uuid(000214e2-0000-0000-c000-000000000046),
856     pointer_default(unique)
857 ]
858 interface IShellBrowser : IOleWindow
859 {
860     typedef IShellBrowser *LPSHELLBROWSER;
861
862 cpp_quote("#define SBSP_DEFBROWSER            0x00000000")
863 cpp_quote("#define SBSP_SAMEBROWSER           0x00000001")
864 cpp_quote("#define SBSP_NEWBROWSER            0x00000002")
865 cpp_quote("#define SBSP_DEFMODE               0x00000000")
866 cpp_quote("#define SBSP_OPENMODE              0x00000010")
867 cpp_quote("#define SBSP_EXPLOREMODE           0x00000020")
868 cpp_quote("#define SBSP_HELPMODE              0x00000040")
869 cpp_quote("#define SBSP_NOTRANSFERHIST        0x00000080")
870 cpp_quote("#define SBSP_ABSOLUTE              0x00000000")
871 cpp_quote("#define SBSP_RELATIVE              0x00001000")
872 cpp_quote("#define SBSP_PARENT                0x00002000")
873 cpp_quote("#define SBSP_NAVIGATEBACK          0x00004000")
874 cpp_quote("#define SBSP_NAVIGATEFORWARD       0x00008000")
875 cpp_quote("#define SBSP_ALLOW_AUTONAVIGATE    0x00010000")
876 cpp_quote("#define SBSP_KEEPSAMETEMPLATE      0x00020000")
877 cpp_quote("#define SBSP_KEEPWORDWHEELTEXT     0x00040000")
878 cpp_quote("#define SBSP_ACTIVATE_NOFOCUS      0x00080000")
879 cpp_quote("#define SBSP_CREATENOHISTORY       0x00100000")
880 cpp_quote("#define SBSP_PLAYNOSOUND           0x00200000")
881 cpp_quote("#define SBSP_CALLERUNTURUSTED      0x00800000")
882 cpp_quote("#define SBSP_TRUSTFIRSTDOWNLOAD    0x01000000")
883 cpp_quote("#define SBSP_UNTRUSTEDFORDOWNLOAD  0x02000000")
884 cpp_quote("#define SBSP_NOAUTOSELECT          0x04000000")
885 cpp_quote("#define SBSP_WRITENOHISTORY        0x08000000")
886 cpp_quote("#define SBSP_TRUSTEDFORACTIVEX     0x10000000")
887 cpp_quote("#define SBSP_FEEDNAVIGATION        0x20000000")
888 cpp_quote("#define SBSP_REDIRECT              0x40000000")
889 cpp_quote("#define SBSP_INITIATEDBYHLINKFRAME 0x80000000")
890
891 cpp_quote("#define FCW_STATUS      0x0001")
892 cpp_quote("#define FCW_TOOLBAR     0x0002")
893 cpp_quote("#define FCW_TREE        0x0003")
894 cpp_quote("#define FCW_INTERNETBAR 0x0006")
895 cpp_quote("#define FCW_PROGRESS    0x0008")
896
897 cpp_quote("#define FCT_MERGE       0x0001")
898 cpp_quote("#define FCT_CONFIGABLE  0x0002")
899 cpp_quote("#define FCT_ADDTOEND    0x0004")
900
901 cpp_quote("#if 0")
902     typedef LPARAM LPTBBUTTONSB;
903 cpp_quote("#else")
904 cpp_quote("#include <commctrl.h>")
905 cpp_quote("typedef LPTBBUTTON LPTBBUTTONSB;")
906 cpp_quote("#endif")
907
908     HRESULT InsertMenusSB(
909         [in] HMENU hmenuShared,
910         [in, out] LPOLEMENUGROUPWIDTHS lpMenuWidths);
911
912     HRESULT SetMenuSB(
913         [in] HMENU hmenuShared,
914         [in] HOLEMENU holemenuReserved,
915         [in] HWND hwndActiveObject);
916
917     HRESULT RemoveMenusSB( [in] HMENU hmenuShared );
918     HRESULT SetStatusTextSB( [in, unique] LPCOLESTR pszStatusText );
919     HRESULT EnableModelessSB( [in] BOOL fEnable );
920     HRESULT TranslateAcceleratorSB( [in] MSG *pmsg, [in] WORD wID );
921
922     HRESULT BrowseObject(
923         [in] LPCITEMIDLIST pidl,
924         [in] UINT wFlags);
925
926     HRESULT GetViewStateStream(
927         [in] DWORD grfMode,
928         [out] IStream **ppStrm);
929
930     HRESULT GetControlWindow(
931         [in] UINT id,
932         [out] HWND *phwnd);
933
934     [local] HRESULT SendControlMsg(
935         [in] UINT id,
936         [in] UINT uMsg,
937         [in] WPARAM wParam,
938         [in] LPARAM lParam,
939         [in] LRESULT *pret);
940
941     HRESULT QueryActiveShellView( [out] IShellView **ppshv );
942     HRESULT OnViewWindowActive( [in] IShellView *pshv );
943
944     [local]
945     HRESULT SetToolbarItems(
946         [in] LPTBBUTTONSB lpButtons,
947         [in] UINT nButtons,
948         [in] UINT uFlags);
949 }
950
951
952 /*****************************************************************************
953  * IShellLinkA interface
954  */
955 [
956     object,
957     uuid(000214ee-0000-0000-c000-000000000046),
958     pointer_default(unique)
959 ]
960 interface IShellLinkA : IUnknown
961 {
962     typedef enum
963     {
964         SLR_NO_UI               = 0x0001,
965         SLR_ANY_MATCH           = 0x0002,
966         SLR_UPDATE              = 0x0004,
967         SLR_NOUPDATE            = 0x0008,
968         SLR_NOSEARCH            = 0x0010,
969         SLR_NOTRACK             = 0x0020,
970         SLR_NOLINKINFO          = 0x0040,
971         SLR_INVOKE_MSI          = 0x0080,
972         SLR_NO_UI_WITH_MSG_PUMP = 0x0101,
973     } SLR_FLAGS;
974
975     typedef enum
976     {
977         SLGP_SHORTPATH   = 0x0001,
978         SLGP_UNCPRIORITY = 0x0002,
979         SLGP_RAWPATH     = 0x0004,
980     } SLGP_FLAGS;
981
982     HRESULT GetPath(
983         [out, size_is(cch)] LPSTR pszFile,
984         [in] int cch,
985         [in, out, unique] WIN32_FIND_DATAA *pfd,
986         [in] DWORD fFlags);
987
988     HRESULT GetIDList( [out] LPITEMIDLIST * ppidl );
989
990     HRESULT SetIDList( [in] LPCITEMIDLIST pidl );
991
992     HRESULT GetDescription(
993         [out, size_is(cch)] LPSTR pszName,
994         [in] int cch);
995
996     HRESULT SetDescription( [in] LPCSTR pszName );
997
998     HRESULT GetWorkingDirectory(
999         [out, size_is(cch)] LPSTR pszDir,
1000         [in] int cch);
1001
1002     HRESULT SetWorkingDirectory( [in] LPCSTR pszDir );
1003
1004     HRESULT GetArguments(
1005         [out, size_is(cch)] LPSTR pszArgs,
1006         [in] int cch);
1007
1008     HRESULT SetArguments( [in] LPCSTR pszArgs );
1009
1010     HRESULT GetHotkey( [out] WORD *pwHotkey );
1011
1012     HRESULT SetHotkey( [in] WORD wHotkey );
1013
1014     HRESULT GetShowCmd( [out] int *piShowCmd );
1015
1016     HRESULT SetShowCmd( [in] int iShowCmd );
1017
1018     HRESULT GetIconLocation(
1019         [out, size_is(cch)] LPSTR pszIconPath,
1020         [in] int cch,
1021         [out] int *piIcon);
1022
1023     HRESULT SetIconLocation(
1024         [in] LPCSTR pszIconPath,
1025         [in] int iIcon);
1026
1027     HRESULT SetRelativePath(
1028         [in] LPCSTR pszPathRel,
1029         [in] DWORD dwReserved);
1030
1031     HRESULT Resolve(
1032         [in] HWND hwnd,
1033         [in] DWORD fFlags);
1034
1035     HRESULT SetPath( [in] LPCSTR pszFile );
1036 }
1037
1038
1039 /*****************************************************************************
1040  * IShellLinkW interface
1041  */
1042 [
1043     object,
1044     uuid(000214f9-0000-0000-c000-000000000046),
1045     pointer_default(unique)
1046 ]
1047 interface IShellLinkW : IUnknown
1048 {
1049     HRESULT GetPath(
1050         [out, size_is(cch)] LPWSTR pszFile,
1051         [in] int cch,
1052         [in, out] WIN32_FIND_DATAW *pfd,
1053         [in] DWORD fFlags);
1054
1055     HRESULT GetIDList( [out] LPITEMIDLIST * ppidl );
1056
1057     HRESULT SetIDList( [in] LPCITEMIDLIST pidl );
1058
1059     HRESULT GetDescription(
1060         [out, size_is(cch)] LPWSTR pszName,
1061         [in] int cch);
1062
1063     HRESULT SetDescription( [in] LPCWSTR pszName );
1064
1065     HRESULT GetWorkingDirectory(
1066         [out, size_is(cch)] LPWSTR pszDir,
1067         [in] int cch);
1068
1069     HRESULT SetWorkingDirectory( [in] LPCWSTR pszDir );
1070
1071     HRESULT GetArguments(
1072         [out, size_is(cch)] LPWSTR pszArgs,
1073         [in] int cch);
1074
1075     HRESULT SetArguments( [in] LPCWSTR pszArgs );
1076
1077     HRESULT GetHotkey( [out] WORD *pwHotkey );
1078
1079     HRESULT SetHotkey( [in] WORD wHotkey );
1080
1081     HRESULT GetShowCmd( [out] int *piShowCmd );
1082
1083     HRESULT SetShowCmd( [in] int iShowCmd );
1084
1085     HRESULT GetIconLocation(
1086         [out, size_is(cch)] LPWSTR pszIconPath,
1087         [in] int cch,
1088         [out] int *piIcon);
1089
1090     HRESULT SetIconLocation(
1091         [in] LPCWSTR pszIconPath,
1092         [in] int iIcon);
1093
1094     HRESULT SetRelativePath(
1095         [in] LPCWSTR pszPathRel,
1096         [in] DWORD dwReserved);
1097
1098     HRESULT Resolve(
1099         [in] HWND hwnd,
1100         [in] DWORD fFlags);
1101
1102     HRESULT SetPath( [in] LPCWSTR pszFile );
1103 }
1104
1105 cpp_quote("#define IShellLink WINELIB_NAME_AW(IShellLink)")
1106
1107
1108 /*****************************************************************************
1109  * IShellExtInit interface
1110  */
1111 [
1112     object,
1113     uuid(000214e8-0000-0000-c000-000000000046),
1114     pointer_default(unique),
1115     local
1116 ]
1117 interface IShellExtInit : IUnknown
1118 {
1119     typedef IShellExtInit *LPSHELLEXTINIT;
1120
1121     HRESULT Initialize(
1122         [in] LPCITEMIDLIST pidlFolder,
1123         [in] IDataObject *pdtobj,
1124         [in] HKEY hkeyProgID);
1125 }
1126
1127
1128 /*******************************************************************************/
1129 /* Note: the following interfaces are not in shobjidl.idl under Windows, they  */
1130 /* are declared directly in shlobj.h. It hopefully won't break anything to put */
1131 /* them here anyway.                                                           */
1132 /*******************************************************************************/
1133
1134 #ifndef MAX_PATH
1135 #define MAX_PATH 260
1136 #endif
1137
1138
1139 /*****************************************************************************
1140  * IPersistFolder3 interface
1141  */
1142 [
1143     object,
1144     uuid(cef04fdf-fe72-11d2-87a5-00c04f6837cf),
1145     pointer_default(unique)
1146 ]
1147 interface IPersistFolder3 : IPersistFolder2
1148 {
1149     typedef struct
1150     {
1151         LPITEMIDLIST    pidlTargetFolder;
1152         WCHAR           szTargetParsingName[MAX_PATH];
1153         WCHAR           szNetworkProvider[MAX_PATH];
1154         DWORD           dwAttributes;
1155         int             csidl;
1156     } PERSIST_FOLDER_TARGET_INFO;
1157
1158     HRESULT InitializeEx(
1159         [in] IBindCtx *pbc,
1160         [in] LPCITEMIDLIST pidlRoot,
1161         [in] const PERSIST_FOLDER_TARGET_INFO *ppfti);
1162
1163     HRESULT GetFolderTargetInfo( [out] PERSIST_FOLDER_TARGET_INFO *ppfti );
1164 }
1165
1166
1167 /*****************************************************************************
1168  * IExtractIconA interface
1169  */
1170 [
1171     object,
1172     uuid(000214eb-0000-0000-c000-000000000046),
1173     pointer_default(unique),
1174     local
1175 ]
1176 interface IExtractIconA : IUnknown
1177 {
1178 cpp_quote("#define GIL_OPENICON     0x0001")
1179 cpp_quote("#define GIL_FORSHELL     0x0002")
1180 cpp_quote("#define GIL_ASYNC        0x0020")
1181 cpp_quote("#define GIL_DEFAULTICON  0x0040")
1182 cpp_quote("#define GIL_FORSHORTCUT  0x0080")
1183
1184 cpp_quote("#define GIL_SIMULATEDOC  0x0001")
1185 cpp_quote("#define GIL_PERINSTANCE  0x0002")
1186 cpp_quote("#define GIL_PERCLASS     0x0004")
1187 cpp_quote("#define GIL_NOTFILENAME  0x0008")
1188 cpp_quote("#define GIL_DONTCACHE    0x0010")
1189
1190     typedef IExtractIconA *LPEXTRACTICONA;
1191
1192     HRESULT GetIconLocation(
1193         [in] UINT uFlags,
1194         [out, size_is(cchMax)] LPSTR szIconFile,
1195         [in] UINT cchMax,
1196         [out] INT *piIndex,
1197         [out] UINT *pwFlags);
1198
1199     HRESULT Extract(
1200         [in] LPCSTR pszFile,
1201         [in] UINT nIconIndex,
1202         [out] HICON *phiconLarge,
1203         [out] HICON *phiconSmall,
1204         [in] UINT nIconSize );
1205 }
1206
1207
1208 /*****************************************************************************
1209  * IExtractIconW interface
1210  */
1211 [
1212     object,
1213     uuid(000214fa-0000-0000-c000-000000000046),
1214     pointer_default(unique),
1215     local
1216 ]
1217 interface IExtractIconW : IUnknown
1218 {
1219     typedef IExtractIconW *LPEXTRACTICONW;
1220
1221     HRESULT GetIconLocation(
1222         [in] UINT uFlags,
1223         [out, size_is(cchMax)] LPWSTR szIconFile,
1224         [in] UINT cchMax,
1225         [out] INT *piIndex,
1226         [out] UINT *pwFlags);
1227
1228     HRESULT Extract(
1229         [in] LPCWSTR pszFile,
1230         [in] UINT nIconIndex,
1231         [out] HICON *phiconLarge,
1232         [out] HICON *phiconSmall,
1233         [in] UINT nIconSize );
1234 }
1235
1236 cpp_quote("#define LPEXTRACTICON WINELIB_NAME_AW(LPEXTRACTICON)")
1237 cpp_quote("#define IExtractIcon WINELIB_NAME_AW(IExtractIcon)")
1238
1239
1240 /*****************************************************************************
1241  * ICommDlgBrowser interface
1242  */
1243 [
1244     object,
1245     uuid(000214f1-0000-0000-c000-000000000046),
1246     pointer_default(unique)
1247 ]
1248 interface ICommDlgBrowser : IUnknown
1249 {
1250 cpp_quote("#define CDBOSC_SETFOCUS     0x00000000")
1251 cpp_quote("#define CDBOSC_KILLFOCUS    0x00000001")
1252 cpp_quote("#define CDBOSC_SELCHANGE    0x00000002")
1253 cpp_quote("#define CDBOSC_RENAME       0x00000003")
1254 cpp_quote("#define CDBOSC_STATECHANGE  0x00000004")
1255
1256     typedef ICommDlgBrowser *LPCOMMDLGBROWSER;
1257
1258     HRESULT OnDefaultCommand( [in] IShellView *shv );
1259     HRESULT OnStateChange( [in] IShellView *shv, [in] ULONG uChange );
1260     HRESULT IncludeObject( [in] IShellView *shv, [in] LPCITEMIDLIST pidl );
1261 }
1262
1263
1264 /*****************************************************************************
1265  * ICommDlgBrowser2 interface
1266  */
1267 [
1268  object,
1269  uuid(10339516-2894-11D2-9039-00C04F8EEB3E),
1270  pointer_default(unique)
1271 ]
1272 interface ICommDlgBrowser2 : ICommDlgBrowser
1273 {
1274
1275     HRESULT Notify(
1276         [in] IShellView *ppshv,
1277         [in] DWORD dwNotifyType);
1278
1279     HRESULT GetDefaultMenuText(
1280         [in] IShellView *ppshv,
1281         [out, string, size_is(cchMax)] LPWSTR pszText,
1282         [in] int cchMax);
1283
1284     HRESULT GetViewFlags(
1285         [out] DWORD *pdwFlags);
1286 }
1287
1288
1289 /*****************************************************************************
1290  * ICommDlgBrowser3 interface
1291  */
1292 [
1293  object,
1294  uuid(C8AD25A1-3294-41EE-8165-71174BD01C57),
1295  pointer_default(unique)
1296 ]
1297 interface ICommDlgBrowser3 : ICommDlgBrowser2
1298 {
1299
1300     HRESULT OnColumnClicked(
1301         [in] IShellView *ppshv,
1302         [in] int iColumn);
1303
1304     HRESULT GetCurrentFilter(
1305         [out, string, size_is(cchFileSpec)] LPWSTR pszFileSpec,
1306         [in] int cchFileSpec);
1307
1308     HRESULT OnPreviewCreated(
1309         [in] IShellView *ppshv);
1310 }
1311
1312 /*****************************************************************************
1313  * IDockingWindow interface
1314  */
1315 [
1316     object,
1317     uuid(012dd920-7b26-11d0-8ca9-00a0c92dbfe8)
1318 ]
1319 interface IDockingWindow : IOleWindow
1320 {
1321     HRESULT ShowDW(
1322         [in] BOOL fShow);
1323
1324     HRESULT CloseDW(
1325         [in] DWORD dwReserved);
1326
1327     HRESULT ResizeBorderDW(
1328         [in] LPCRECT prcBorder,
1329         [in] IUnknown *punkToolbarSite,
1330         [in] BOOL fReserved);
1331 };
1332
1333
1334 /*****************************************************************************
1335  * IDockingWindowFrame interface
1336  */
1337 [
1338     object,
1339     uuid(47d2657a-7b27-11d0-8ca9-00a0c92dbfe8),
1340     pointer_default(unique),
1341     local
1342 ]
1343 interface IDockingWindowFrame : IOleWindow
1344 {
1345 cpp_quote("#define DWFRF_NORMAL           0x0000")
1346 cpp_quote("#define DWFRF_DELETECONFIGDATA 0x0001")
1347 cpp_quote("#define DWFAF_HIDDEN           0x0001")
1348
1349     HRESULT AddToolbar(
1350         [in] IUnknown *punkSrc,
1351         [in] LPCWSTR pwszItem,
1352         [in] DWORD dwAddFlags);
1353
1354     HRESULT RemoveToolbar(
1355         [in] IUnknown *punkSrc,
1356         [in] DWORD dwRemoveFlags);
1357
1358     HRESULT FindToolbar(
1359         [in] LPCWSTR pwszItem,
1360         [in] REFIID riid,
1361         [out] LPVOID *ppvObj);
1362 }
1363
1364
1365 /*****************************************************************************
1366  * IDragSourceHelper interface
1367  */
1368 [
1369     object,
1370     uuid(de5bf786-477a-11d2-839d-00c04fd918d0),
1371     pointer_default(unique),
1372     local
1373 ]
1374 interface IDragSourceHelper : IUnknown
1375 {
1376     typedef struct
1377     {
1378         SIZE     sizeDragImage;
1379         POINT    ptOffset;
1380         HBITMAP  hbmpDragImage;
1381         COLORREF crColorKey;
1382     } SHDRAGIMAGE, *LPSHDRAGIMAGE;
1383
1384   HRESULT InitializeFromBitmap(
1385       [in] LPSHDRAGIMAGE pshdi,
1386       [in] IDataObject *pDataObject);
1387
1388   HRESULT InitializeFromWindow(
1389       [in] HWND hwnd,
1390       [in] POINT *ppt,
1391       [in] IDataObject *pDataObject);
1392 }
1393
1394
1395 /*****************************************************************************
1396  * IDropTargetHelper interface
1397  */
1398 [
1399     object,
1400     uuid(4657278b-411b-11d2-839a-00c04fd918d0),
1401     pointer_default(unique),
1402     local
1403 ]
1404 interface IDropTargetHelper : IUnknown
1405 {
1406     HRESULT DragEnter(
1407         [in] HWND hwndTarget,
1408         [in] IDataObject *pDataObject,
1409         [in] POINT *ppt,
1410         [in] DWORD dwEffect);
1411
1412     HRESULT DragLeave();
1413
1414     HRESULT DragOver(
1415         [in] POINT *ppt,
1416         [in] DWORD dwEffect);
1417
1418     HRESULT Drop(
1419         [in] IDataObject *pDataObject,
1420         [in] POINT *ppt,
1421         [in] DWORD dwEffect);
1422
1423     HRESULT Show( [in] BOOL fShow );
1424 }
1425
1426
1427 /*****************************************************************************
1428  * IContextMenu interface
1429  */
1430 [
1431     object,
1432     uuid(000214e4-0000-0000-c000-000000000046),
1433     pointer_default(unique),
1434     local
1435 ]
1436 interface IContextMenu : IUnknown
1437 {
1438 cpp_quote("#define CMF_NORMAL        0x00000000")
1439 cpp_quote("#define CMF_DEFAULTONLY   0x00000001")
1440 cpp_quote("#define CMF_VERBSONLY     0x00000002")
1441 cpp_quote("#define CMF_EXPLORE       0x00000004")
1442 cpp_quote("#define CMF_NOVERBS       0x00000008")
1443 cpp_quote("#define CMF_CANRENAME     0x00000010")
1444 cpp_quote("#define CMF_NODEFAULT     0x00000020")
1445 cpp_quote("#define CMF_INCLUDESTATIC 0x00000040")
1446 cpp_quote("#define CMF_EXTENDEDVERBS 0x00000100")
1447 cpp_quote("#define CMF_RESERVED      0xffff0000")
1448
1449 cpp_quote("#define GCS_VERBA         0x00000000")
1450 cpp_quote("#define GCS_HELPTEXTA     0x00000001")
1451 cpp_quote("#define GCS_VALIDATEA     0x00000002")
1452 cpp_quote("#define GCS_VERBW         0x00000004")
1453 cpp_quote("#define GCS_HELPTEXTW     0x00000005")
1454 cpp_quote("#define GCS_VALIDATEW     0x00000006")
1455 cpp_quote("#define GCS_UNICODE       0x00000004")
1456 cpp_quote("#define GCS_VERB          WINELIB_NAME_AW(GCS_VERB)")
1457 cpp_quote("#define GCS_HELPTEXT      WINELIB_NAME_AW(GCS_HELPTEXT)")
1458 cpp_quote("#define GCS_VALIDATE      WINELIB_NAME_AW(GCS_VALIDATE)")
1459
1460 cpp_quote("#define CMDSTR_NEWFOLDERA   \"NewFolder\"")
1461 cpp_quote("#define CMDSTR_VIEWLISTA    \"ViewList\"")
1462 cpp_quote("#define CMDSTR_VIEWDETAILSA \"ViewDetails\"")
1463 cpp_quote("#if defined(__GNUC__)")
1464 cpp_quote("# define CMDSTR_NEWFOLDERW (const WCHAR []){ 'N','e','w','F','o','l','d','e','r',0 }")
1465 cpp_quote("# define CMDSTR_VIEWLISTW (const WCHAR []){ 'V','i','e','w','L','i','s','t',0 }")
1466 cpp_quote("# define CMDSTR_VIEWDETAILSW (const WCHAR []){ 'V','i','e','w','D','e','t','a','i','l','s',0 }")
1467 cpp_quote("#elif defined(_MSC_VER)")
1468 cpp_quote("# define CMDSTR_NEWFOLDERW   L\"NewFolder\"")
1469 cpp_quote("# define CMDSTR_VIEWLISTW    L\"ViewList\"")
1470 cpp_quote("# define CMDSTR_VIEWDETAILSW L\"ViewDetails\"")
1471 cpp_quote("#else")
1472 cpp_quote("static const WCHAR CMDSTR_NEWFOLDERW[] = {'N','e','w','F','o','l','d','e','r',0};")
1473 cpp_quote("static const WCHAR CMDSTR_VIEWLISTW [] = {'V','i','e','w','L','i','s','t',0};")
1474 cpp_quote("static const WCHAR CMDSTR_VIEWDETAILSW[] = {'V','i','e','w','D','e','t','a','i','l','s',0};")
1475 cpp_quote("#endif")
1476 cpp_quote("#define CMDSTR_NEWFOLDER    WINELIB_NAME_AW(CMDSTR_NEWFOLDER)")
1477 cpp_quote("#define CMDSTR_VIEWLIST     WINELIB_NAME_AW(CMDSTR_VIEWLIST)")
1478 cpp_quote("#define CMDSTR_VIEWDETAILS  WINELIB_NAME_AW(CMDSTR_VIEWDETAILS)")
1479
1480 cpp_quote("#define CMIC_MASK_HOTKEY         SEE_MASK_HOTKEY")
1481 cpp_quote("#define CMIC_MASK_ICON           SEE_MASK_ICON")
1482 cpp_quote("#define CMIC_MASK_FLAG_NO_UI     SEE_MASK_FLAG_NO_UI")
1483 cpp_quote("#define CMIC_MASK_UNICODE        SEE_MASK_UNICODE")
1484 cpp_quote("#define CMIC_MASK_NO_CONSOLE     SEE_MASK_NO_CONSOLE")
1485 cpp_quote("#define CMIC_MASK_HASLINKNAME    SEE_MASK_HASLINKNAME")
1486 cpp_quote("#define CMIC_MASK_FLAG_SEP_VDM   SEE_MASK_FLAG_SEPVDM")
1487 cpp_quote("#define CMIC_MASK_HASTITLE       SEE_MASK_HASTITLE")
1488 cpp_quote("#define CMIC_MASK_ASYNCOK        SEE_MASK_ASYNCOK")
1489 cpp_quote("#define CMIC_MASK_NOASYNC        SEE_MASK_NOASYNC")
1490 cpp_quote("#define CMIC_MASK_SHIFT_DOWN     0x10000000")
1491 cpp_quote("#define CMIC_MASK_PTINVOKE       0x20000000")
1492 cpp_quote("#define CMIC_MASK_CONTROL_DOWN   0x40000000")
1493 cpp_quote("#define CMIC_MASK_FLAG_LOG_USAGE SEE_MASK_FLAG_LOG_USAGE")
1494 cpp_quote("#define CMIC_MASK_NOZONECHECKS   SEE_MASK_NOZONECHECKS")
1495
1496     typedef IContextMenu *LPCONTEXTMENU;
1497
1498     typedef struct tagCMINVOKECOMMANDINFO
1499     {
1500         DWORD cbSize;
1501         DWORD fMask;
1502         HWND hwnd;
1503         LPCSTR lpVerb;
1504         LPCSTR lpParameters;
1505         LPCSTR lpDirectory;
1506         INT nShow;
1507         DWORD dwHotKey;
1508         HANDLE hIcon;
1509     } CMINVOKECOMMANDINFO, *LPCMINVOKECOMMANDINFO;
1510
1511     typedef struct tagCMInvokeCommandInfoEx
1512     {
1513         DWORD cbSize;
1514         DWORD fMask;
1515         HWND hwnd;
1516         LPCSTR lpVerb;
1517         LPCSTR lpParameters;
1518         LPCSTR lpDirectory;
1519         INT nShow;
1520         DWORD dwHotKey;
1521         HANDLE hIcon;
1522         LPCSTR lpTitle;
1523         LPCWSTR lpVerbW;
1524         LPCWSTR lpParametersW;
1525         LPCWSTR lpDirectoryW;
1526         LPCWSTR lpTitleW;
1527         POINT ptInvoke;
1528     } CMINVOKECOMMANDINFOEX, *LPCMINVOKECOMMANDINFOEX;
1529
1530     HRESULT QueryContextMenu(
1531         [in] HMENU hmenu,
1532         [in] UINT indexMenu,
1533         [in] UINT idCmdFirst,
1534         [in] UINT idCmdLast,
1535         [in] UINT uFlags);
1536
1537     HRESULT InvokeCommand( [in] LPCMINVOKECOMMANDINFO lpici );
1538
1539     HRESULT GetCommandString(
1540         [in] UINT_PTR idCmd,
1541         [in] UINT uType,
1542         [out] UINT *pwReserved,
1543         [out, size_is(cchMax)] LPSTR pszName,
1544         [in] UINT cchMax);
1545 }
1546
1547
1548 /*****************************************************************************
1549  * IContextMenu2 interface
1550  */
1551 [
1552     object,
1553     uuid(000214f4-0000-0000-c000-000000000046),
1554     pointer_default(unique),
1555     local
1556 ]
1557 interface IContextMenu2 : IContextMenu
1558 {
1559     typedef IContextMenu2 *LPCONTEXTMENU2;
1560
1561     HRESULT HandleMenuMsg(
1562         [in] UINT uMsg,
1563         [in] WPARAM wParam,
1564         [in] LPARAM lParam);
1565 }
1566
1567
1568 /*****************************************************************************
1569  * IContextMenu3 interface
1570  */
1571 [
1572     object,
1573     uuid(bcfce0a0-ec17-11d0-8d10-00a0c90f2719),
1574     pointer_default(unique),
1575     local
1576 ]
1577 interface IContextMenu3 : IContextMenu2
1578 {
1579     typedef IContextMenu3 *LPCONTEXTMENU3;
1580
1581     HRESULT HandleMenuMsg2(
1582         [in] UINT uMsg,
1583         [in] WPARAM wParam,
1584         [in] LPARAM lParam,
1585         [out] LRESULT *plResult);
1586 }
1587
1588
1589 /*****************************************************************************
1590  * IShellExecuteHookA interface
1591  */
1592 [
1593     object,
1594     uuid(000214f5-0000-0000-c000-000000000046),
1595     pointer_default(unique),
1596     local
1597 ]
1598 interface IShellExecuteHookA : IUnknown
1599 {
1600     cpp_quote("struct _SHELLEXECUTEINFOA;")
1601     HRESULT Execute(
1602         [in, out] struct _SHELLEXECUTEINFOA* pei);
1603 }
1604
1605
1606 /*****************************************************************************
1607  * IShellExecuteHookW interface
1608  */
1609 [
1610     object,
1611     uuid(000214fb-0000-0000-c000-000000000046),
1612     pointer_default(unique),
1613     local
1614 ]
1615 interface IShellExecuteHookW : IUnknown
1616 {
1617     cpp_quote("struct _SHELLEXECUTEINFOW;")
1618     HRESULT Execute(
1619                 [in, out] struct _SHELLEXECUTEINFOW* pei);
1620 }
1621
1622 /*****************************************************************************
1623  * IShellLinkDataList interface
1624  */
1625 [
1626     object,
1627     uuid(45e2b4ae-b1c3-11d0-b92f-00a0c90312e1),
1628     pointer_default(unique)
1629 ]
1630 interface IShellLinkDataList : IUnknown
1631 {
1632     [local] HRESULT AddDataBlock(
1633                 [in] void *pDataBlock);
1634     [local] HRESULT CopyDataBlock(
1635                 [in] DWORD dwSig,
1636                 [out] void **ppDataBlock);
1637     HRESULT RemoveDataBlock(
1638                 [in] DWORD dwSig);
1639     HRESULT GetFlags(
1640                 [out] DWORD *pdwFlags);
1641     HRESULT SetFlags(
1642                 [in] DWORD dwFlags);
1643 }
1644
1645
1646 /*****************************************************************************
1647  * IResolveShellLink interface
1648  */
1649 [
1650     object,
1651     uuid(5cd52983-9449-11d2-963a-00c04f79adf0),
1652     pointer_default(unique)
1653 ]
1654 interface IResolveShellLink : IUnknown
1655 {
1656     HRESULT ResolveShellLink(
1657                 [in] IUnknown *punk,
1658                 [in] HWND hwnd,
1659                 [in] DWORD fFlags);
1660 }
1661
1662
1663 /*****************************************************************************
1664  * IURLSearchHook interface
1665  */
1666 [
1667     object,
1668     uuid(ac60f6a0-0fd9-11d0-99cb-00c04fd64497),
1669     pointer_default(unique),
1670     local
1671 ]
1672 interface IURLSearchHook : IUnknown
1673 {
1674     HRESULT Translate(
1675                 [in, out] LPWSTR lpwszSearchURL,
1676                 [in] DWORD cchBufferSize);
1677 }
1678
1679
1680 /*****************************************************************************
1681  * ISearchContext interface
1682  */
1683 [
1684     object,
1685     uuid(09f656a2-41af-480c-88f7-16cc0d164615),
1686     pointer_default(unique),
1687     local
1688 ]
1689 interface ISearchContext : IUnknown
1690 {
1691     HRESULT GetSearchUrl(
1692                 [in] BSTR *pbstrSearchUrl);
1693     HRESULT GetSearchText(
1694                 [in] BSTR *pbstrSearchText);
1695     HRESULT GetSearchStyle(
1696                 [in] BSTR *pdwSearchStyle);
1697 }
1698
1699
1700 /*****************************************************************************
1701  * IURLSearchHook2 interface
1702  */
1703 [
1704     object,
1705     uuid(5ee44da4-6d32-46e3-86bc-07540dedd0e0),
1706     pointer_default(unique),
1707     local
1708 ]
1709 interface IURLSearchHook2 : IURLSearchHook
1710 {
1711     HRESULT TranslateWithSearchContext(
1712                 [in, out] LPWSTR lpwszSearchURL,
1713                 [in] DWORD cchBufferSize,
1714                 [in] ISearchContext *pSearchContext);
1715 }
1716
1717
1718 cpp_quote("#define INewShortcutHook WINELIB_NAME_AW(INewShortcutHook)")
1719
1720 /*****************************************************************************
1721  * INewShortcutHookA interface
1722  */
1723 [
1724     object,
1725     uuid(000214e1-0000-0000-c000-000000000046),
1726     pointer_default(unique),
1727     local
1728 ]
1729 interface INewShortcutHookA : IUnknown
1730 {
1731     HRESULT SetReferent(
1732                 [in] LPCSTR pcszReferent,
1733                 [in] HWND hwnd);
1734     HRESULT GetReferent(
1735                 [out] LPSTR pcszReferent,
1736                 [in] int cchReferent);
1737     HRESULT SetFolder(
1738                 [in] LPCSTR pcszReferent);
1739     HRESULT GetFolder(
1740                 [out] LPSTR pcszReferent,
1741                 [in] int cchFolder);
1742     HRESULT GetName(
1743                 [out] LPSTR pszName,
1744                 [in] int cchName);
1745     HRESULT GetExtension(
1746                 [out] LPSTR pszExtension,
1747                 [in] int cchExtension);
1748
1749
1750
1751 /*****************************************************************************
1752  * INewShortcutHookW interface
1753  */
1754 [
1755     object,
1756     uuid(000214f7-0000-0000-c000-000000000046),
1757     pointer_default(unique),
1758     local
1759 ]
1760 interface INewShortcutHookW : IUnknown
1761 {
1762     HRESULT SetReferent(
1763                 [in] LPCWSTR pcszReferent,
1764                 [in] HWND hwnd);
1765     HRESULT GetReferent(
1766                 [out] LPWSTR pcszReferent,
1767                 [in] int cchReferent);
1768     HRESULT SetFolder(
1769                 [in] LPCWSTR pcszReferent);
1770     HRESULT GetFolder(
1771                 [out] LPWSTR pcszReferent,
1772                 [in] int cchFolder);
1773     HRESULT GetName(
1774                 [out] LPWSTR pszName,
1775                 [in] int cchName);
1776     HRESULT GetExtension(
1777                 [out] LPWSTR pszExtension,
1778                 [in] int cchExtension);
1779
1780
1781 /*****************************************************************************
1782  * IRunnableTask interface
1783  */
1784 [
1785     object,
1786     uuid(85788d00-6807-11d0-b810-00c04fd706ec),
1787     pointer_default(unique),
1788     local
1789 ]
1790 interface IRunnableTask : IUnknown
1791 {
1792     HRESULT Run();
1793     HRESULT Kill([in] BOOL fWait);
1794     HRESULT Suspend();
1795     HRESULT Resume();
1796     ULONG IsRunning();
1797 }
1798
1799 /*****************************************************************************
1800  * IShellChangeNotify interface
1801  */
1802 [
1803     object,
1804     uuid(d82be2b1-5764-11d0-a96e-00c04fd705a2),
1805     pointer_default(unique),
1806     local
1807 ]
1808 interface IShellChangeNotify : IUnknown
1809 {
1810     HRESULT OnChange(
1811                 [in] LONG lEvent,
1812                 [in] LPCITEMIDLIST pidl1,
1813                 [in] LPCITEMIDLIST pidl2);
1814 }
1815
1816 /*****************************************************************************
1817  * IFileSystemBindData interface
1818  */
1819 [
1820     object,
1821     uuid(01e18d10-4d8b-11d2-855d-006008059367),
1822     pointer_default(unique),
1823     local
1824 ]
1825 interface IFileSystemBindData : IUnknown
1826 {
1827     HRESULT SetFindData(
1828                 [in] const WIN32_FIND_DATAW *pfd);
1829     HRESULT GetFindData(
1830                 [out] WIN32_FIND_DATAW *pfd);
1831 }
1832
1833 /*****************************************************************************
1834  *    ITaskbarList interface
1835  */
1836 [
1837     object,
1838     uuid(56FDF342-FD6D-11d0-958A-006097C9A090),
1839     pointer_default(unique)
1840 ]
1841 interface ITaskbarList : IUnknown
1842 {
1843     HRESULT HrInit();
1844
1845     HRESULT AddTab(
1846         [in] HWND hwnd);
1847
1848     HRESULT DeleteTab(
1849         [in] HWND hwnd);
1850
1851     HRESULT ActivateTab(
1852         [in] HWND hwnd);
1853
1854     HRESULT SetActiveAlt(
1855         [in] HWND hwnd);
1856 }
1857
1858 /*****************************************************************************
1859  *    ITaskbarList2 interface
1860  */
1861 [
1862     object,
1863     uuid(602D4995-B13A-429B-A66E-1935E44F4317),
1864     pointer_default(unique)
1865 ]
1866 interface ITaskbarList2 : ITaskbarList
1867 {
1868     HRESULT MarkFullscreenWindow(
1869         [in] HWND hwnd,
1870         [in] BOOL fullscreen);
1871 }
1872
1873 cpp_quote("#ifdef MIDL_PASS")
1874 typedef IUnknown* HIMAGELIST;
1875 cpp_quote("#endif")
1876
1877 typedef [v1_enum] enum THUMBBUTTONFLAGS {
1878     THBF_ENABLED         = 0x0000,
1879     THBF_DISABLED        = 0x0001,
1880     THBF_DISMISSONCLICK  = 0x0002,
1881     THBF_NOBACKGROUND    = 0x0004,
1882     THBF_HIDDEN          = 0x0008,
1883     THBF_NONINTERACTIVE  = 0x0010
1884 } THUMBBUTTONFLAGS;
1885
1886 cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(THUMBBUTTONFLAGS)")
1887
1888 typedef [v1_enum] enum THUMBBUTTONMASK {
1889     THB_BITMAP   = 0x0001,
1890     THB_ICON     = 0x0002,
1891     THB_TOOLTIP  = 0x0004,
1892     THB_FLAGS    = 0x0008
1893 } THUMBBUTTONMASK;
1894
1895 cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(THUMBBUTTONMASK)")
1896
1897 cpp_quote("#include <pshpack8.h>")
1898 typedef struct THUMBBUTTON {
1899     THUMBBUTTONMASK dwMask;
1900     UINT iId;
1901     UINT iBitmap;
1902     HICON hIcon;
1903     WCHAR szTip[260];
1904     THUMBBUTTONFLAGS dwFlags;
1905 } THUMBBUTTON, *LPTHUMBBUTTON;
1906 cpp_quote("#include <poppack.h>")
1907
1908 [
1909     uuid(ea1afb91-9e28-4b86-90e9-9e9f8a5eefaf),
1910     object
1911 ]
1912 interface ITaskbarList3 : ITaskbarList2
1913 {
1914     typedef [v1_enum] enum TBPFLAG {
1915         TBPF_NOPROGRESS     = 0x0000,
1916         TBPF_INDETERMINATE  = 0x0001,
1917         TBPF_NORMAL         = 0x0002,
1918         TBPF_ERROR          = 0x0004,
1919         TBPF_PAUSED         = 0x0008
1920     } TBPFLAG;
1921
1922     cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(TBPFLAG)")
1923
1924     HRESULT SetProgressValue(
1925             [in] HWND hwnd,
1926             [in] ULONGLONG ullCompleted,
1927             [in] ULONGLONG ullTotal);
1928
1929     HRESULT SetProgressState(
1930             [in] HWND hwnd,
1931             [in] TBPFLAG tbpFlags);
1932
1933     HRESULT RegisterTab(
1934             [in] HWND hwndTab,
1935             [in] HWND hwndMDI);
1936
1937     HRESULT UnregisterTab([in] HWND hwndTab);
1938
1939     HRESULT SetTabOrder(
1940             [in] HWND hwndTab,
1941             [in] HWND hwndInsertBefore);
1942
1943     HRESULT SetTabActive(
1944             [in] HWND hwndTab,
1945             [in] HWND hwndMDI,
1946             [in] DWORD dwReserved);
1947
1948     HRESULT ThumbBarAddButtons(
1949             [in] HWND hwnd,
1950             [in] UINT cButtons,
1951             [in, size_is(cButtons)] LPTHUMBBUTTON pButton);
1952
1953     HRESULT ThumbBarUpdateButtons(
1954             [in] HWND hwnd,
1955             [in] UINT cButtons,
1956             [in, size_is(cButtons)] LPTHUMBBUTTON pButton);
1957
1958     HRESULT ThumbBarSetImageList(
1959             [in] HWND hwnd,
1960             [in] HIMAGELIST himl);
1961
1962     HRESULT SetOverlayIcon(
1963             [in] HWND hwnd,
1964             [in] HICON hIcon,
1965             [in, unique, string] LPCWSTR pszDescription);
1966
1967     HRESULT SetThumbnailTooltip(
1968             [in] HWND hwnd,
1969             [in, unique, string] LPCWSTR pszTip);
1970
1971     HRESULT SetThumbnailClip(
1972             [in] HWND hwnd,
1973             [in] RECT *prcClip);
1974 }
1975
1976 [
1977     uuid(c43dc798-95d1-4bea-9030-bb99e2983a1a),
1978     object
1979 ]
1980 interface ITaskbarList4 : ITaskbarList3
1981 {
1982     typedef [v1_enum] enum STPFLAG {
1983         STPF_NONE                       = 0x0000,
1984         STPF_USEAPPTHUMBNAILALWAYS      = 0x0001,
1985         STPF_USEAPPTHUMBNAILWHENACTIVE  = 0x0002,
1986         STPF_USEAPPPEEKALWAYS           = 0x0004,
1987         STPF_USEAPPPEEKWHENACTIVE       = 0x0008
1988     } STPFLAG;
1989
1990     cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(STPFLAG)")
1991
1992     HRESULT SetTabProperties(
1993             [in] HWND hwndTab,
1994             [in] STPFLAG stpFlags);
1995 }
1996
1997 /*****************************************************************************
1998  *    IAutoCompleteDropDown interface
1999  */
2000 [
2001     object,
2002     uuid(3CD141F4-3C6A-11d2-BCAA-00C04FD929DB),
2003     pointer_default(unique)
2004 ]
2005 interface IAutoCompleteDropDown : IUnknown
2006 {
2007 cpp_quote("#define ACDD_VISIBLE   0x0001")
2008
2009     HRESULT GetDropDownStatus(
2010         [out] DWORD *pdwFlags,
2011         [out, string] LPWSTR *ppwszString);
2012
2013     HRESULT ResetEnumerator();
2014 }
2015
2016 [
2017     object,
2018     uuid(cb728b20-f786-11ce-92ad-00aa00a74cd0),
2019     pointer_default(unique)
2020 ]
2021 interface IProfferService : IUnknown
2022 {
2023     HRESULT ProfferService(
2024         [in] REFGUID service,
2025         [in] IServiceProvider *pService,
2026         [out] DWORD *pCookie);
2027
2028     HRESULT RevokeService([in] DWORD cookie);
2029 }
2030
2031 /*****************************************************************************
2032  * IExplorerBrowserEvents interface
2033  */
2034 [
2035  object,
2036  uuid(361BBDC7-E6EE-4E13-BE58-58E2240C810F)
2037 ]
2038 interface IExplorerBrowserEvents : IUnknown
2039 {
2040     HRESULT OnNavigationPending(
2041         [in] PCIDLIST_ABSOLUTE pidlFolder);
2042
2043     HRESULT OnViewCreated(
2044         [in] IShellView *psv);
2045
2046     HRESULT OnNavigationComplete(
2047         [in] PCIDLIST_ABSOLUTE pidlFolder);
2048
2049     HRESULT OnNavigationFailed(
2050         [in] PCIDLIST_ABSOLUTE pidlFolder);
2051 }
2052
2053 typedef GUID EXPLORERPANE;
2054 typedef EXPLORERPANE *REFEXPLORERPANE;
2055
2056 cpp_quote("#define SID_ExplorerPaneVisibility IID_IExplorerPaneVisibility")
2057
2058 /*****************************************************************************
2059  * IExplorerPaneVisibility interface
2060  */
2061 [
2062  object,
2063  uuid(E07010EC-BC17-44C0-97B0-46C7C95B9EDC)
2064 ]
2065 interface IExplorerPaneVisibility : IUnknown
2066 {
2067     typedef enum tagEXPLORERPANESTATE {
2068         EPS_DONTCARE     = 0x0,
2069         EPS_DEFAULT_ON   = 0x1,
2070         EPS_DEFAULT_OFF  = 0x2,
2071         EPS_STATE_MASK   = 0xffff,
2072         EPS_INITIALSTATE = 0x10000,
2073         EPS_FORCE        = 0x20000
2074     } EXPLORERPANESTATE;
2075
2076     HRESULT GetPaneState(
2077         [in] REFEXPLORERPANE ep,
2078         [out] EXPLORERPANESTATE *peps);
2079 }
2080
2081 typedef [v1_enum] enum tagEXPLORER_BROWSER_FILL_FLAGS {
2082     EBF_NONE                     = 0,
2083     EBF_SELECTFROMDATAOBJECT     = 0x100,
2084     EBF_NODROPTARGET             = 0x200
2085 } EXPLORER_BROWSER_FILL_FLAGS;
2086
2087 typedef [v1_enum] enum tagEXPLORER_BROWSER_OPTIONS {
2088     EBO_NONE               = 0x00,
2089     EBO_NAVIGATEONCE       = 0x01,
2090     EBO_SHOWFRAMES         = 0x02,
2091     EBO_ALWAYSNAVIGATE     = 0x04,
2092     EBO_NOTRAVELLOG        = 0x08,
2093     EBO_NOWRAPPERWINDOW    = 0x10,
2094     EBO_HTMLSHAREPOINTVIEW = 0x20
2095 } EXPLORER_BROWSER_OPTIONS;
2096
2097 cpp_quote("#define SID_SExplorerBrowserFrame IID_ICommDlgBrowser")
2098
2099 /*****************************************************************************
2100  * IExplorerBrowser interface
2101  */
2102 [
2103  object,
2104  uuid(DFD3B6B5-C10C-4BE9-85F6-A66969F402F6),
2105  pointer_default(unique)
2106 ]
2107 interface IExplorerBrowser : IUnknown
2108 {
2109
2110     [local] HRESULT Initialize(
2111         [in] HWND hwndParent,
2112         [in] const RECT *prc,
2113         [in, unique] const FOLDERSETTINGS *pfs);
2114
2115     HRESULT Destroy();
2116
2117     [local] HRESULT SetRect(
2118         [in,out,unique] HDWP *phdwp,
2119         [in] RECT rcBrowser);
2120
2121     HRESULT SetPropertyBag(
2122         [in, string] LPCWSTR pszPropertyBag);
2123
2124     HRESULT SetEmptyText(
2125         [in, string] LPCWSTR pszEmptyText);
2126
2127     HRESULT SetFolderSettings(
2128         [in] const FOLDERSETTINGS *pfs);
2129
2130     HRESULT Advise(
2131         [in] IExplorerBrowserEvents *psbe,
2132         [out] DWORD *pdwCookie);
2133
2134     HRESULT Unadvise(
2135         [in] DWORD dwCookie);
2136
2137     HRESULT SetOptions(
2138         [in] EXPLORER_BROWSER_OPTIONS dwFlag);
2139
2140     HRESULT GetOptions(
2141         [out] EXPLORER_BROWSER_OPTIONS *pdwFlag);
2142
2143     HRESULT BrowseToIDList(
2144         [in] PCUIDLIST_RELATIVE pidl,
2145         [in] UINT uFlags);
2146
2147     HRESULT BrowseToObject(
2148         [in] IUnknown *punk,
2149         [in] UINT uFlags);
2150
2151     HRESULT FillFromObject(
2152         [in] IUnknown *punk,
2153         [in] EXPLORER_BROWSER_FILL_FLAGS dwFlags);
2154
2155     HRESULT RemoveAll();
2156
2157     HRESULT GetCurrentView(
2158         [in] REFIID riid,
2159         [out, iid_is(riid)] void **ppv);
2160 }
2161
2162 /*****************************************************************************
2163  * INameSpaceTreeControl interface
2164  */
2165 [
2166  object,
2167  uuid(028212A3-B627-47E9-8856-C14265554E4F)
2168 ]
2169 interface INameSpaceTreeControl : IUnknown
2170 {
2171     [v1_enum] enum _NSTCSTYLE {
2172         NSTCS_HASEXPANDOS                 = 0x00000001,
2173         NSTCS_HASLINES                    = 0x00000002,
2174         NSTCS_SINGLECLICKEXPAND           = 0x00000004,
2175         NSTCS_FULLROWSELECT               = 0x00000008,
2176         NSTCS_SPRINGEXPAND                = 0x00000010,
2177         NSTCS_HORIZONTALSCROLL            = 0x00000020,
2178         NSTCS_ROOTHASEXPANDO              = 0x00000040,
2179         NSTCS_SHOWSELECTIONALWAYS         = 0x00000080,
2180         NSTCS_NOINFOTIP                   = 0x00000200,
2181         NSTCS_EVENHEIGHT                  = 0x00000400,
2182         NSTCS_NOREPLACEOPEN               = 0x00000800,
2183         NSTCS_DISABLEDRAGDROP             = 0x00001000,
2184         NSTCS_NOORDERSTREAM               = 0x00002000,
2185         NSTCS_RICHTOOLTIP                 = 0x00004000,
2186         NSTCS_BORDER                      = 0x00008000,
2187         NSTCS_NOEDITLABELS                = 0x00010000,
2188         NSTCS_TABSTOP                     = 0x00020000,
2189         NSTCS_FAVORITESMODE               = 0x00080000,
2190         NSTCS_AUTOHSCROLL                 = 0x00100000,
2191         NSTCS_FADEINOUTEXPANDOS           = 0x00200000,
2192         NSTCS_EMPTYTEXT                   = 0x00400000,
2193         NSTCS_CHECKBOXES                  = 0x00800000,
2194         NSTCS_PARTIALCHECKBOXES           = 0x01000000,
2195         NSTCS_EXCLUSIONCHECKBOXES         = 0x02000000,
2196         NSTCS_DIMMEDCHECKBOXES            = 0x04000000,
2197         NSTCS_NOINDENTCHECKS              = 0x08000000,
2198         NSTCS_ALLOWJUNCTIONS              = 0x10000000,
2199         NSTCS_SHOWTABSBUTTON              = 0x20000000,
2200         NSTCS_SHOWDELETEBUTTON            = 0x40000000,
2201         NSTCS_SHOWREFRESHBUTTON      = (int)0x80000000
2202     };
2203     typedef DWORD NSTCSTYLE;
2204
2205     [v1_enum] enum _NSTCROOTSTYLE {
2206         NSTCRS_VISIBLE                    = 0x0000,
2207         NSTCRS_HIDDEN                     = 0x0001,
2208         NSTCRS_EXPANDED                   = 0x0002
2209     };
2210     typedef DWORD NSTCROOTSTYLE;
2211
2212     [v1_enum] enum _NSTCITEMSTATE {
2213         NSTCIS_NONE                       = 0x0000,
2214         NSTCIS_SELECTED                   = 0x0001,
2215         NSTCIS_EXPANDED                   = 0x0002,
2216         NSTCIS_BOLD                       = 0x0004,
2217         NSTCIS_DISABLED                   = 0x0008,
2218         NSTCIS_SELECTEDNOEXPAND           = 0x0010
2219     };
2220     typedef DWORD NSTCITEMSTATE;
2221
2222     typedef [v1_enum] enum NSTCGNI {
2223         NSTCGNI_NEXT                      = 0,
2224         NSTCGNI_NEXTVISIBLE               = 1,
2225         NSTCGNI_PREV                      = 2,
2226         NSTCGNI_PREVVISIBLE               = 3,
2227         NSTCGNI_PARENT                    = 4,
2228         NSTCGNI_CHILD                     = 5,
2229         NSTCGNI_FIRSTVISIBLE              = 6,
2230         NSTCGNI_LASTVISIBLE               = 7
2231     } NSTCGNI;
2232
2233     HRESULT Initialize(
2234         [in] HWND hwndParent,
2235         [in, unique] RECT *prc,
2236         [in] NSTCSTYLE nstcsFlags);
2237
2238     HRESULT TreeAdvise(
2239         [in] IUnknown *punk,
2240         [out] DWORD *pdwCookie);
2241
2242     HRESULT TreeUnadvise(
2243         [in] DWORD dwCookie);
2244
2245     HRESULT AppendRoot(
2246         [in] IShellItem *psiRoot,
2247         [in] SHCONTF grfEnumFlags,
2248         [in] NSTCROOTSTYLE grfRootStyle,
2249         [in, unique] IShellItemFilter *pif);
2250
2251     HRESULT InsertRoot(
2252         [in] int iIndex,
2253         [in] IShellItem *psiRoot,
2254         [in] SHCONTF grfEnumFlags,
2255         [in] NSTCROOTSTYLE grfRootStyle,
2256         [in, unique] IShellItemFilter *pif);
2257
2258     HRESULT RemoveRoot(
2259         [in] IShellItem *psiRoot);
2260
2261     HRESULT RemoveAllRoots();
2262
2263     HRESULT GetRootItems(
2264         [out] IShellItemArray **ppsiaRootItems);
2265
2266     HRESULT SetItemState(
2267         [in] IShellItem *psi,
2268         [in] NSTCITEMSTATE nstcisMask,
2269         [in] NSTCITEMSTATE nstcisFlags);
2270
2271     HRESULT GetItemState(
2272         [in] IShellItem *psi,
2273         [in] NSTCITEMSTATE nstcismask,
2274         [out] NSTCITEMSTATE *pnstcisFlags);
2275
2276     HRESULT GetSelectedItems(
2277         [out] IShellItemArray **psiaItems);
2278
2279     HRESULT GetItemCustomState(
2280         [in] IShellItem *psi,
2281         [out] int *piStateNumber);
2282
2283     HRESULT SetItemCustomState(
2284         [in] IShellItem *psi,
2285         [in] int iStateNumber);
2286
2287     HRESULT EnsureItemVisible(
2288         [in] IShellItem *psi);
2289
2290     HRESULT SetTheme(
2291         [in, string] LPCWSTR pszTheme);
2292
2293     HRESULT GetNextItem(
2294         [in, unique] IShellItem *psi,
2295         [in] NSTCGNI nstcgi,
2296         [out] IShellItem **ppsiNext);
2297
2298     HRESULT HitTest(
2299         [in] POINT *ppt,
2300         [out] IShellItem **ppsiOut);
2301
2302     HRESULT GetItemRect(
2303         [in] IShellItem *psi,
2304         [out] RECT *prect);
2305
2306     HRESULT CollapseAll();
2307 }
2308
2309 /*****************************************************************************
2310  * INameSpaceTreeControl2 interface
2311  */
2312 [
2313  object,
2314  uuid(7CC7AED8-290E-49BC-8945-C1401CC9306C)
2315 ]
2316 interface INameSpaceTreeControl2 : INameSpaceTreeControl
2317 {
2318     typedef [v1_enum] enum NSTCSTYLE2 {
2319         NSTCS2_DEFAULT                     = 0x00,
2320         NSTCS2_INTERRUPTNOTIFICATIONS      = 0x01,
2321         NSTCS2_SHOWNULLSPACEMENU           = 0x02,
2322         NSTCS2_DISPLAYPADDING              = 0x04,
2323         NSTCS2_DISPLAYPINNEDONLY           = 0x08,
2324         NTSCS2_NOSINGLETONAUTOEXPAND       = 0x10,  /* The apparent typo here is   */
2325         NTSCS2_NEVERINSERTNONENUMERATED    = 0x20   /* present also in the Win SDK */
2326     } NSTCSTYLE2;
2327     cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(NSTCSTYLE2)")
2328
2329     HRESULT SetControlStyle(
2330         [in] NSTCSTYLE nstcsMask,
2331         [in] NSTCSTYLE nstcsStyle);
2332
2333     HRESULT GetControlStyle(
2334         [in] NSTCSTYLE nstcsMask,
2335         [out] NSTCSTYLE *pnstcsStyle);
2336
2337     HRESULT SetControlStyle2(
2338         [in] NSTCSTYLE2 nstcsMask,
2339         [in] NSTCSTYLE2 nstcsStyle);
2340
2341     HRESULT GetControlStyle2(
2342         [in] NSTCSTYLE2 nstcsMask,
2343         [out] NSTCSTYLE2 *pnstcsStyle);
2344 }
2345
2346 /*****************************************************************************
2347  * INameSpaceTreeControlEvents interface
2348  */
2349
2350 [
2351  object,
2352  uuid(93D77985-B3D8-4484-8318-672CDDA002CE),
2353  local
2354 ]
2355 interface INameSpaceTreeControlEvents : IUnknown
2356 {
2357     [v1_enum] enum _NSTCEHITTEST {
2358         NSTCEHT_NOWHERE                    = 0x0001,
2359         NSTCEHT_ONITEMICON                 = 0x0002,
2360         NSTCEHT_ONITEMLABEL                = 0x0004,
2361         NSTCEHT_ONITEMIDENT                = 0x0008,
2362         NSTCEHT_ONITEMBUTTON               = 0x0010,
2363         NSTCEHT_ONITEMRIGHT                = 0x0020,
2364         NSTCEHT_ONITEMSTATEICON            = 0x0040,
2365         NSTCEHT_ONITEM                     = 0x0046,
2366         NSTCEHT_ONITEMTABBUTTON            = 0x1000
2367     };
2368     typedef DWORD NSTCEHITTEST;
2369
2370     [v1_enum] enum _NSTCECLICKTYPE {
2371         NSTCECT_LBUTTON                    = 0x1,
2372         NSTCECT_MBUTTON                    = 0x2,
2373         NSTCECT_RBUTTON                    = 0x3,
2374         NSTCECT_BUTTON                     = 0x3,
2375         NSTCECT_DBLCLICK                   = 0x4
2376     };
2377     typedef DWORD NSTCECLICKTYPE;
2378
2379     HRESULT OnItemClick(
2380         [in] IShellItem *psi,
2381         [in] NSTCEHITTEST nstceHitTest,
2382         [in] NSTCECLICKTYPE nstceClickType);
2383
2384     HRESULT OnPropertyItemCommit(
2385         [in] IShellItem *psi);
2386
2387     HRESULT OnItemStateChanging(
2388         [in] IShellItem *psi,
2389         [in] NSTCITEMSTATE nstcisMask,
2390         [in] NSTCITEMSTATE nstcisState);
2391
2392     HRESULT OnItemStateChanged(
2393         [in] IShellItem *psi,
2394         [in] NSTCITEMSTATE nstcisMask,
2395         [in] NSTCITEMSTATE nstcisState);
2396
2397     HRESULT OnSelectionChanged(
2398         [in] IShellItemArray *psiaSelection);
2399
2400     HRESULT OnKeyboardInput(
2401         [in] UINT uMsg,
2402         [in] WPARAM wParam,
2403         [in] LPARAM lParam);
2404
2405     HRESULT OnBeforeExpand(
2406         [in] IShellItem *psi);
2407
2408     HRESULT OnAfterExpand(
2409         [in] IShellItem *psi);
2410
2411     HRESULT OnBeginLabelEdit(
2412         [in] IShellItem *psi);
2413
2414     HRESULT OnEndLabelEdit(
2415         [in] IShellItem *psi);
2416
2417     HRESULT OnGetToolTip(
2418         [in] IShellItem *psi,
2419         [out, string, size_is(cchTip)] LPWSTR pszTip,
2420         [in] int cchTip);
2421
2422     HRESULT OnBeforeItemDelete(
2423         [in] IShellItem *psi);
2424
2425     HRESULT OnItemAdded(
2426         [in] IShellItem *psi,
2427         [in] BOOL fIsRoot);
2428
2429     HRESULT OnItemDeleted(
2430         [in] IShellItem *psi,
2431         [in] BOOL fIsRoot);
2432
2433     HRESULT OnBeforeContextMenu(
2434         [in, unique] IShellItem *psi,
2435         [in] REFIID riid,
2436         [out, iid_is(riid)] void **ppv);
2437
2438     HRESULT OnAfterContextMenu(
2439         [in] IShellItem *psi,
2440         [in] IContextMenu *pcmIn,
2441         [in] REFIID riid,
2442         [out, iid_is(riid)] void **ppv);
2443
2444     HRESULT OnBeforeStateImageChange(
2445         [in] IShellItem *psi);
2446
2447     HRESULT OnGetDefaultIconIndex(
2448         [in] IShellItem *psi,
2449         [out] int *piDefaultIcon,
2450         [out] int *piOpenIcon);
2451 }
2452
2453 /*****************************************************************************
2454  * INameSpaceTreeControlCustomDraw interface
2455  */
2456 [
2457  object,
2458  uuid(2D3BA758-33EE-42D5-BB7B-5F3431D86C78),
2459  local
2460 ]
2461
2462 interface INameSpaceTreeControlCustomDraw : IUnknown
2463 {
2464     typedef struct NSTCCUSTOMDRAW
2465     {
2466         IShellItem *psi;
2467         UINT uItemState;
2468         NSTCITEMSTATE nstcis;
2469         LPCWSTR pszText;
2470         int iImage;
2471         HIMAGELIST himl;
2472         int iLevel;
2473         int iIndent;
2474     } NSTCCUSTOMDRAW;
2475
2476     HRESULT PrePaint(
2477         [in] HDC hdc,
2478         [in] RECT *prc,
2479         [out] LRESULT *plres);
2480
2481     HRESULT PostPaint(
2482         [in] HDC hdc,
2483         [in] RECT *prc);
2484
2485     HRESULT ItemPrePaint(
2486         [in] HDC hdc,
2487         [in] RECT *prc,
2488         [in, out] COLORREF *pclrText,
2489         [in, out] COLORREF *pclrTextBk,
2490         [out] LRESULT *plres);
2491
2492     HRESULT ItemPostPaint(
2493         [in] HDC hdc,
2494         [in] RECT *prc,
2495         [in] NSTCCUSTOMDRAW *pnstccdItem);
2496 }
2497
2498 /*****************************************************************************
2499  * INameSpaceTreeControlDropHandler interface
2500  */
2501 [
2502  object,
2503  uuid(F9C665D6-C2F2-4C19-BF33-8322D7352F51),
2504  local
2505 ]
2506 interface INameSpaceTreeControlDropHandler : IUnknown
2507 {
2508     HRESULT OnDragEnter(
2509         [in, unique] IShellItem *psiOver,
2510         [in] IShellItemArray *psiaData,
2511         [in] BOOL fOutsideSource,
2512         [in] DWORD grfKeyState,
2513         [in, out] DWORD *pdwEffect);
2514
2515     HRESULT OnDragOver(
2516         [in, unique] IShellItem *psiOver,
2517         [in] IShellItemArray *psiaData,
2518         [in] DWORD grfKeyState,
2519         [in, out] DWORD *pdwEffect);
2520
2521     HRESULT OnDragPosition(
2522         [in, unique] IShellItem *psiOver,
2523         [in] IShellItemArray *psiaData,
2524         [in] int iNewPosition,
2525         [in] int iOldPosition);
2526
2527     HRESULT OnDrop(
2528         [in, unique] IShellItem *psiOver,
2529         [in] IShellItemArray *psiaData,
2530         [in] int iPosition,
2531         [in] DWORD grfKeyState,
2532         [in, out] DWORD *pdwEffect);
2533
2534     HRESULT OnDropPosition(
2535         [in, unique] IShellItem *psiOver,
2536         [in] IShellItemArray *psiaData,
2537         [in] int iNewPosition,
2538         [in] int iOldPosition);
2539
2540     HRESULT OnDragLeave(
2541         [in, unique] IShellItem *psiOver);
2542 }
2543 cpp_quote("#define NSTCDHPOS_ONTOP -1")
2544
2545 interface IFileDialog;
2546
2547 typedef [v1_enum] enum FDE_OVERWRITE_RESPONSE
2548 {
2549     FDEOR_DEFAULT  = 0,
2550     FDEOR_ACCCEP   = 1,
2551     FDEOR_REFUSE   = 2
2552 } FDE_OVERWRITE_RESPONSE;
2553
2554 typedef [v1_enum] enum FDE_SHAREVIOLATION_RESPONSE
2555 {
2556     FDESVR_DEFAULT = 0,
2557     FDESVR_ACCEPT  = 1,
2558     FDESVR_REFUSE  = 2
2559 } FDE_SHAREVIOLATION_RESPONSE;
2560
2561 /*****************************************************************************
2562  * IFileDialogEvents interface
2563  */
2564 [
2565  object,
2566  uuid(973510DB-7D7F-452B-8975-74A85828D354),
2567  pointer_default(unique)
2568 ]
2569 interface IFileDialogEvents : IUnknown
2570 {
2571     HRESULT OnFileOk(
2572         [in] IFileDialog *pfd);
2573
2574     HRESULT OnFolderChanging(
2575         [in] IFileDialog *pfd,
2576         [in] IShellItem *psiFolder);
2577
2578     HRESULT OnFolderChange(
2579         [in] IFileDialog *pfd);
2580
2581     HRESULT OnSelectionChange(
2582         [in] IFileDialog *pfd);
2583
2584     HRESULT OnShareViolation(
2585         [in] IFileDialog *pfd,
2586         [in] IShellItem *psi,
2587         [out] FDE_SHAREVIOLATION_RESPONSE *pResponse);
2588
2589     HRESULT OnTypeChange(
2590         [in] IFileDialog *pfd);
2591
2592     HRESULT OnOverwrite(
2593         [in] IFileDialog *pfd,
2594         [in] IShellItem *psi,
2595         [out] FDE_OVERWRITE_RESPONSE *pResponse);
2596 }
2597
2598 /*****************************************************************************
2599  * IModalWindow interface
2600  */
2601 [
2602  object,
2603  uuid(B4DB1657-70D7-485E-8E3E-6FCB5A5C1802),
2604  pointer_default(unique)
2605 ]
2606 interface IModalWindow : IUnknown
2607 {
2608     [local]
2609     HRESULT Show(
2610         [in, unique, annotation("__in_opt")] HWND hwndOwner);
2611
2612     [call_as(Show)]
2613     HRESULT RemoteShow(
2614         [in, unique] HWND hwndOwner);
2615 }
2616
2617 typedef [v1_enum] enum FDAP
2618 {
2619     FDAP_BOTTOM    = 0,
2620     FDAP_TOP       = 1
2621 } FDAP;
2622
2623 /*****************************************************************************
2624  * IFileDialog interface
2625  */
2626 [
2627  object,
2628  uuid(42F85136-DB7E-439C-85F1-E4075D135FC8),
2629  pointer_default(unique)
2630 ]
2631 interface IFileDialog : IModalWindow
2632 {
2633     [v1_enum] enum _FILEOPENDIALOGOPTIONS
2634     {
2635         FOS_OVERWRITEPROMPT     = 0x00000002,
2636         FOS_STRICTFILETYPES     = 0x00000004,
2637         FOS_NOCHANGEDIR         = 0x00000008,
2638         FOS_PICKFOLDERS         = 0x00000020,
2639         FOS_FORCEFILESYSTEM     = 0x00000040,
2640         FOS_ALLNONSTORAGEITEMS  = 0x00000080,
2641         FOS_NOVALIDATE          = 0x00000100,
2642         FOS_ALLOWMULTISELECT    = 0x00000200,
2643         FOS_PATHMUSTEXIST       = 0x00000800,
2644         FOS_FILEMUSTEXIST       = 0x00001000,
2645         FOS_CREATEPROMPT        = 0x00002000,
2646         FOS_SHAREAWARE          = 0x00004000,
2647         FOS_NOREADONLYRETURN    = 0x00008000,
2648         FOS_NOTESTFILECREATE    = 0x00010000,
2649         FOS_HIDEMRUPLACES       = 0x00020000,
2650         FOS_HIDEPINNEDPLACES    = 0x00040000,
2651         FOS_NODEREFERENCELINKS  = 0x00100000,
2652         FOS_DONTADDTORECENT     = 0x02000000,
2653         FOS_FORCESHOWHIDDEN     = 0x10000000,
2654         FOS_DEFAULTNOMINIMODE   = 0x20000000,
2655         FOS_FORCEPREVIEWPANEON  = 0x40000000
2656     };
2657     typedef DWORD FILEOPENDIALOGOPTIONS;
2658
2659     HRESULT SetFileTypes(
2660         [in] UINT cFileTypes,
2661         [in, size_is(cFileTypes)] const COMDLG_FILTERSPEC *rgFilterSpec);
2662
2663     HRESULT SetFileTypeIndex(
2664         [in] UINT iFileType);
2665
2666     HRESULT GetFileTypeIndex(
2667         [out] UINT *piFileType);
2668
2669     HRESULT Advise(
2670         [in] IFileDialogEvents *pfde,
2671         [out] DWORD *pdwCookie);
2672
2673     HRESULT Unadvise(
2674         [in] DWORD dwCookie);
2675
2676     HRESULT SetOptions(
2677         [in] FILEOPENDIALOGOPTIONS fos);
2678
2679     HRESULT GetOptions(
2680         [in] FILEOPENDIALOGOPTIONS *pfos);
2681
2682     HRESULT SetDefaultFolder(
2683         [in] IShellItem *psi);
2684
2685     HRESULT SetFolder(
2686         [in] IShellItem *psi);
2687
2688     HRESULT GetFolder(
2689         [out] IShellItem **ppsi);
2690
2691     HRESULT GetCurrentSelection(
2692         [out] IShellItem **ppsi);
2693
2694     HRESULT SetFileName(
2695         [in, string] LPCWSTR pszName);
2696
2697     HRESULT GetFileName(
2698         [out, string] LPWSTR *pszName);
2699
2700     HRESULT SetTitle(
2701         [in, string] LPCWSTR pszTitle);
2702
2703     HRESULT SetOkButtonLabel(
2704         [in, string] LPCWSTR pszText);
2705
2706     HRESULT SetFileNameLabel(
2707         [in, string] LPCWSTR pszLabel);
2708
2709     HRESULT GetResult(
2710         [out] IShellItem **ppsi);
2711
2712     HRESULT AddPlace(
2713         [in] IShellItem *psi,
2714         [in] FDAP fdap);
2715
2716     HRESULT SetDefaultExtension(
2717         [in, string] LPCWSTR pszDefaultExtension);
2718
2719     HRESULT Close(
2720         [in] HRESULT hr);
2721
2722     HRESULT SetClientGuid(
2723         [in] REFGUID guid);
2724
2725     HRESULT ClearClientData();
2726
2727     HRESULT SetFilter(
2728         [in] IShellItemFilter *pFilter);
2729 }
2730
2731 /*****************************************************************************
2732  * IFileDialog2 interface
2733  */
2734 [
2735  object,
2736  uuid(61744FC7-85B5-4791-A9B0-272276309B13),
2737  pointer_default(unique)
2738 ]
2739 interface IFileDialog2 : IFileDialog
2740 {
2741     HRESULT SetCancelButtonLabel(
2742         [in] LPCWSTR pszLabel);
2743
2744     HRESULT SetNavigationRoot(
2745         [in] IShellItem *psi);
2746 }
2747
2748 /*****************************************************************************
2749  * IFileOperationProgressSink interface
2750  */
2751 [
2752  object,
2753  uuid(04B0F1A7-9490-44BC-96E1-4296A31252E2),
2754  pointer_default(unique)
2755 ]
2756 interface IFileOperationProgressSink : IUnknown
2757 {
2758     HRESULT StartOperations();
2759
2760     HRESULT FinishOperations(
2761         [in] HRESULT hrResult);
2762
2763     HRESULT PreRenameItem(
2764         [in] DWORD dwFlags,
2765         [in] IShellItem *psiItem,
2766         [in, unique, string] LPCWSTR pszNewName);
2767
2768     HRESULT PostRenameItem(
2769         [in] DWORD dwFlags,
2770         [in] IShellItem *psiItem,
2771         [in, string] LPCWSTR pszNewName,
2772         [in] HRESULT hrRename,
2773         [in] IShellItem *psiNewlyCreated);
2774
2775     HRESULT PreMoveItem(
2776         [in] DWORD dwFlags,
2777         [in] IShellItem *psiItem,
2778         [in] IShellItem *psiDestinationFolder,
2779         [in, unique, string] LPCWSTR pszNewName);
2780
2781     HRESULT PostMoveItem(
2782         [in] DWORD dwFlags,
2783         [in] IShellItem *psiItem,
2784         [in] IShellItem *psiDestinationFolder,
2785         [in, unique, string] LPCWSTR pszNewName,
2786         [in] HRESULT hrMove,
2787         [in] IShellItem *psiNewlyCreated);
2788
2789     HRESULT PreCopyItem(
2790         [in] DWORD dwFlags,
2791         [in] IShellItem *psiItem,
2792         [in] IShellItem *psiDestinationFolder,
2793         [in, unique, string] LPCWSTR pszNewName);
2794
2795     HRESULT PostCopyItem(
2796         [in] DWORD dwFlags,
2797         [in] IShellItem *psiItem,
2798         [in] IShellItem *psiDestinationFolder,
2799         [in, unique, string] LPCWSTR pszNewName,
2800         [in] HRESULT hrCopy,
2801         [in] IShellItem *psiNewlyCreated);
2802
2803     HRESULT PreDeleteItem(
2804         [in] DWORD dwFlags,
2805         [in] IShellItem *psiItem);
2806
2807     HRESULT PostDeleteItem(
2808         [in] DWORD dwFlags,
2809         [in] IShellItem *psiItem,
2810         [in] HRESULT hrDelete,
2811         [in] IShellItem *psiNewlyCreated);
2812
2813     HRESULT PreNewItem(
2814         [in] DWORD dwFlags,
2815         [in] IShellItem *psiDestinationFolder,
2816         [in, unique, string] LPCWSTR pszNewName);
2817
2818     HRESULT PostNewItem(
2819         [in] DWORD dwFlags,
2820         [in] IShellItem *psiDestinationFolder,
2821         [in, unique, string] LPCWSTR pszNewName,
2822         [in, unique, string] LPCWSTR pszTemplateName,
2823         [in] DWORD dwFileAttributes,
2824         [in] HRESULT hrNew,
2825         [in] IShellItem *psiNewItem);
2826
2827     HRESULT UpdateProgress(
2828         [in] UINT iWorkTotal,
2829         [in] UINT iWorkSoFar);
2830
2831     HRESULT ResetTimer();
2832
2833     HRESULT PauseTimer();
2834
2835     HRESULT ResumeTimer();
2836 }
2837
2838 /*****************************************************************************
2839  * IFileSaveDialog interface
2840  */
2841 [
2842  object,
2843  uuid(84BCCD23-5FDE-4CDB-AEA4-AF64B83D78AB),
2844  pointer_default(unique)
2845 ]
2846 interface IFileSaveDialog : IFileDialog
2847 {
2848     HRESULT SetSaveAsItem(
2849         [in] IShellItem *psi);
2850
2851     HRESULT SetProperties(
2852         [in] IPropertyStore *pStore);
2853
2854     HRESULT SetCollectedProperties(
2855         [in] IPropertyDescriptionList *pList,
2856         [in] BOOL fAppendDefault);
2857
2858     HRESULT GetProperties(
2859         [in] IPropertyStore **ppStore);
2860
2861     HRESULT ApplyProperties(
2862         [in] IShellItem *psi,
2863         [in] IPropertyStore *pStore,
2864         [in, unique] HWND hwnd,
2865         [in, unique] IFileOperationProgressSink *pSink);
2866 }
2867
2868
2869 /*****************************************************************************
2870  * IFileOpenDialog interface
2871  */
2872 [
2873  object,
2874  uuid(D57C7288-D4AD-4768-BE02-9D969532D960),
2875  pointer_default(unique)
2876 ]
2877 interface IFileOpenDialog : IFileDialog
2878 {
2879     HRESULT GetResults(
2880         [out] IShellItemArray **ppenum);
2881
2882     HRESULT GetSelectedItems(
2883         [out] IShellItemArray **ppsai);
2884 }
2885
2886 typedef [v1_enum] enum CDCONTROLSTATEF
2887 {
2888     CDCS_INACTIVE       = 0x0,
2889     CDCS_ENABLED        = 0x1,
2890     CDCS_VISIBLE        = 0x2,
2891     CDCS_ENABLEDVISIBLE = 0x3
2892 } CDCONTROLSTATEF;
2893 cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(CDCONTROLSTATEF)")
2894 /*****************************************************************************
2895  * IFileDialogCustomize interface
2896  */
2897 [
2898  object,
2899  uuid(E6FDD21A-163F-4975-9C8C-A69F1BA37034),
2900  pointer_default(unique)
2901 ]
2902 interface IFileDialogCustomize : IUnknown
2903 {
2904     HRESULT EnableOpenDropDown(
2905         [in] DWORD dwIDCtl);
2906
2907     HRESULT AddMenu(
2908         [in] DWORD dwIDCtl,
2909         [in, string] LPCWSTR pszLabel);
2910
2911     HRESULT AddPushButton(
2912         [in] DWORD dwIDCtl,
2913         [in, string] LPCWSTR pszLabel);
2914
2915     HRESULT AddComboBox(
2916         [in] DWORD dwIDCtl);
2917
2918     HRESULT AddRadioButtonList(
2919         [in] DWORD dwIDCtl);
2920
2921     HRESULT AddCheckButton(
2922         [in] DWORD dwIDCtl,
2923         [in, string] LPCWSTR pszLabel,
2924         [in] BOOL bChecked);
2925
2926     HRESULT AddEditBox(
2927         [in] DWORD dwIDCtl,
2928         [in, string] LPCWSTR pszText);
2929
2930     HRESULT AddSeparator(
2931         [in] DWORD dwIDCtl);
2932
2933     HRESULT AddText(
2934         [in] DWORD dwIDCtl,
2935         [in, string] LPCWSTR pszText);
2936
2937     HRESULT SetControlLabel(
2938         [in] DWORD dwIDCtl,
2939         [in, string] LPCWSTR pszLabel);
2940
2941     HRESULT GetControlState(
2942         [in] DWORD dwIDCtl,
2943         [out] CDCONTROLSTATEF *pdwState);
2944
2945     HRESULT SetControlState(
2946         [in] DWORD dwIDCtl,
2947         [in] CDCONTROLSTATEF dwState);
2948
2949     HRESULT GetEditBoxText(
2950         [in] DWORD dwIDCtl,
2951         [out, string] WCHAR **ppszText);
2952
2953     HRESULT SetEditBoxText(
2954         [in] DWORD dwIDCtl,
2955         [in, string] LPCWSTR pszText);
2956
2957     HRESULT GetCheckButtonState(
2958         [in] DWORD dwIDCtl,
2959         [out] BOOL *pbChecked);
2960
2961     HRESULT SetCheckButtonState(
2962         [in] DWORD dwIDCtl,
2963         [in] BOOL bChecked);
2964
2965     HRESULT AddControlItem(
2966         [in] DWORD dwIDCtl,
2967         [in] DWORD dwIDItem,
2968         [in] LPCWSTR pszLabel);
2969
2970     HRESULT RemoveControlItem(
2971         [in] DWORD dwIDCtl,
2972         [in] DWORD dwIDItem);
2973
2974     HRESULT RemoveAllControlItems(
2975         [in] DWORD dwIDCtl);
2976
2977     HRESULT GetControlItemState(
2978         [in] DWORD dwIDCtl,
2979         [in] DWORD dwIDItem,
2980         [out] CDCONTROLSTATEF *pdwState);
2981
2982     HRESULT SetControlItemState(
2983         [in] DWORD dwIDCtl,
2984         [in] DWORD dwIDItem,
2985         [in] CDCONTROLSTATEF dwState);
2986
2987     HRESULT GetSelectedControlItem(
2988         [in] DWORD dwIDCtl,
2989         [out] DWORD *pdwIDItem);
2990
2991     HRESULT SetSelectedControlItem(
2992         [in] DWORD dwIDCtl,
2993         [in] DWORD dwIDItem);
2994
2995     HRESULT StartVisualGroup(
2996         [in] DWORD dwIDCtl,
2997         [in, string] LPCWSTR pszLabel);
2998
2999     HRESULT EndVisualGroup();
3000
3001     HRESULT MakeProminent(
3002         [in] DWORD dwIDCtl);
3003
3004     HRESULT SetControlItemText(
3005         [in] DWORD dwIDCtl,
3006         [in] DWORD dwIDItem,
3007         [in, string] LPCWSTR pszLabel);
3008 }
3009
3010 /*****************************************************************************
3011  * IFileDialogControlEvents interface
3012  */
3013 [
3014  object,
3015  uuid(36116642-D713-4B97-9B83-7484A9D00433),
3016  pointer_default(unique)
3017 ]
3018 interface IFileDialogControlEvents : IUnknown
3019 {
3020     HRESULT OnItemSelected(
3021         [in] IFileDialogCustomize *pfdc,
3022         [in] DWORD dwIDCtl,
3023         [in] DWORD dwIDItem);
3024
3025     HRESULT OnButtonClicked(
3026         [in] IFileDialogCustomize *pfdc,
3027         [in] DWORD dwIDCtl);
3028
3029     HRESULT OnCheckButtonToggled(
3030         [in] IFileDialogCustomize *pfdc,
3031         [in] BOOL dwIDCtl,
3032         [in] BOOL bChecked);
3033
3034     HRESULT OnControlActivating(
3035         [in] IFileDialogCustomize *pfdc,
3036         [in] DWORD dwIDCtl);
3037 }
3038
3039 typedef [v1_enum] enum tagKF_CATEGORY
3040 {
3041     KF_CATEGORY_VIRTUAL = 0x00000001,
3042     KF_CATEGORY_FIXED   = 0x00000002,
3043     KF_CATEGORY_COMMON  = 0x00000003,
3044     KF_CATEGORY_PERUSER = 0x00000004
3045 } KF_CATEGORY;
3046
3047 typedef [v1_enum] enum tagKF_REDIRECTION_CAPABILITIES
3048 {
3049     KF_REDIRECTION_CAPABILITIES_ALLOW_ALL               = 0x000000ff,
3050     KF_REDIRECTION_CAPABILITIES_REDIRECTABLE            = 0x00000001,
3051     KF_REDIRECTION_CAPABILITIES_DENY_ALL                = 0x000fff00,
3052     KF_REDIRECTION_CAPABILITIES_DENY_POLICY_REDIRECTED  = 0x00000100,
3053     KF_REDIRECTION_CAPABILITIES_DENY_POLICY             = 0x00000200,
3054     KF_REDIRECTION_CAPABILITIES_DENY_PERMISSIONS        = 0x00000400
3055 } KF_REDIRECTION_CAPABILITIES;
3056
3057 typedef [v1_enum] enum tagKF_DEFINITION_FLAGS
3058 {
3059     KFDF_LOCAL_REDIRECT_ONLY    = 0x00000002,
3060     KFDF_ROAMABLE               = 0x00000004,
3061     KFDF_PRECREATE              = 0x00000008,
3062     KFDF_STREAM                 = 0x00000010,
3063     KFDF_PUBLISHEXPANDEDPATH    = 0x00000020
3064 } KF_DEFINITION_FLAGS;
3065
3066 typedef struct tagKNOWNFOLDER_DEFINITION
3067 {
3068     KF_CATEGORY         category;
3069     LPWSTR              pszName;
3070     LPWSTR              pszDescription;
3071     KNOWNFOLDERID       fidParent;
3072     LPWSTR              pszRelativePath;
3073     LPWSTR              pszParsingName;
3074     LPWSTR              pszTooltip;
3075     LPWSTR              pszLocalizedName;
3076     LPWSTR              pszIcon;
3077     LPWSTR              pszSecurity;
3078     DWORD               dwAttributes;
3079     KF_DEFINITION_FLAGS kfdFlags;
3080     FOLDERTYPEID        ftidType;
3081 } KNOWNFOLDER_DEFINITION;
3082
3083 [
3084  object,
3085  uuid(3aa7af7e-9b36-420C-a8e3-f77d4674a488),
3086  pointer_default(ref)
3087 ]
3088 interface IKnownFolder : IUnknown
3089 {
3090     HRESULT GetId(
3091         [out] KNOWNFOLDERID *pkfid);
3092
3093     HRESULT GetCategory(
3094         [out] KF_CATEGORY *pCategory);
3095
3096     HRESULT GetShellItem(
3097         [in] DWORD dwFlags,
3098         [in] REFIID riid,
3099         [out, iid_is(riid)] void **ppv);
3100
3101     HRESULT GetPath(
3102         [in] DWORD dwFlags,
3103         [out, string] LPWSTR *ppszPath);
3104
3105     HRESULT SetPath(
3106         [in] DWORD dwFlags,
3107         [in, string] LPCWSTR pszPath);
3108
3109     HRESULT GetIDList(
3110         [in] DWORD dwFlags,
3111         [out] PIDLIST_ABSOLUTE *ppidl);
3112
3113     HRESULT GetFolderType(
3114         [out] FOLDERTYPEID *pftid);
3115
3116     HRESULT GetRedirectionCapabilities(
3117         [out] KF_REDIRECTION_CAPABILITIES *pCapabilities);
3118
3119     HRESULT GetFolderDefinition(
3120         [out] KNOWNFOLDER_DEFINITION *pKFD);
3121 }
3122
3123 typedef [v1_enum] enum tagKF_REDIRECT_FLAGS
3124 {
3125     KF_REDIRECT_USER_EXCLUSIVE      = 0x00000001,
3126     KF_REDIRECT_COPY_SOURCE_DACL    = 0x00000002,
3127     KF_REDIRECT_OWNER_USER          = 0x00000004,
3128     KF_REDIRECT_SET_OWNER_EXPLICIT  = 0x00000008,
3129     KF_REDIRECT_CHECK_ONLY          = 0x00000010,
3130     KF_REDIRECT_WITH_UI             = 0x00000020,
3131     KF_REDIRECT_UNPIN               = 0x00000040,
3132     KF_REDIRECT_PIN                 = 0x00000080,
3133     KF_REDIRECT_COPY_CONTENTS       = 0x00000200,
3134     KF_REDIRECT_DEL_SOURCE_CONTENTS = 0x00000400,
3135     KF_REDIRECT_EXCLUDE_ALL_KNOWN_SUBFOLDERS = 0x00000800
3136 } KF_REDIRECT_FLAGS;
3137
3138 [
3139     object,
3140     uuid(8BE2D872-86AA-4d47-B776-32CCA40C7018),
3141     pointer_default(ref)
3142 ]
3143 interface IKnownFolderManager : IUnknown
3144 {
3145     typedef [v1_enum] enum tagFFFP_MODE
3146     {
3147         FFFP_EXACTMATCH,
3148         FFFP_NEARESTPARENTMATCH
3149     } FFFP_MODE;
3150
3151     HRESULT FolderIdFromCsidl(
3152         [in] int nCsidl,
3153         [out] KNOWNFOLDERID *pfid);
3154
3155     HRESULT FolderIdToCsidl(
3156         [in] REFKNOWNFOLDERID rfid,
3157         [out] int *pnCsidl);
3158
3159     HRESULT GetFolderIds(
3160         [out, size_is(, *pCount)] KNOWNFOLDERID **ppKFId,
3161         [in, out] UINT *pCount);
3162
3163     HRESULT GetFolder(
3164         [in] REFKNOWNFOLDERID rfid,
3165         [out] IKnownFolder **ppkf);
3166
3167     HRESULT GetFolderByName(
3168         [in, string] LPCWSTR pszCanonicalName,
3169         [out] IKnownFolder **ppkf);
3170
3171     HRESULT RegisterFolder(
3172         [in] REFKNOWNFOLDERID rfid,
3173         [in] KNOWNFOLDER_DEFINITION const *pKFD);
3174
3175     HRESULT UnregisterFolder(
3176         [in] REFKNOWNFOLDERID rfid);
3177
3178     HRESULT FindFolderFromPath(
3179         [in, string] LPCWSTR pszPath,
3180         [in] FFFP_MODE mode,
3181         [out] IKnownFolder **ppkf);
3182
3183     HRESULT FindFolderFromIDList(
3184         [in] PCIDLIST_ABSOLUTE pidl,
3185         [out] IKnownFolder **ppkf);
3186
3187     HRESULT Redirect(
3188         [in] REFKNOWNFOLDERID rfid,
3189         [in, unique] HWND hwnd,
3190         [in] KF_REDIRECT_FLAGS flags,
3191         [in, unique, string] LPCWSTR pszTargetPath,
3192         [in] UINT cFolders,
3193         [in, size_is(cFolders), unique] KNOWNFOLDERID const *pExclusion,
3194         [out, string] LPWSTR *ppszError);
3195 }
3196
3197 /* function for releasing structure returned from IKnownFolder::GetFolderDefinition */
3198 cpp_quote("static inline void FreeKnownFolderDefinitionFields(KNOWNFOLDER_DEFINITION *pKFD)")
3199 cpp_quote("{")
3200 cpp_quote("    CoTaskMemFree(pKFD->pszName);")
3201 cpp_quote("    CoTaskMemFree(pKFD->pszDescription);")
3202 cpp_quote("    CoTaskMemFree(pKFD->pszRelativePath);")
3203 cpp_quote("    CoTaskMemFree(pKFD->pszParsingName);")
3204 cpp_quote("    CoTaskMemFree(pKFD->pszTooltip);")
3205 cpp_quote("    CoTaskMemFree(pKFD->pszLocalizedName);")
3206 cpp_quote("    CoTaskMemFree(pKFD->pszIcon);")
3207 cpp_quote("    CoTaskMemFree(pKFD->pszSecurity);")
3208 cpp_quote("}")
3209
3210 typedef [v1_enum] enum ASSOCIATIONLEVEL {
3211     AL_MACHINE,
3212     AL_EFFECTIVE,
3213     AL_USER
3214 } ASSOCIATIONLEVEL;
3215
3216 typedef [v1_enum] enum ASSOCIATIONTYPE {
3217     AT_FILEEXTENSION,
3218     AT_URLPROTOCOL,
3219     AT_STARTMENUCLIENT,
3220     AT_MIMETYPE
3221 } ASSOCIATIONTYPE;
3222
3223 [
3224     object,
3225     uuid(4e530b0a-e611-4c77-a3ac-9031d022281b),
3226     pointer_default(unique)
3227 ]
3228 interface IApplicationAssociationRegistration : IUnknown
3229 {
3230     HRESULT QueryCurrentDefault(
3231         [in, string] LPCWSTR pszQuery,
3232         [in] ASSOCIATIONTYPE atQueryType,
3233         [in] ASSOCIATIONLEVEL alQueryLevel,
3234         [out, string] LPWSTR *ppszAssociation);
3235
3236     HRESULT QueryAppIsDefault(
3237         [in, string] LPCWSTR pszQuery,
3238         [in] ASSOCIATIONTYPE atQueryType,
3239         [in] ASSOCIATIONLEVEL alQueryLevel,
3240         [in, string] LPCWSTR pszAppRegistryName,
3241         [out] BOOL *pfDefault);
3242
3243     HRESULT QueryAppIsDefaultAll(
3244         [in] ASSOCIATIONLEVEL alQueryLevel,
3245         [in, string] LPCWSTR pszAppRegistryName,
3246         [out] BOOL* pfDefault);
3247
3248     HRESULT SetAppAsDefault(
3249         [in, string] LPCWSTR pszAppRegistryName,
3250         [in, string] LPCWSTR pszSet,
3251         [in] ASSOCIATIONTYPE atSetType);
3252
3253     HRESULT SetAppAsDefaultAll(
3254         [in, string] LPCWSTR pszAppRegistryName);
3255
3256     HRESULT ClearUserAssociations();
3257 }
3258
3259 [
3260     uuid(6332debf-87b5-4670-90c0-5e57b408a49e),
3261     object,
3262     pointer_default(unique)
3263 ]
3264 interface ICustomDestinationList : IUnknown
3265 {
3266     typedef [v1_enum] enum KNOWNDESTCATEGORY {
3267         KDC_FREQUENT = 1,
3268         KDC_RECENT
3269     } KNOWNDESTCATEGORY;
3270
3271     HRESULT SetAppID([in, string] LPCWSTR pszAppID);
3272
3273     HRESULT BeginList(
3274             [out] UINT *pcMinSlots,
3275             [in] REFIID riid,
3276             [out, iid_is(riid)] void **ppv);
3277
3278     HRESULT AppendCategory(
3279             [in, string] LPCWSTR pszCategory,
3280             [in] IObjectArray *poa);
3281
3282     HRESULT AppendKnownCategory([in] KNOWNDESTCATEGORY category);
3283     HRESULT AddUserTasks([in] IObjectArray *poa);
3284     HRESULT CommitList();
3285
3286     HRESULT GetRemovedDestinations(
3287             [in] REFIID riid,
3288             [out, iid_is(riid)] void **ppv);
3289
3290     HRESULT DeleteList([in, unique, string] LPCWSTR pszAppID);
3291     HRESULT AbortList();
3292 }
3293
3294 /*****************************************************************************
3295  * ShellObjects typelibrary
3296  */
3297 [
3298  uuid(50A7E9B1-70EF-11D1-B75A-00A0C90564FE),
3299  lcid(0x0000),
3300  version(1.0)
3301 ]
3302 library ShellObjects
3303 {
3304     [
3305         uuid(71F96385-DDD6-48D3-A0C1-AE06E8B055FB)
3306     ]
3307     coclass ExplorerBrowser
3308     {
3309         interface IExplorerBrowser;
3310     }
3311
3312     [
3313         uuid(DC1C5A9C-E88A-4DDE-A5A1-60F82A20AEF7)
3314     ]
3315     coclass FileOpenDialog
3316     {
3317         interface IFileOpenDialog;
3318     }
3319
3320     [
3321         uuid(C0B4E2F3-BA21-4773-8DBA-335EC946EB8B)
3322     ]
3323     coclass FileSaveDialog
3324     {
3325         interface IFileSaveDialog;
3326     }
3327
3328     [
3329         uuid(AE054212-3535-4430-83ED-D501AA6680E6)
3330     ]
3331     coclass NamespaceTreeControl
3332     {
3333         interface INameSpaceTreeControl2;
3334     }
3335
3336     [
3337         uuid(4df0c730-df9d-4ae3-9153-aa6b82e9795a)
3338     ]
3339     coclass KnownFolderManager
3340     {
3341         interface IKnownFolderManager;
3342     }
3343
3344     [
3345         uuid(591209c7-767b-42b2-9fba-44ee4615f2c7)
3346     ]
3347     coclass ApplicationAssociationRegistration
3348     {
3349         interface IApplicationAssociationRegistration;
3350     }
3351
3352     [
3353          uuid(00021401-0000-0000-c000-000000000046)
3354     ]
3355     coclass ShellLink
3356     {
3357         interface IShellLinkW;
3358     }
3359
3360     [
3361         uuid(56fdf344-fd6d-11d0-958a-006097c9a090)
3362     ]
3363     coclass TaskbarList
3364     {
3365         interface ITaskbarList4;
3366     }
3367
3368     [
3369         uuid(77f10cf0-3db5-4966-b520-b7c54fd35ed6)
3370     ]
3371     coclass DestinationList {
3372         interface ICustomDestinationList;
3373     }
3374
3375     [
3376         uuid(2d3468c1-36a7-43b6-ac24-d3f02fd9607a)
3377     ]
3378     coclass EnumerableObjectCollection
3379     {
3380         interface IEnumObjects;
3381     }
3382 }