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