Improved drawing and placement code. Explorer style common dialogs are
[wine] / include / shlobj.h
1 #ifndef _WINE_SHLOBJ_H
2 #define _WINE_SHLOBJ_H
3
4 #include "shell.h"
5 #include "ole.h"
6 #include "ole2.h"
7 #include "compobj.h"
8 #include "storage.h"
9 #include "commctrl.h"
10 #include "interfaces.h"
11
12 #define STDMETHOD(xfn) HRESULT (CALLBACK *fn##xfn)
13 #define STDMETHOD_(type,xfn) type (CALLBACK *fn##xfn)
14 #define PURE
15 #define FAR
16 #define THIS_ THIS,
17
18
19
20 /****************************************************************************
21 *  DllGetClassObject
22 */
23 DWORD WINAPI SHELL32_DllGetClassObject(LPCLSID,REFIID,LPVOID*);
24
25
26 typedef LPVOID  LPBC; /* *IBindCtx really */
27
28 /* foreward declaration of the objects*/
29 typedef struct tagCONTEXTMENU   *LPCONTEXTMENU, IContextMenu;
30 typedef struct tagSHELLEXTINIT  *LPSHELLEXTINIT,IShellExtInit;
31 typedef struct tagENUMIDLIST    *LPENUMIDLIST,  IEnumIDList;
32 typedef struct tagSHELLFOLDER   *LPSHELLFOLDER, IShellFolder;
33 typedef struct tagSHELLVIEW     *LPSHELLVIEW,   IShellView;
34 typedef struct tagSHELLBROWSER  *LPSHELLBROWSER,IShellBrowser;
35 typedef struct tagDATAOBJECT    *LPDATAOBJECT,  IDataObject;
36 typedef struct tagSHELLICON     *LPSHELLICON,   IShellIcon;
37 typedef struct tagDOCKINGWINDOWFRAME    *LPDOCKINGWINDOWFRAME,  IDockingWindowFrame;
38 typedef struct tagSERVICEPROVIDER       *LPSERVICEPROVIDER,     IServiceProvider;
39 typedef struct tagCOMMDLGBROWSER        *LPCOMMDLGBROWSER,      ICommDlgBrowser;
40 typedef struct tagENUMFORMATETC *LPENUMFORMATETC,       IEnumFORMATETC;
41  
42 typedef struct IAdviseSink              IAdviseSink,    *LPIADVISESINK;
43 typedef struct IEnumSTATDATA            IEnumSTATDATA,  *LPENUMSTATDATA;
44 /****************************************************************************
45 *  SHELL ID
46 */
47 /* strange Objects */
48 DEFINE_SHLGUID(IID_IEnumUnknown,        0x00000100L, 0, 0);
49 DEFINE_SHLGUID(IID_IEnumString,         0x00000101L, 0, 0);
50 DEFINE_SHLGUID(IID_IEnumMoniker,        0x00000102L, 0, 0);
51 DEFINE_SHLGUID(IID_IEnumFORMATETC,      0x00000103L, 0, 0);
52 DEFINE_SHLGUID(IID_IEnumOLEVERB,        0x00000104L, 0, 0);
53 DEFINE_SHLGUID(IID_IEnumSTATDATA,       0x00000105L, 0, 0);
54
55 DEFINE_SHLGUID(IID_IPersistStream,      0x00000109L, 0, 0);
56 DEFINE_SHLGUID(IID_IPersistStorage,     0x0000010AL, 0, 0);
57 DEFINE_SHLGUID(IID_IPersistFile,        0x0000010BL, 0, 0);
58 DEFINE_SHLGUID(IID_IPersist,            0x0000010CL, 0, 0);
59 DEFINE_SHLGUID(IID_IViewObject,         0x0000010DL, 0, 0);
60 DEFINE_SHLGUID(IID_IDataObject,         0x0000010EL, 0, 0);
61
62 DEFINE_GUID (IID_IServiceProvider,      0x6D5140C1L, 0x7436, 0x11CE, 0x80, 0x34, 0x00, 0xAA, 0x00, 0x60, 0x09, 0xFA);
63 DEFINE_GUID (IID_IDockingWindow,        0x012dd920L, 0x7B26, 0x11D0, 0x8C, 0xA9, 0x00, 0xA0, 0xC9, 0x2D, 0xBF, 0xE8);
64 DEFINE_GUID (IID_IDockingWindowSite,    0x2A342FC2L, 0x7B26, 0x11D0, 0x8C, 0xA9, 0x00, 0xA0, 0xC9, 0x2D, 0xBF, 0xE8);
65 DEFINE_GUID (IID_IDockingWindowFrame,   0x47D2657AL, 0x7B27, 0x11D0, 0x8C, 0xA9, 0x00, 0xA0, 0xC9, 0x2D, 0xBF, 0xE8);
66
67 DEFINE_SHLGUID(CLSID_ShellDesktop,      0x00021400L, 0, 0);
68 DEFINE_SHLGUID(CLSID_ShellLink,         0x00021401L, 0, 0);
69 /* shell32 formatids */
70 DEFINE_SHLGUID(FMTID_Intshcut,          0x000214A0L, 0, 0);
71 DEFINE_SHLGUID(FMTID_InternetSite,      0x000214A1L, 0, 0);
72 /* command group ids */
73 DEFINE_SHLGUID(CGID_Explorer,           0x000214D0L, 0, 0);
74 DEFINE_SHLGUID(CGID_ShellDocView,       0x000214D1L, 0, 0);
75
76  /* shell32interface ids */
77 DEFINE_SHLGUID(IID_INewShortcutHookA,   0x000214E1L, 0, 0);
78 DEFINE_SHLGUID(IID_IShellBrowser,       0x000214E2L, 0, 0);
79 #define SID_SShellBrowser IID_IShellBrowser
80 DEFINE_SHLGUID(IID_IShellView,          0x000214E3L, 0, 0);
81 DEFINE_SHLGUID(IID_IContextMenu,        0x000214E4L, 0, 0);
82 DEFINE_SHLGUID(IID_IShellIcon,          0x000214E5L, 0, 0);
83 DEFINE_SHLGUID(IID_IShellFolder,        0x000214E6L, 0, 0);
84 DEFINE_SHLGUID(IID_IShellExtInit,       0x000214E8L, 0, 0);
85 DEFINE_SHLGUID(IID_IShellPropSheetExt,  0x000214E9L, 0, 0);
86 DEFINE_SHLGUID(IID_IExtractIcon,        0x000214EBL, 0, 0);
87 DEFINE_SHLGUID(IID_IShellLink,          0x000214EEL, 0, 0);
88 DEFINE_SHLGUID(IID_IShellCopyHook,      0x000214EFL, 0, 0);
89 DEFINE_SHLGUID(IID_IFileViewer,         0x000214F0L, 0, 0);
90 DEFINE_SHLGUID(IID_ICommDlgBrowser,     0x000214F1L, 0, 0);
91 DEFINE_SHLGUID(IID_IEnumIDList,         0x000214F2L, 0, 0);
92 DEFINE_SHLGUID(IID_IFileViewerSite,     0x000214F3L, 0, 0);
93 DEFINE_SHLGUID(IID_IContextMenu2,       0x000214F4L, 0, 0);
94 DEFINE_SHLGUID(IID_IShellExecuteHookA,  0x000214F5L, 0, 0);
95 DEFINE_SHLGUID(IID_IPropSheetPage,      0x000214F6L, 0, 0);
96 DEFINE_SHLGUID(IID_INewShortcutHookW,   0x000214F7L, 0, 0);
97 DEFINE_SHLGUID(IID_IFileViewerW,        0x000214F8L, 0, 0);
98 DEFINE_SHLGUID(IID_IShellLinkW,         0x000214F9L, 0, 0);
99 DEFINE_SHLGUID(IID_IExtractIconW,       0x000214FAL, 0, 0);
100 DEFINE_SHLGUID(IID_IShellExecuteHookW,  0x000214FBL, 0, 0);
101 DEFINE_SHLGUID(IID_IShellCopyHookW,     0x000214FCL, 0, 0);
102
103 /****************************************************************************
104 *  STRRET
105 */
106 #define STRRET_WSTR         0x0000
107 #define STRRET_OFFSET   0x0001
108 #define STRRET_CSTR         0x0002
109
110 typedef struct _STRRET
111 { UINT32 uType;         /* STRRET_xxx */
112   union
113   { LPWSTR      pOleStr;        /* OLESTR that will be freed */
114     UINT32      uOffset;        /* OffsetINT32o SHITEMID (ANSI) */
115     char        cStr[MAX_PATH]; /* Buffer to fill in */
116   }u;
117 } STRRET,*LPSTRRET;
118
119 /*****************************************************************************
120  * IContextMenu interface
121  */
122 #define THIS LPCONTEXTMENU this
123
124 /* default menu items*/
125 #define IDM_EXPLORE  0
126 #define IDM_OPEN     1
127 #define IDM_RENAME   2
128 #define IDM_LAST     IDM_RENAME
129
130 /* QueryContextMenu uFlags */
131 #define CMF_NORMAL              0x00000000
132 #define CMF_DEFAULTONLY         0x00000001
133 #define CMF_VERBSONLY           0x00000002
134 #define CMF_EXPLORE             0x00000004
135 #define CMF_NOVERBS             0x00000008
136 #define CMF_CANRENAME           0x00000010
137 #define CMF_NODEFAULT           0x00000020
138 #define CMF_INCLUDESTATIC       0x00000040
139 #define CMF_RESERVED            0xffff0000      // View specific
140
141 /* GetCommandString uFlags */
142 #define GCS_VERBA        0x00000000     // canonical verb
143 #define GCS_HELPTEXTA    0x00000001     // help text (for status bar)
144 #define GCS_VALIDATEA    0x00000002     // validate command exists
145 #define GCS_VERBW        0x00000004     // canonical verb (unicode)
146 #define GCS_HELPTEXTW    0x00000005     // help text (unicode version)
147 #define GCS_VALIDATEW    0x00000006     // validate command exists (unicode)
148 #define GCS_UNICODE      0x00000004     // for bit testing - Unicode string
149
150 #define GCS_VERB        GCS_VERBA
151 #define GCS_HELPTEXT    GCS_HELPTEXTA
152 #define GCS_VALIDATE    GCS_VALIDATEA
153
154 #define CMDSTR_NEWFOLDERA   "NewFolder"
155 #define CMDSTR_VIEWLISTA    "ViewList"
156 #define CMDSTR_VIEWDETAILSA "ViewDetails"
157 #define CMDSTR_NEWFOLDERW   L"NewFolder"
158 #define CMDSTR_VIEWLISTW    L"ViewList"
159 #define CMDSTR_VIEWDETAILSW L"ViewDetails"
160
161 #define CMDSTR_NEWFOLDER    CMDSTR_NEWFOLDERA
162 #define CMDSTR_VIEWLIST     CMDSTR_VIEWLISTA
163 #define CMDSTR_VIEWDETAILS  CMDSTR_VIEWDETAILSA
164
165 #define CMIC_MASK_HOTKEY        SEE_MASK_HOTKEY
166 #define CMIC_MASK_ICON          SEE_MASK_ICON
167 #define CMIC_MASK_FLAG_NO_UI    SEE_MASK_FLAG_NO_UI
168 #define CMIC_MASK_UNICODE       SEE_MASK_UNICODE
169 #define CMIC_MASK_NO_CONSOLE    SEE_MASK_NO_CONSOLE
170 #define CMIC_MASK_HASLINKNAME   SEE_MASK_HASLINKNAME
171 #define CMIC_MASK_FLAG_SEP_VDM  SEE_MASK_FLAG_SEPVDM
172 #define CMIC_MASK_HASTITLE      SEE_MASK_HASTITLE
173 #define CMIC_MASK_ASYNCOK       SEE_MASK_ASYNCOK
174
175 #define CMIC_MASK_PTINVOKE      0x20000000
176
177 /*NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor */
178 typedef struct tagCMINVOKECOMMANDINFO 
179 {   DWORD cbSize;        // sizeof(CMINVOKECOMMANDINFO)
180     DWORD fMask;         // any combination of CMIC_MASK_*
181     HWND32 hwnd;         // might be NULL (indicating no owner window)
182     LPCSTR lpVerb;       // either a string or MAKEINTRESOURCE(idOffset)
183     LPCSTR lpParameters; // might be NULL (indicating no parameter)
184     LPCSTR lpDirectory;  // might be NULL (indicating no specific directory)
185    INT32 nShow;           // one of SW_ values for ShowWindow() API
186
187     DWORD dwHotKey;
188     HANDLE32 hIcon;
189 } CMINVOKECOMMANDINFO32,  *LPCMINVOKECOMMANDINFO32;
190
191 typedef struct tagCMInvokeCommandInfoEx 
192 {   DWORD cbSize;        // must be sizeof(CMINVOKECOMMANDINFOEX)
193     DWORD fMask;         // any combination of CMIC_MASK_*
194     HWND32 hwnd;         // might be NULL (indicating no owner window)
195     LPCSTR lpVerb;       // either a string or MAKEINTRESOURCE(idOffset)
196     LPCSTR lpParameters; // might be NULL (indicating no parameter)
197     LPCSTR lpDirectory;  // might be NULL (indicating no specific directory)
198         INT32 nShow;           // one of SW_ values for ShowWindow() API
199
200     DWORD dwHotKey;
201     
202     HANDLE32 hIcon;
203     LPCSTR lpTitle;        // For CreateProcess-StartupInfo.lpTitle
204     LPCWSTR lpVerbW;       // Unicode verb (for those who can use it)
205     LPCWSTR lpParametersW; // Unicode parameters (for those who can use it)
206     LPCWSTR lpDirectoryW;  // Unicode directory (for those who can use it)
207     LPCWSTR lpTitleW;      // Unicode title (for those who can use it)
208     POINT32 ptInvoke;      // Point where it's invoked
209
210 } CMINVOKECOMMANDINFOEX32,  *LPCMINVOKECOMMANDINFOEX32;
211
212
213 typedef struct IContextMenu_VTable
214 {   // *** IUnknown methods ***
215     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
216     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
217     STDMETHOD_(ULONG,Release) (THIS) PURE;
218
219     STDMETHOD(QueryContextMenu)(THIS_ HMENU32 hmenu,UINT32 indexMenu,UINT32 idCmdFirst, UINT32 idCmdLast,UINT32 uFlags) PURE;
220     STDMETHOD(InvokeCommand)(THIS_ LPCMINVOKECOMMANDINFO32 lpici) PURE;
221     STDMETHOD(GetCommandString)(THIS_ UINT32 idCmd,UINT32 uType,UINT32 * pwReserved,LPSTR pszName,UINT32 cchMax) PURE;
222
223     /* undocumented not only in ContextMenu2 */
224     STDMETHOD(HandleMenuMsg)(THIS_  UINT32 uMsg,WPARAM32 wParam,LPARAM lParam) PURE;
225
226     /* possibly another nasty entry from ContextMenu3 ?*/    
227     void * guard;
228 } IContextMenu_VTable,*LPCONTEXTMENU_VTABLE;
229
230 struct tagCONTEXTMENU
231 { LPCONTEXTMENU_VTABLE  lpvtbl;
232   DWORD                 ref;
233   LPSHELLFOLDER pSFParent;
234   LPITEMIDLIST  *aPidls;
235   BOOL32                bAllValues;
236 };
237
238 #undef THIS
239 /*****************************************************************************
240  * IData structures
241  */
242 typedef struct
243 {       DWORD tdSize;
244         WORD tdDriverNameOffset;
245         WORD tdDeviceNameOffset;
246         WORD tdPortNameOffset;
247         WORD tdExtDevmodeOffset;
248         BYTE tdData[ 1 ];
249 }   DVTARGETDEVICE32;
250
251 typedef WORD CLIPFORMAT32, *LPCLIPFORMAT32;
252
253 typedef struct 
254 {       DWORD tymed;
255         union 
256         { HBITMAP32 hBitmap;
257           /*HMETAFILEPICT32 hMetaFilePict;*/
258           /*HENHMETAFILE32 hEnhMetaFile;*/
259           HGLOBAL32 hGlobal;
260           LPOLESTR32 lpszFileName;
261           IStream32 *pstm;
262           IStorage32 *pstg;
263         } u;
264         IUnknown *pUnkForRelease;
265 } STGMEDIUM32;   
266  
267 typedef struct 
268 {       CLIPFORMAT32 cfFormat;
269         DVTARGETDEVICE32 *ptd;
270         DWORD dwAspect;
271         LONG lindex;
272         DWORD tymed;
273 } FORMATETC32, *LPFORMATETC32;
274
275 /*****************************************************************************
276  * IEnumFORMATETC interface
277  */
278 #define THIS LPENUMFORMATETC this
279
280 typedef struct IEnumFORMATETC_VTable 
281 {    /* IUnknown methods */
282         STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
283         STDMETHOD_(ULONG,AddRef) (THIS) PURE;
284         STDMETHOD_(ULONG,Release) (THIS) PURE;
285
286         /* IEnumFORMATETC methods */
287         STDMETHOD (Next)(THIS_ ULONG celt, FORMATETC32 *rgelt, ULONG *pceltFethed) PURE;
288         STDMETHOD (Skip)(THIS_ ULONG celt) PURE;
289         STDMETHOD (Reset)(THIS) PURE;
290         STDMETHOD (Clone)(THIS_ IEnumFORMATETC ** ppenum) PURE;
291 } IEnumFORMATETC_VTable,*LPENUMFORMATETC_VTABLE;
292
293 struct tagENUMFORMATETC
294 {       LPENUMFORMATETC_VTABLE  lpvtbl;
295         DWORD                    ref;
296         UINT32  posFmt;
297         UINT32  countFmt;
298         LPFORMATETC32 pFmt;
299 };
300
301 #undef THIS
302
303 /*****************************************************************************
304  * IDataObject interface
305  */
306 #define THIS LPDATAOBJECT this
307
308 typedef struct IDataObject_VTable 
309 {       /*** IUnknown methods ***/
310         STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
311         STDMETHOD_(ULONG,AddRef) (THIS) PURE;
312         STDMETHOD_(ULONG,Release) (THIS) PURE;
313
314         STDMETHOD (GetData )(THIS_ LPFORMATETC32 pformatetcIn, STGMEDIUM32 *pmedium) PURE;
315         STDMETHOD (GetDataHere)(THIS_ LPFORMATETC32 pformatetc, STGMEDIUM32 *pmedium) PURE;
316         STDMETHOD (QueryGetData)(THIS_ LPFORMATETC32 pformatetc) PURE;
317         STDMETHOD (GetCanonicalFormatEtc)(THIS_ LPFORMATETC32 pformatectIn, LPFORMATETC32 pformatetcOut) PURE;
318         STDMETHOD (SetData)(THIS_ LPFORMATETC32 pformatetc, STGMEDIUM32 *pmedium, BOOL32 fRelease) PURE;
319         STDMETHOD (EnumFormatEtc)(THIS_ DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc) PURE;
320         STDMETHOD (DAdvise )(THIS_ LPFORMATETC32 *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection) PURE;
321         STDMETHOD (DUnadvise)(THIS_ DWORD dwConnection) PURE;
322         STDMETHOD (EnumDAdvise)(THIS_ IEnumSTATDATA **ppenumAdvise) PURE;
323 } IDataObject_VTable,*LPDATAOBJECT_VTABLE;
324
325 struct tagDATAOBJECT
326 {       LPDATAOBJECT_VTABLE     lpvtbl;
327         DWORD                    ref;
328 };
329
330 #undef THIS
331
332
333 /*****************************************************************************
334  * IShellExtInit interface
335  */
336 #define THIS LPSHELLEXTINIT this
337
338 typedef struct IShellExtInit_VTable 
339 {   // *** IUnknown methods ***
340     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
341     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
342     STDMETHOD_(ULONG,Release) (THIS) PURE;
343
344     // *** IShellExtInit methods ***
345     STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY hkeyProgID) PURE;
346 } IShellExtInit_VTable,*LPSHELLEXTINIT_VTABLE;
347
348 struct tagSHELLEXTINIT
349 { LPSHELLEXTINIT_VTABLE lpvtbl;
350   DWORD                  ref;
351 };
352
353 #undef THIS
354
355 /*****************************************************************************
356  * IEnumIDList interface
357  */
358 #define THIS LPENUMIDLIST this
359
360 typedef struct tagENUMLIST
361 { struct tagENUMLIST    *pNext;
362   LPITEMIDLIST pidl;
363 } ENUMLIST, *LPENUMLIST;
364
365 typedef struct IEnumIDList_VTable 
366 {    /* *** IUnknown methods *** */
367     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
368     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
369     STDMETHOD_(ULONG,Release) (THIS) PURE;
370
371     /* *** IEnumIDList methods *** */
372     STDMETHOD(Next)  (THIS_ ULONG celt,
373                       LPITEMIDLIST *rgelt,
374                       ULONG *pceltFetched) PURE;
375     STDMETHOD(Skip)  (THIS_ ULONG celt) PURE;
376     STDMETHOD(Reset) (THIS) PURE;
377     STDMETHOD(Clone) (THIS_ IEnumIDList **ppenum) PURE;
378                 /* *** private methods *** */
379     STDMETHOD_(BOOL32,CreateEnumList)(THIS_ LPCSTR, DWORD) PURE;
380     STDMETHOD_(BOOL32,AddToEnumList)(THIS_ LPITEMIDLIST) PURE;
381     STDMETHOD_(BOOL32,DeleteList)(THIS) PURE;
382
383                 
384 } IEnumIDList_VTable,*LPENUMIDLIST_VTABLE;
385
386 struct tagENUMIDLIST
387 { LPENUMIDLIST_VTABLE   lpvtbl;
388   DWORD          ref;
389   LPENUMLIST mpFirst;
390   LPENUMLIST mpLast;
391   LPENUMLIST mpCurrent;
392 };
393
394 #undef THIS
395 //--------------------------------------------------------------------------
396 //
397 // FOLDERSETTINGS
398 //
399 //  FOLDERSETTINGS is a data structure that explorer passes from one folder
400 // view to another, when the user is browsing. It calls ISV::GetCurrentInfo
401 // member to get the current settings and pass it to ISV::CreateViewWindow
402 // to allow the next folder view "inherit" it. These settings assumes a
403 // particular UI (which the shell's folder view has), and shell extensions
404 // may or may not use those settings.
405 //
406 //--------------------------------------------------------------------------
407
408 typedef LPBYTE LPVIEWSETTINGS;
409
410 // NB Bitfields.
411 // FWF_DESKTOP implies FWF_TRANSPARENT/NOCLIENTEDGE/NOSCROLL
412 typedef enum
413 { FWF_AUTOARRANGE =       0x0001,
414   FWF_ABBREVIATEDNAMES =  0x0002,
415   FWF_SNAPTOGRID =        0x0004,
416   FWF_OWNERDATA =         0x0008,
417   FWF_BESTFITWINDOW =     0x0010,
418   FWF_DESKTOP =           0x0020,
419   FWF_SINGLESEL =         0x0040,
420   FWF_NOSUBFOLDERS =      0x0080,
421   FWF_TRANSPARENT  =      0x0100,
422   FWF_NOCLIENTEDGE =      0x0200,
423   FWF_NOSCROLL     =      0x0400,
424   FWF_ALIGNLEFT    =      0x0800,
425   FWF_SINGLECLICKACTIVATE=0x8000  // TEMPORARY -- NO UI FOR THIS
426 } FOLDERFLAGS;
427
428 typedef enum
429 { FVM_ICON =              1,
430   FVM_SMALLICON =         2,
431   FVM_LIST =              3,
432   FVM_DETAILS =           4,
433 } FOLDERVIEWMODE;
434
435 typedef struct
436 { UINT32 ViewMode;       // View mode (FOLDERVIEWMODE values)
437   UINT32 fFlags;         // View options (FOLDERFLAGS bits)
438 } FOLDERSETTINGS, *LPFOLDERSETTINGS;
439
440 typedef const FOLDERSETTINGS * LPCFOLDERSETTINGS;
441
442 /* FIXME; the next two lines are propersheet related, move to prsht.h when created */
443 struct _PSP;
444 typedef struct _PSP FAR* HPROPSHEETPAGE;
445
446 typedef BOOL32 (CALLBACK FAR * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM);
447 typedef BOOL32 (CALLBACK FAR * LPFNADDPROPSHEETPAGES)(LPVOID, LPFNADDPROPSHEETPAGE,LPARAM);
448
449 /************************************************************************
450  * IShellFolder interface
451  */
452
453 #define THIS LPSHELLFOLDER this
454
455 /* IShellFolder::GetDisplayNameOf/SetNameOf uFlags */
456 typedef enum
457 { SHGDN_NORMAL            = 0,        /* default (display purpose) */
458   SHGDN_INFOLDER          = 1,        /* displayed under a folder (relative)*/
459   SHGDN_FORPARSING        = 0x8000    /* for ParseDisplayName or path */
460 } SHGNO;
461
462 /* IShellFolder::EnumObjects */
463 typedef enum tagSHCONTF
464 { SHCONTF_FOLDERS         = 32,       /* for shell browser */
465   SHCONTF_NONFOLDERS      = 64,       /* for default view */
466   SHCONTF_INCLUDEHIDDEN   = 128       /* for hidden/system objects */
467 } SHCONTF;
468
469 /* from oleidl.h */
470 #define DROPEFFECT_NONE         0
471 #define DROPEFFECT_COPY         1
472 #define DROPEFFECT_MOVE         2
473 #define DROPEFFECT_LINK         4
474 #define DROPEFFECT_SCROLL       0x80000000
475
476 /* IShellFolder::GetAttributesOf flags */
477 #define SFGAO_CANCOPY           DROPEFFECT_COPY /* Objects can be copied */
478 #define SFGAO_CANMOVE           DROPEFFECT_MOVE /* Objects can be moved */
479 #define SFGAO_CANLINK           DROPEFFECT_LINK /* Objects can be linked */
480 #define SFGAO_CANRENAME         0x00000010L     /* Objects can be renamed */
481 #define SFGAO_CANDELETE         0x00000020L     /* Objects can be deleted */
482 #define SFGAO_HASPROPSHEET      0x00000040L     /* Objects have property sheets */
483 #define SFGAO_DROPTARGET        0x00000100L     /* Objects are drop target */
484 #define SFGAO_CAPABILITYMASK    0x00000177L
485 #define SFGAO_LINK              0x00010000L     /* Shortcut (link) */
486 #define SFGAO_SHARE             0x00020000L     /* shared */
487 #define SFGAO_READONLY          0x00040000L     /* read-only */
488 #define SFGAO_GHOSTED           0x00080000L     /* ghosted icon */
489 #define SFGAO_DISPLAYATTRMASK   0x000F0000L
490 #define SFGAO_FILESYSANCESTOR   0x10000000L     /* It contains file system folder */
491 #define SFGAO_FOLDER            0x20000000L     /* It's a folder. */
492 #define SFGAO_FILESYSTEM        0x40000000L     /* is a file system thing (file/folder/root) */
493 #define SFGAO_HASSUBFOLDER      0x80000000L     /* Expandable in the map pane */
494 #define SFGAO_CONTENTSMASK      0x80000000L
495 #define SFGAO_VALIDATE          0x01000000L     /* invalidate cached information */
496 #define SFGAO_REMOVABLE        0x02000000L      /* is this removeable media? */
497
498 typedef struct IShellFolder_VTable {
499     /* *** IUnknown methods *** */
500     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
501     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
502     STDMETHOD_(ULONG,Release) (THIS) PURE;
503
504     /* *** IShellFolder methods *** */
505     STDMETHOD(ParseDisplayName) (THIS_ HWND32 hwndOwner,LPBC pbcReserved, LPOLESTR32 lpszDisplayName,ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
506     STDMETHOD(EnumObjects)( THIS_ HWND32 hwndOwner, DWORD grfFlags, LPENUMIDLIST * ppenumIDList) PURE;
507     STDMETHOD(BindToObject)(THIS_ LPCITEMIDLIST pidl, LPBC pbcReserved,REFIID riid, LPVOID * ppvOut) PURE;
508     STDMETHOD(BindToStorage)(THIS_ LPCITEMIDLIST pidl, LPBC pbcReserved,REFIID riid, LPVOID * ppvObj) PURE;
509     STDMETHOD(CompareIDs)(THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
510     STDMETHOD(CreateViewObject)(THIS_ HWND32 hwndOwner, REFIID riid, LPVOID * ppvOut) PURE;
511     STDMETHOD(GetAttributesOf)(THIS_ UINT32 cidl, LPCITEMIDLIST * apidl,ULONG * rgfInOut) PURE;
512     STDMETHOD(GetUIObjectOf)(THIS_ HWND32 hwndOwner, UINT32 cidl, LPCITEMIDLIST * apidl,REFIID riid, UINT32 * prgfInOut, LPVOID * ppvOut) PURE;
513     STDMETHOD(GetDisplayNameOf)(THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
514     STDMETHOD(SetNameOf)(THIS_ HWND32 hwndOwner, LPCITEMIDLIST pidl,LPCOLESTR32 lpszName, DWORD uFlags,LPITEMIDLIST * ppidlOut) PURE;
515
516         /* utility functions */
517    STDMETHOD_(BOOL32,GetFolderPath)(THIS_ LPSTR, DWORD);
518    
519 } *LPSHELLFOLDER_VTABLE,IShellFolder_VTable;
520
521 struct tagSHELLFOLDER {
522         LPSHELLFOLDER_VTABLE    lpvtbl;
523         DWORD                   ref;
524         LPSTR                   mlpszFolder;
525         LPITEMIDLIST    mpidl;
526         LPITEMIDLIST    mpidlNSRoot;
527         LPSHELLFOLDER   mpSFParent;
528 };
529
530 extern LPSHELLFOLDER pdesktopfolder;
531
532 /************************
533 * Shellfolder API
534 */
535 DWORD WINAPI SHGetDesktopFolder(LPSHELLFOLDER *);
536 #undef THIS
537
538 /************************************************************************
539 * IShellBrowser interface
540 */
541 #define THIS LPSHELLBROWSER this
542 /* targets for GetWindow/SendControlMsg */
543 #define FCW_STATUS              0x0001
544 #define FCW_TOOLBAR             0x0002
545 #define FCW_TREE                0x0003
546 #define FCW_INTERNETBAR         0x0006
547 #define FCW_PROGRESS            0x0008
548
549 /* wFlags for BrowseObject*/
550 #define SBSP_DEFBROWSER         0x0000
551 #define SBSP_SAMEBROWSER        0x0001
552 #define SBSP_NEWBROWSER         0x0002
553
554 #define SBSP_DEFMODE            0x0000
555 #define SBSP_OPENMODE           0x0010
556 #define SBSP_EXPLOREMODE        0x0020
557
558 #define SBSP_ABSOLUTE           0x0000
559 #define SBSP_RELATIVE           0x1000
560 #define SBSP_PARENT             0x2000
561 #define SBSP_NAVIGATEBACK       0x4000
562 #define SBSP_NAVIGATEFORWARD    0x8000
563
564 #define SBSP_ALLOW_AUTONAVIGATE         0x10000
565
566 #define SBSP_INITIATEDBYHLINKFRAME      0x80000000
567 #define SBSP_REDIRECT                   0x40000000
568 #define SBSP_WRITENOHISTORY             0x08000000
569
570 /* uFlage for SetToolbarItems */
571 #define FCT_MERGE       0x0001
572 #define FCT_CONFIGABLE  0x0002
573 #define FCT_ADDTOEND    0x0004
574  
575 typedef struct IShellBrowser_VTable 
576 {    // *** IUnknown methods ***
577     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
578     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
579     STDMETHOD_(ULONG,Release) (THIS) PURE;
580
581     // *** IOleWindow methods ***
582     STDMETHOD(GetWindow) (THIS_ HWND32 * lphwnd) PURE;
583     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL32 fEnterMode) PURE;
584
585     // *** IShellBrowser methods *** (same as IOleInPlaceFrame)
586     STDMETHOD(InsertMenusSB) (THIS_ HMENU32 hmenuShared, LPOLEMENUGROUPWIDTHS32 lpMenuWidths) PURE;
587     STDMETHOD(SetMenuSB) (THIS_ HMENU32 hmenuShared, HOLEMENU32 holemenuReserved, HWND32 hwndActiveObject) PURE;
588     STDMETHOD(RemoveMenusSB) (THIS_ HMENU32 hmenuShared) PURE;
589     STDMETHOD(SetStatusTextSB) (THIS_ LPCOLESTR32 lpszStatusText) PURE;
590     STDMETHOD(EnableModelessSB) (THIS_ BOOL32 fEnable) PURE;
591     STDMETHOD(TranslateAcceleratorSB) (THIS_ LPMSG32 lpmsg, WORD wID) PURE;
592
593     // *** IShellBrowser methods ***
594     STDMETHOD(BrowseObject)(THIS_ LPCITEMIDLIST pidl, UINT32 wFlags) PURE;
595     STDMETHOD(GetViewStateStream)(THIS_ DWORD grfMode, LPSTREAM32  *ppStrm) PURE;
596     STDMETHOD(GetControlWindow)(THIS_ UINT32 id, HWND32 * lphwnd) PURE;
597     STDMETHOD(SendControlMsg)(THIS_ UINT32 id, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam, LRESULT * pret) PURE;
598     STDMETHOD(QueryActiveShellView)(THIS_ IShellView ** ppshv) PURE;
599     STDMETHOD(OnViewWindowActive)(THIS_ IShellView * ppshv) PURE;
600     STDMETHOD(SetToolbarItems)(THIS_ LPTBBUTTON lpButtons, UINT32 nButtons, UINT32 uFlags) PURE;
601 } *LPSHELLBROWSER_VTABLE,IShellBrowser_VTable;;
602
603 struct tagSHELLBROWSER 
604 { LPSHELLBROWSER_VTABLE lpvtbl;
605   DWORD ref;
606 };
607
608 #undef THIS
609
610 /************************************************************************
611 * IShellView interface
612 */
613 #define THIS LPSHELLVIEW this
614
615 /* shellview select item flags*/
616 #define SVSI_DESELECT   0x0000
617 #define SVSI_SELECT     0x0001
618 #define SVSI_EDIT       0x0003  // includes select
619 #define SVSI_DESELECTOTHERS 0x0004
620 #define SVSI_ENSUREVISIBLE  0x0008
621 #define SVSI_FOCUSED        0x0010
622
623 /* shellview get item object flags */
624 #define SVGIO_BACKGROUND    0x00000000
625 #define SVGIO_SELECTION     0x00000001
626 #define SVGIO_ALLVIEW       0x00000002
627
628 /* The explorer dispatches WM_COMMAND messages based on the range of
629  command/menuitem IDs. All the IDs of menuitems that the view (right
630  pane) inserts must be in FCIDM_SHVIEWFIRST/LAST (otherwise, the explorer
631  won't dispatch them). The view should not deal with any menuitems
632  in FCIDM_BROWSERFIRST/LAST (otherwise, it won't work with the future
633  version of the shell).
634
635   FCIDM_SHVIEWFIRST/LAST      for the right pane (IShellView)
636   FCIDM_BROWSERFIRST/LAST     for the explorer frame (IShellBrowser)
637   FCIDM_GLOBAL/LAST           for the explorer's submenu IDs
638 */
639 #define FCIDM_SHVIEWFIRST           0x0000
640 #define FCIDM_SHVIEWLAST            0x7fff
641 #define FCIDM_BROWSERFIRST          0xa000
642 #define FCIDM_BROWSERLAST           0xbf00
643 #define FCIDM_GLOBALFIRST           0x8000
644 #define FCIDM_GLOBALLAST            0x9fff
645
646 /*
647 * Global submenu IDs and separator IDs
648 */
649 #define FCIDM_MENU_FILE             (FCIDM_GLOBALFIRST+0x0000)
650 #define FCIDM_MENU_EDIT             (FCIDM_GLOBALFIRST+0x0040)
651 #define FCIDM_MENU_VIEW             (FCIDM_GLOBALFIRST+0x0080)
652 #define FCIDM_MENU_VIEW_SEP_OPTIONS (FCIDM_GLOBALFIRST+0x0081)
653 #define FCIDM_MENU_TOOLS            (FCIDM_GLOBALFIRST+0x00c0)
654 #define FCIDM_MENU_TOOLS_SEP_GOTO   (FCIDM_GLOBALFIRST+0x00c1)
655 #define FCIDM_MENU_HELP             (FCIDM_GLOBALFIRST+0x0100)
656 #define FCIDM_MENU_FIND             (FCIDM_GLOBALFIRST+0x0140)
657 #define FCIDM_MENU_EXPLORE          (FCIDM_GLOBALFIRST+0x0150)
658 #define FCIDM_MENU_FAVORITES        (FCIDM_GLOBALFIRST+0x0170)
659
660 /* control IDs known to the view */
661 #define FCIDM_TOOLBAR      (FCIDM_BROWSERFIRST + 0)
662 #define FCIDM_STATUS       (FCIDM_BROWSERFIRST + 1)
663
664 /* uState values for IShellView::UIActivate */
665 typedef enum 
666 { SVUIA_DEACTIVATE       = 0,
667   SVUIA_ACTIVATE_NOFOCUS = 1,
668   SVUIA_ACTIVATE_FOCUS   = 2,
669   SVUIA_INPLACEACTIVATE  = 3          // new flag for IShellView2
670 } SVUIA_STATUS;
671
672
673
674 typedef struct IShellView_VTable
675 {   // *** IUnknown methods ***
676     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
677     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
678     STDMETHOD_(ULONG,Release) (THIS) PURE;
679
680     // *** IOleWindow methods ***
681     STDMETHOD(GetWindow) (THIS_ HWND32 * lphwnd) PURE;
682     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL32 fEnterMode) PURE;
683
684     // *** IShellView methods ***
685     STDMETHOD(TranslateAccelerator) (THIS_ LPMSG32 lpmsg) PURE;
686     STDMETHOD(EnableModeless) (THIS_ BOOL32 fEnable) PURE;
687     STDMETHOD(UIActivate) (THIS_ UINT32 uState) PURE;
688     STDMETHOD(Refresh) (THIS) PURE;
689     STDMETHOD(CreateViewWindow)(THIS_ IShellView *lpPrevView,LPCFOLDERSETTINGS lpfs, IShellBrowser * psb,RECT32 * prcView, HWND32  *phWnd) PURE;
690     STDMETHOD(DestroyViewWindow)(THIS) PURE;
691     STDMETHOD(GetCurrentInfo)(THIS_ LPFOLDERSETTINGS lpfs) PURE;
692     STDMETHOD(AddPropertySheetPages)(THIS_ DWORD dwReserved,LPFNADDPROPSHEETPAGE lpfn, LPARAM lparam) PURE;
693     STDMETHOD(SaveViewState)(THIS) PURE;
694     STDMETHOD(SelectItem)(THIS_ LPCITEMIDLIST pidlItem, UINT32 uFlags) PURE;
695     STDMETHOD(GetItemObject)(THIS_ UINT32 uItem, REFIID riid,LPVOID *ppv) PURE;
696 } IShellView_VTable,*LPSHELLVIEW_VTABLE;
697
698 struct tagSHELLVIEW 
699 { LPSHELLVIEW_VTABLE lpvtbl;
700   DWORD                      ref;
701   LPITEMIDLIST       mpidl;
702   LPSHELLFOLDER      pSFParent;
703   LPSHELLBROWSER     pShellBrowser;
704   LPCOMMDLGBROWSER   pCommDlgBrowser;
705   HWND32             hWnd;
706   HWND32             hWndList;
707   FOLDERSETTINGS     FolderSettings;
708   HWND32             hWndParent;
709   HMENU32            hMenu;
710   UINT32                         uState;
711 };
712
713 typedef GUID SHELLVIEWID;
714 #define SV_CLASS_NAME   ("SHELLDLL_DefView")
715
716 #undef THIS
717 /****************************************************************************
718  * ICommDlgBrowser interface
719  */
720 #define THIS LPCOMMDLGBROWSER this
721
722 /* for OnStateChange*/
723 #define CDBOSC_SETFOCUS     0x00000000
724 #define CDBOSC_KILLFOCUS    0x00000001
725 #define CDBOSC_SELCHANGE    0x00000002
726 #define CDBOSC_RENAME       0x00000003
727
728 typedef struct ICommDlgBrowser_VTable
729 {   /* IUnknown methods */
730     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
731     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
732     STDMETHOD_(ULONG,Release) (THIS) PURE;
733
734     /* ICommDlgBrowser methods */
735     STDMETHOD(OnDefaultCommand) (THIS_  LPSHELLVIEW ppshv) PURE;
736     STDMETHOD(OnStateChange) (THIS_ LPSHELLVIEW ppshv, ULONG uChange) PURE;
737     STDMETHOD(IncludeObject) (THIS_ LPSHELLVIEW ppshv, LPCITEMIDLIST pidl) PURE;
738 } ICommDlgBrowser_VTable,*LPCOMMDLGBROWSER_VTABLE;
739
740 struct tagCOMMDLGBROWSER
741 { LPCOMMDLGBROWSER_VTABLE lpvtbl;
742   DWORD                      ref;
743 };
744 #undef THIS
745 /****************************************************************************
746  * IShellLink interface
747  */
748
749 #define THIS LPSHELLLINK this
750 /* IShellLink::Resolve fFlags */
751 typedef enum {
752     SLR_NO_UI           = 0x0001,
753     SLR_ANY_MATCH       = 0x0002,
754     SLR_UPDATE          = 0x0004
755 } SLR_FLAGS;
756
757 /* IShellLink::GetPath fFlags */
758 typedef enum {
759     SLGP_SHORTPATH      = 0x0001,
760     SLGP_UNCPRIORITY    = 0x0002
761 } SLGP_FLAGS;
762
763
764
765 typedef struct IShellLink IShellLink,*LPSHELLLINK;
766 typedef struct IShellLink_VTable
767 {
768     /* *** IUnknown methods *** */
769     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
770     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
771     STDMETHOD_(ULONG,Release) (THIS) PURE;
772
773     STDMETHOD(GetPath)(THIS_ LPSTR pszFile,INT32 cchMaxPath, WIN32_FIND_DATA32A *pfd, DWORD fFlags) PURE;
774
775     STDMETHOD(GetIDList)(THIS_ LPITEMIDLIST * ppidl) PURE;
776     STDMETHOD(SetIDList)(THIS_ LPCITEMIDLIST pidl) PURE;
777
778     STDMETHOD(GetDescription)(THIS_ LPSTR pszName,INT32 cchMaxName) PURE;
779     STDMETHOD(SetDescription)(THIS_ LPCSTR pszName) PURE;
780
781     STDMETHOD(GetWorkingDirectory)(THIS_ LPSTR pszDir,INT32 cchMaxPath) PURE;
782     STDMETHOD(SetWorkingDirectory)(THIS_ LPCSTR pszDir) PURE;
783
784     STDMETHOD(GetArguments)(THIS_ LPSTR pszArgs,INT32 cchMaxPath) PURE;
785     STDMETHOD(SetArguments)(THIS_ LPCSTR pszArgs) PURE;
786
787     STDMETHOD(GetHotkey)(THIS_ WORD *pwHotkey) PURE;
788     STDMETHOD(SetHotkey)(THIS_ WORD wHotkey) PURE;
789
790     STDMETHOD(GetShowCmd)(THIS_ INT32 *piShowCmd) PURE;
791     STDMETHOD(SetShowCmd)(THIS_ INT32 iShowCmd) PURE;
792
793     STDMETHOD(GetIconLocation)(THIS_ LPSTR pszIconPath,INT32 cchIconPath,INT32 *piIcon) PURE;
794     STDMETHOD(SetIconLocation)(THIS_ LPCSTR pszIconPath,INT32 iIcon) PURE;
795
796     STDMETHOD(SetRelativePath)(THIS_ LPCSTR pszPathRel, DWORD dwReserved) PURE;
797
798     STDMETHOD(Resolve)(THIS_ HWND32 hwnd, DWORD fFlags) PURE;
799
800     STDMETHOD(SetPath)(THIS_ LPCSTR pszFile) PURE;
801 } IShellLink_VTable,*LPSHELLLINK_VTABLE;
802
803 struct IShellLink {
804         LPSHELLLINK_VTABLE      lpvtbl;
805         DWORD                   ref;
806 };
807
808 #undef THIS
809
810 /****************************************************************************
811  * IExtractIconinterface
812  *
813  * FIXME
814  *  Is the ExtractIconA interface
815  */
816 #define THIS LPEXTRACTICON this
817
818 /* GetIconLocation() input flags*/
819 #define GIL_OPENICON     0x0001      // allows containers to specify an "open" look
820 #define GIL_FORSHELL     0x0002      // icon is to be displayed in a ShellFolder
821 #define GIL_ASYNC        0x0020      // this is an async extract, return E_ASYNC
822
823 /* GetIconLocation() return flags */
824 #define GIL_SIMULATEDOC  0x0001      // simulate this document icon for this
825 #define GIL_PERINSTANCE  0x0002      // icons from this class are per instance (each file has its own)
826 #define GIL_PERCLASS     0x0004      // icons from this class per class (shared for all files of this type)
827 #define GIL_NOTFILENAME  0x0008      // location is not a filename, must call ::ExtractIcon
828 #define GIL_DONTCACHE    0x0010      // this icon should not be cached
829
830 typedef struct IExtractIcon IExtractIcon,*LPEXTRACTICON;
831 typedef struct IExtractIcon_VTable
832 { /*** IUnknown methods ***/
833   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
834   STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
835   STDMETHOD_(ULONG,Release) (THIS) PURE;
836
837   /*** IExtractIcon methods ***/
838   STDMETHOD(GetIconLocation)(THIS_ UINT32 uFlags, LPSTR szIconFile, UINT32 cchMax,INT32 * piIndex, UINT32 * pwFlags) PURE;
839   STDMETHOD(Extract)(THIS_ LPCSTR pszFile, UINT32 nIconIndex, HICON32 *phiconLarge, HICON32 *phiconSmall, UINT32 nIconSize) PURE;
840 }IExtractIccon_VTable,*LPEXTRACTICON_VTABLE;
841
842 struct IExtractIcon 
843 { LPEXTRACTICON_VTABLE lpvtbl;
844   DWORD ref;
845   LPITEMIDLIST pidl;
846 };
847
848 #undef THIS
849 /****************************************************************************
850  * IShellIcon interface
851  */
852
853 #define THIS LPSHELLICON this
854
855 typedef struct IShellIcon_VTable
856 { /*** IUnknown methods ***/
857   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
858   STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
859   STDMETHOD_(ULONG,Release) (THIS) PURE;
860
861   /*** IShellIcon methods ***/
862   STDMETHOD(GetIconOf)(THIS_ LPCITEMIDLIST pidl, UINT32 flags, LPINT32 lpIconIndex) PURE;
863 } IShellIcon_VTable,*LPSHELLICON_VTABLE;
864
865 struct tagSHELLICON
866 { LPSHELLICON_VTABLE lpvtbl;
867   DWORD ref;
868 };
869 #undef THIS
870 /****************************************************************************
871  * IDockingWindowFrame interface
872  */
873 #define THIS LPDOCKINGWINDOWFRAME this
874
875 #define DWFRF_NORMAL            0x0000  /* femove toolbar flags*/
876 #define DWFRF_DELETECONFIGDATA  0x0001
877 #define DWFAF_HIDDEN            0x0001   /* add tolbar*/
878
879 typedef struct IDockingWindowFrame_VTable
880 {   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
881     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
882     STDMETHOD_(ULONG,Release) (THIS) PURE;
883
884     /*** IOleWindow methods ***/
885     STDMETHOD(GetWindow) (THIS_ HWND32 * lphwnd) PURE;
886     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL32 fEnterMode) PURE;
887
888     /*** IDockingWindowFrame methods ***/
889     STDMETHOD(AddToolbar) (THIS_ IUnknown* punkSrc, LPCWSTR pwszItem, DWORD dwAddFlags) PURE;
890     STDMETHOD(RemoveToolbar) (THIS_ IUnknown* punkSrc, DWORD dwRemoveFlags) PURE;
891     STDMETHOD(FindToolbar) (THIS_ LPCWSTR pwszItem, REFIID riid, LPVOID* ppvObj) PURE;
892 } IDockingWindowFrame_VTable, *LPDOCKINGWINDOWFRAME_VTABLE;
893
894 struct tagDOCKINGWINDOWFRAME
895 { LPDOCKINGWINDOWFRAME_VTABLE lpvtbl;
896   DWORD ref;
897 };
898
899 #undef THIS
900 /****************************************************************************
901  * IServiceProvider interface
902  */
903 #define THIS LPSERVICEPROVIDER this
904
905 typedef struct IServiceProvider_VTable
906 {       /*** IUnknown methods ***/
907         STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
908         STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
909         STDMETHOD_(ULONG,Release) (THIS) PURE;
910
911         STDMETHOD(QueryService)(THIS_ REFGUID guidService, REFIID riid, void **ppvObject);
912 } IServiceProvider_VTable, *LPSERVICEPROVIDER_VTABLE;
913
914 struct tagSERVICEPROVIDER
915 {       LPSERVICEPROVIDER_VTABLE lpvtbl;
916         DWORD ref;
917 };           
918 /****************************************************************************
919  * Class constructors
920  */
921 #ifdef __WINE__
922 extern LPDATAOBJECT     IDataObject_Constructor();
923 extern LPENUMFORMATETC  IEnumFORMATETC_Constructor(UINT32, const FORMATETC32 []);
924
925 extern LPCLASSFACTORY   IClassFactory_Constructor();
926 extern LPCONTEXTMENU    IContextMenu_Constructor(LPSHELLFOLDER, LPCITEMIDLIST *, UINT32);
927 extern LPSHELLFOLDER    IShellFolder_Constructor(LPSHELLFOLDER,LPITEMIDLIST);
928 extern LPSHELLVIEW      IShellView_Constructor();
929 extern LPSHELLLINK      IShellLink_Constructor();
930 extern LPENUMIDLIST     IEnumIDList_Constructor(LPCSTR,DWORD);
931 extern LPEXTRACTICON    IExtractIcon_Constructor(LPITEMIDLIST);
932 #endif
933 /****************************************************************************
934  * Shell Execute API
935  */
936 #define SE_ERR_FNF              2       // file not found
937 #define SE_ERR_PNF              3       // path not found
938 #define SE_ERR_ACCESSDENIED     5       // access denied
939 #define SE_ERR_OOM              8       // out of memory
940 #define SE_ERR_DLLNOTFOUND      32
941 #define SE_ERR_SHARE                    26
942 #define SE_ERR_ASSOCINCOMPLETE          27
943 #define SE_ERR_DDETIMEOUT               28
944 #define SE_ERR_DDEFAIL                  29
945 #define SE_ERR_DDEBUSY                  30
946 #define SE_ERR_NOASSOC                  31
947
948 #define SEE_MASK_CLASSNAME        0x00000001
949 #define SEE_MASK_CLASSKEY         0x00000003
950 #define SEE_MASK_IDLIST           0x00000004
951 #define SEE_MASK_INVOKEIDLIST     0x0000000c
952 #define SEE_MASK_ICON             0x00000010
953 #define SEE_MASK_HOTKEY           0x00000020
954 #define SEE_MASK_NOCLOSEPROCESS   0x00000040
955 #define SEE_MASK_CONNECTNETDRV    0x00000080
956 #define SEE_MASK_FLAG_DDEWAIT     0x00000100
957 #define SEE_MASK_DOENVSUBST       0x00000200
958 #define SEE_MASK_FLAG_NO_UI       0x00000400
959 #define SEE_MASK_UNICODE          0x00004000
960 #define SEE_MASK_NO_CONSOLE       0x00008000
961 #define SEE_MASK_ASYNCOK          0x00100000
962 #define SEE_MASK_HMONITOR         0x00200000
963
964 typedef struct _SHELLEXECUTEINFOA
965 {       DWORD cbSize;
966         ULONG fMask;
967         HWND32 hwnd;
968         LPCSTR   lpVerb;
969         LPCSTR   lpFile;
970         LPCSTR   lpParameters;
971         LPCSTR   lpDirectory;
972        INT32 nShow;
973         HINSTANCE32 hInstApp;
974         /* Optional fields */
975         LPVOID lpIDList;
976         LPCSTR   lpClass;
977         HKEY hkeyClass;
978         DWORD dwHotKey;
979         union 
980         { HANDLE32 hIcon;
981           HANDLE32 hMonitor;
982         } u;
983         HANDLE32 hProcess;
984 } SHELLEXECUTEINFO32A, *LPSHELLEXECUTEINFO32A;
985
986 typedef struct _SHELLEXECUTEINFOW
987 {       DWORD cbSize;
988         ULONG fMask;
989         HWND32 hwnd;
990         LPCWSTR  lpVerb;
991         LPCWSTR  lpFile;
992         LPCWSTR  lpParameters;
993         LPCWSTR  lpDirectory;
994        INT32 nShow;
995         HINSTANCE32 hInstApp;
996         /* Optional fields*/
997         LPVOID lpIDList;
998         LPCWSTR  lpClass;
999         HKEY hkeyClass;
1000         DWORD dwHotKey;
1001         union
1002         { HANDLE32 hIcon;
1003           HANDLE32 hMonitor;
1004         } u;
1005         HANDLE32 hProcess;
1006 } SHELLEXECUTEINFO32W, *LPSHELLEXECUTEINFO32W;
1007
1008 #define SHELLEXECUTEINFO   WINELIB_NAME_AW(SHELLEXECUTEINFO)
1009 #define LPSHELLEXECUTEINFO WINELIB_NAME_AW(LPSHELLEXECUTEINFO)
1010
1011 BOOL32 WINAPI ShellExecuteEx32A(LPSHELLEXECUTEINFO32A lpExecInfo);
1012 BOOL32 WINAPI ShellExecuteEx32W(LPSHELLEXECUTEINFO32W lpExecInfo);
1013 #define ShellExecuteEx  WINELIB_NAME_AW(ShellExecuteEx)
1014
1015 void WINAPI WinExecError32A(HWND32 hwnd,INT32 error, LPCSTR lpstrFileName, LPCSTR lpstrTitle);
1016 void WINAPI WinExecError32W(HWND32 hwnd,INT32 error, LPCWSTR lpstrFileName, LPCWSTR lpstrTitle);
1017 #define WinExecError  WINELIB_NAME_AW(WinExecError)
1018
1019
1020
1021 /****************************************************************************
1022  * SHBrowseForFolder API
1023  */
1024 typedef INT32 (CALLBACK* BFFCALLBACK)(HWND32 hwnd, UINT32 uMsg, LPARAM lParam, LPARAM lpData);
1025
1026 typedef struct tagBROWSEINFO32A {
1027     HWND32        hwndOwner;
1028     LPCITEMIDLIST pidlRoot;
1029     LPSTR         pszDisplayName;
1030     LPCSTR        lpszTitle;
1031     UINT32        ulFlags;
1032     BFFCALLBACK   lpfn;
1033     LPARAM        lParam;
1034         INT32         iImage;
1035 } BROWSEINFO32A, *PBROWSEINFO32A, *LPBROWSEINFO32A;
1036
1037 typedef struct tagBROWSEINFO32W {
1038     HWND32        hwndOwner;
1039     LPCITEMIDLIST pidlRoot;
1040     LPWSTR        pszDisplayName;
1041     LPCWSTR       lpszTitle;
1042     UINT32        ulFlags;
1043     BFFCALLBACK   lpfn;
1044     LPARAM        lParam;
1045         INT32         iImage;
1046 } BROWSEINFO32W, *PBROWSEINFO32W, *LPBROWSEINFO32W; 
1047
1048 #define BROWSEINFO   WINELIB_NAME_AW(BROWSEINFO)
1049 #define PBROWSEINFO  WINELIB_NAME_AW(PBROWSEINFO)
1050 #define LPBROWSEINFO WINELIB_NAME_AW(LPBROWSEINFO)
1051
1052 // Browsing for directory.
1053 #define BIF_RETURNONLYFSDIRS   0x0001
1054 #define BIF_DONTGOBELOWDOMAIN  0x0002
1055 #define BIF_STATUSTEXT         0x0004
1056 #define BIF_RETURNFSANCESTORS  0x0008
1057 #define BIF_EDITBOX            0x0010
1058 #define BIF_VALIDATE           0x0020
1059  
1060 #define BIF_BROWSEFORCOMPUTER  0x1000
1061 #define BIF_BROWSEFORPRINTER   0x2000
1062 #define BIF_BROWSEINCLUDEFILES 0x4000
1063
1064 // message from browser
1065 #define BFFM_INITIALIZED        1
1066 #define BFFM_SELCHANGED         2
1067 #define BFFM_VALIDATEFAILEDA    3   // lParam:szPath ret:1(cont),0(EndDialog)
1068 #define BFFM_VALIDATEFAILEDW    4   // lParam:wzPath ret:1(cont),0(EndDialog)
1069
1070 // messages to browser
1071 #define BFFM_SETSTATUSTEXTA     (WM_USER+100)
1072 #define BFFM_ENABLEOK           (WM_USER+101)
1073 #define BFFM_SETSELECTIONA      (WM_USER+102)
1074 #define BFFM_SETSELECTIONW      (WM_USER+103)
1075 #define BFFM_SETSTATUSTEXTW     (WM_USER+104)
1076
1077 /*
1078 #ifdef UNICODE
1079 #define SHBrowseForFolder   SHBrowseForFolderW
1080 #define BFFM_SETSTATUSTEXT  BFFM_SETSTATUSTEXTW
1081 #define BFFM_SETSELECTION   BFFM_SETSELECTIONW
1082
1083 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
1084 #else
1085 #define SHBrowseForFolder   SHBrowseForFolderA
1086 #define BFFM_SETSTATUSTEXT  BFFM_SETSTATUSTEXTA
1087 #define BFFM_SETSELECTION   BFFM_SETSELECTIONA
1088
1089 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA 
1090 #endif 
1091 */
1092
1093 LPITEMIDLIST WINAPI SHBrowseForFolder32A(LPBROWSEINFO32A lpbi);
1094 /*LPITEMIDLIST WINAPI SHBrowseForFolder32W(LPBROWSEINFO32W lpbi);*/
1095 #define  SHBrowseForFolder WINELIB_NAME_AW(SHBrowseForFolder)
1096
1097 /****************************************************************************
1098 * shlview structures
1099 */
1100
1101 /*
1102 * IShellFolderViewCallback Callback
1103 *  This "callback" is called by the shells default IShellView implementation (that
1104 *  we got using SHCreateShellViewEx()), to notify us of the various things that
1105 *  are happening to the shellview (and ask for things too).
1106 *
1107 *  You don't have to support anything here - anything you don't want to 
1108 *  handle, the shell will do itself if you just return E_NOTIMPL. This parameters
1109 *  that the shell passes to this function are entirely undocumented.
1110 *
1111 *  HOWEVER, as the cabview sample as originally written used this callback, the
1112 *  writers implemented the callback mechanism on top of their own IShellView.
1113 *  Look there for some clues on what to do here.
1114 */
1115
1116 typedef HRESULT(CALLBACK *SHELLVIEWPROC)(DWORD dwUserParam,LPSHELLFOLDER psf,
1117                          HWND32 hwnd,UINT32 uMsg,UINT32 wParam,LPARAM lParam);
1118
1119 /* NF valid values for the "viewmode" item of the SHELLTEMPLATE*/
1120 #define NF_INHERITVIEW    0x0000
1121 #define NF_LOCALVIEW        0x0001
1122
1123 typedef struct _SHELLVIEWDATA   // idl
1124 { DWORD           dwSize;
1125   LPSHELLFOLDER   pShellFolder;
1126   DWORD           dwUserParam;
1127   LPCITEMIDLIST   pidl;
1128   DWORD           v3;        // always 0
1129   SHELLVIEWPROC   pCallBack;
1130   DWORD           viewmode;  // NF_* enum
1131 } SHELLVIEWDATA, * LPSHELLVIEWDATA;
1132
1133 /*
1134  The shell keeps track of some per-user state to handle display
1135  options that is of majorinterest to ISVs.
1136  The key one requested right now is "DoubleClickInWebView".
1137 */
1138 typedef struct 
1139 {   BOOL32 fShowAllObjects : 1;
1140     BOOL32 fShowExtensions : 1;
1141     BOOL32 fNoConfirmRecycle : 1;
1142     BOOL32 fShowSysFiles : 1;
1143     BOOL32 fShowCompColor : 1;
1144     BOOL32 fDoubleClickInWebView : 1;
1145     BOOL32 fDesktopHTML : 1;
1146     BOOL32 fWin95Classic : 1;
1147     BOOL32 fDontPrettyPath : 1;
1148     BOOL32 fShowAttribCol : 1;
1149     BOOL32 fMapNetDrvBtn : 1;
1150     BOOL32 fShowInfoTip : 1;
1151     BOOL32 fHideIcons : 1;
1152     UINT32 fRestFlags : 3;
1153 } SHELLFLAGSTATE, * LPSHELLFLAGSTATE;
1154
1155
1156 #undef PURE
1157 #undef FAR
1158 #undef THIS
1159 #undef THIS_
1160 #undef STDMETHOD
1161 #undef STDMETHOD_
1162 #endif /*_WINE_SHLOBJ_H*/