Changed pidl structure to match the pidl's used in lnk-files.
[wine] / include / shlobj.h
1 #ifndef __WINE_SHLOBJ_H
2 #define __WINE_SHLOBJ_H
3
4 #include "wintypes.h"
5 #include "wine/obj_base.h"
6 #include "wine/obj_shelllink.h"
7 #include "shell.h"
8 #include "oleobj.h"
9 #include "commctrl.h"
10 #include "prsht.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 *  DllGetClassObject
20 */
21 DWORD WINAPI SHELL32_DllGetClassObject(REFCLSID,REFIID,LPVOID*);
22
23
24
25 /* foreward declaration of the objects*/
26 typedef struct tagCONTEXTMENU   *LPCONTEXTMENU, IContextMenu;
27 typedef struct tagSHELLEXTINIT  *LPSHELLEXTINIT,IShellExtInit;
28 typedef struct tagENUMIDLIST    *LPENUMIDLIST,  IEnumIDList;
29 typedef struct tagSHELLFOLDER   *LPSHELLFOLDER, IShellFolder;
30 typedef struct tagSHELLVIEW     *LPSHELLVIEW,   IShellView;
31 typedef struct tagSHELLBROWSER  *LPSHELLBROWSER,IShellBrowser;
32 typedef struct tagSHELLICON     *LPSHELLICON,   IShellIcon;
33 typedef struct tagDOCKINGWINDOWFRAME    *LPDOCKINGWINDOWFRAME,  IDockingWindowFrame;
34 typedef struct tagCOMMDLGBROWSER        *LPCOMMDLGBROWSER,      ICommDlgBrowser;
35  
36 /****************************************************************************
37 *  STRRET
38 */
39 #define STRRET_WSTR     0x0000
40 #define STRRET_OFFSETA  0x0001
41 #define STRRET_CSTRA    0x0002
42 #define STRRET_ASTR     0X0003
43 #define STRRET_OFFSETW  0X0004
44 #define STRRET_CSTRW    0X0005
45
46
47 typedef struct _STRRET
48 { UINT32 uType;         /* STRRET_xxx */
49   union
50   { LPWSTR      pOleStr;        /* OLESTR that will be freed */
51     LPSTR       pStr;
52     UINT32      uOffset;        /* OffsetINT32o SHITEMID (ANSI) */
53     char        cStr[MAX_PATH]; /* Buffer to fill in */
54     WCHAR       cStrW[MAX_PATH];
55   }u;
56 } STRRET,*LPSTRRET;
57
58
59 /*****************************************************************************
60  * IContextMenu interface
61  */
62 #define THIS LPCONTEXTMENU this
63
64 /* default menu items*/
65 #define IDM_EXPLORE  0
66 #define IDM_OPEN     1
67 #define IDM_RENAME   2
68 #define IDM_LAST     IDM_RENAME
69
70 /* QueryContextMenu uFlags */
71 #define CMF_NORMAL              0x00000000
72 #define CMF_DEFAULTONLY         0x00000001
73 #define CMF_VERBSONLY           0x00000002
74 #define CMF_EXPLORE             0x00000004
75 #define CMF_NOVERBS             0x00000008
76 #define CMF_CANRENAME           0x00000010
77 #define CMF_NODEFAULT           0x00000020
78 #define CMF_INCLUDESTATIC       0x00000040
79 #define CMF_RESERVED            0xffff0000      /* View specific */
80
81 /* GetCommandString uFlags */
82 #define GCS_VERBA        0x00000000     /* canonical verb */
83 #define GCS_HELPTEXTA    0x00000001     /* help text (for status bar) */
84 #define GCS_VALIDATEA    0x00000002     /* validate command exists */
85 #define GCS_VERBW        0x00000004     /* canonical verb (unicode) */
86 #define GCS_HELPTEXTW    0x00000005     /* help text (unicode version) */
87 #define GCS_VALIDATEW    0x00000006     /* validate command exists (unicode) */
88 #define GCS_UNICODE      0x00000004     /* for bit testing - Unicode string */
89
90 #define GCS_VERB        GCS_VERBA
91 #define GCS_HELPTEXT    GCS_HELPTEXTA
92 #define GCS_VALIDATE    GCS_VALIDATEA
93
94 #define CMDSTR_NEWFOLDERA   "NewFolder"
95 #define CMDSTR_VIEWLISTA    "ViewList"
96 #define CMDSTR_VIEWDETAILSA "ViewDetails"
97 #define CMDSTR_NEWFOLDERW   L"NewFolder"
98 #define CMDSTR_VIEWLISTW    L"ViewList"
99 #define CMDSTR_VIEWDETAILSW L"ViewDetails"
100
101 #define CMDSTR_NEWFOLDER    CMDSTR_NEWFOLDERA
102 #define CMDSTR_VIEWLIST     CMDSTR_VIEWLISTA
103 #define CMDSTR_VIEWDETAILS  CMDSTR_VIEWDETAILSA
104
105 #define CMIC_MASK_HOTKEY        SEE_MASK_HOTKEY
106 #define CMIC_MASK_ICON          SEE_MASK_ICON
107 #define CMIC_MASK_FLAG_NO_UI    SEE_MASK_FLAG_NO_UI
108 #define CMIC_MASK_UNICODE       SEE_MASK_UNICODE
109 #define CMIC_MASK_NO_CONSOLE    SEE_MASK_NO_CONSOLE
110 #define CMIC_MASK_HASLINKNAME   SEE_MASK_HASLINKNAME
111 #define CMIC_MASK_FLAG_SEP_VDM  SEE_MASK_FLAG_SEPVDM
112 #define CMIC_MASK_HASTITLE      SEE_MASK_HASTITLE
113 #define CMIC_MASK_ASYNCOK       SEE_MASK_ASYNCOK
114
115 #define CMIC_MASK_PTINVOKE      0x20000000
116
117 /*NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor */
118 typedef struct tagCMINVOKECOMMANDINFO 
119 {   DWORD cbSize;        /* sizeof(CMINVOKECOMMANDINFO) */
120     DWORD fMask;         /* any combination of CMIC_MASK_* */
121     HWND32 hwnd;         /* might be NULL (indicating no owner window) */
122     LPCSTR lpVerb;       /* either a string or MAKEINTRESOURCE(idOffset) */
123     LPCSTR lpParameters; /* might be NULL (indicating no parameter) */
124     LPCSTR lpDirectory;  /* might be NULL (indicating no specific directory) */
125    INT32 nShow;           /* one of SW_ values for ShowWindow() API */
126
127     DWORD dwHotKey;
128     HANDLE32 hIcon;
129 } CMINVOKECOMMANDINFO32,  *LPCMINVOKECOMMANDINFO32;
130
131 typedef struct tagCMInvokeCommandInfoEx 
132 {   DWORD cbSize;        /* must be sizeof(CMINVOKECOMMANDINFOEX) */
133     DWORD fMask;         /* any combination of CMIC_MASK_* */
134     HWND32 hwnd;         /* might be NULL (indicating no owner window) */
135     LPCSTR lpVerb;       /* either a string or MAKEINTRESOURCE(idOffset) */
136     LPCSTR lpParameters; /* might be NULL (indicating no parameter) */
137     LPCSTR lpDirectory;  /* might be NULL (indicating no specific directory) */
138         INT32 nShow;           /* one of SW_ values for ShowWindow() API */
139
140     DWORD dwHotKey;
141     
142     HANDLE32 hIcon;
143     LPCSTR lpTitle;        /* For CreateProcess-StartupInfo.lpTitle */
144     LPCWSTR lpVerbW;       /* Unicode verb (for those who can use it) */
145     LPCWSTR lpParametersW; /* Unicode parameters (for those who can use it) */
146     LPCWSTR lpDirectoryW;  /* Unicode directory (for those who can use it) */
147     LPCWSTR lpTitleW;      /* Unicode title (for those who can use it) */
148     POINT32 ptInvoke;      /* Point where it's invoked */
149
150 } CMINVOKECOMMANDINFOEX32,  *LPCMINVOKECOMMANDINFOEX32;
151
152
153 typedef struct IContextMenu_VTable
154 {   /* *** IUnknown methods *** */
155     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
156     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
157     STDMETHOD_(ULONG,Release) (THIS) PURE;
158
159     STDMETHOD(QueryContextMenu)(THIS_ HMENU32 hmenu,UINT32 indexMenu,UINT32 idCmdFirst, UINT32 idCmdLast,UINT32 uFlags) PURE;
160     STDMETHOD(InvokeCommand)(THIS_ LPCMINVOKECOMMANDINFO32 lpici) PURE;
161     STDMETHOD(GetCommandString)(THIS_ UINT32 idCmd,UINT32 uType,UINT32 * pwReserved,LPSTR pszName,UINT32 cchMax) PURE;
162
163     /* undocumented not only in ContextMenu2 */
164     STDMETHOD(HandleMenuMsg)(THIS_  UINT32 uMsg,WPARAM32 wParam,LPARAM lParam) PURE;
165
166     /* possibly another nasty entry from ContextMenu3 ?*/    
167     void * guard;
168 } IContextMenu_VTable,*LPCONTEXTMENU_VTABLE;
169
170 struct tagCONTEXTMENU
171 { LPCONTEXTMENU_VTABLE  lpvtbl;
172   DWORD                 ref;
173   LPSHELLFOLDER pSFParent;
174   LPITEMIDLIST  *aPidls;
175   BOOL32                bAllValues;
176 };
177
178 #undef THIS
179 /*****************************************************************************
180  * structures for shell clipboard formats
181  */
182 typedef enum tagDVASPECT
183 {       DVASPECT_CONTENT        = 1,
184         DVASPECT_THUMBNAIL      = 2,
185         DVASPECT_ICON   = 4,
186         DVASPECT_DOCPRINT       = 8
187 } DVASPECT;
188
189 /* shell specific clipboard formats */
190
191 /* DATAOBJECT_InitShellIDList*/
192 #define CFSTR_SHELLIDLIST       "Shell IDList Array"      /* CF_IDLIST */
193
194 extern UINT32 cfShellIDList;
195
196 typedef struct
197 {       UINT32 cidl;
198         UINT32 aoffset[1];
199 } CIDA, *LPCIDA;
200
201 #define CFSTR_SHELLIDLISTOFFSET "Shell Object Offsets"    /* CF_OBJECTPOSITIONS */
202 #define CFSTR_NETRESOURCES      "Net Resource"            /* CF_NETRESOURCE */
203
204 /* DATAOBJECT_InitFileGroupDesc */
205 #define CFSTR_FILEDESCRIPTORA   "FileGroupDescriptor"     /* CF_FILEGROUPDESCRIPTORA */
206 extern UINT32 cfFileGroupDesc;
207
208 #define CFSTR_FILEDESCRIPTORW   "FileGroupDescriptorW"    /* CF_FILEGROUPDESCRIPTORW */
209
210 /* DATAOBJECT_InitFileContents*/
211 #define CFSTR_FILECONTENTS      "FileContents"            /* CF_FILECONTENTS */
212 extern UINT32 cfFileContents;
213
214 #define CFSTR_FILENAMEA         "FileName"                /* CF_FILENAMEA */
215 #define CFSTR_FILENAMEW         "FileNameW"               /* CF_FILENAMEW */
216 #define CFSTR_PRINTERGROUP      "PrinterFriendlyName"     /* CF_PRINTERS */
217 #define CFSTR_FILENAMEMAPA      "FileNameMap"             /* CF_FILENAMEMAPA */
218 #define CFSTR_FILENAMEMAPW      "FileNameMapW"            /* CF_FILENAMEMAPW */
219 #define CFSTR_SHELLURL          "UniformResourceLocator"
220 #define CFSTR_PREFERREDDROPEFFECT "Preferred DropEffect"
221 #define CFSTR_PERFORMEDDROPEFFECT "Performed DropEffect"
222 #define CFSTR_PASTESUCCEEDED    "Paste Succeeded"
223 #define CFSTR_INDRAGLOOP        "InShellDragLoop"
224
225 /**************************************************************************
226  *  IDLList "Item ID List List"
227  *
228  *  NOTES
229  *   interal data holder for IDataObject
230  */
231 typedef struct tagLPIDLLIST     *LPIDLLIST,     IDLList;
232
233 #define THIS LPIDLLIST this
234
235 typedef enum
236 {       State_UnInit=1,
237         State_Init=2,
238         State_OutOfMem=3
239 } IDLListState;
240  
241 typedef struct IDLList_VTable
242 {       STDMETHOD_(UINT32, GetState)(THIS);
243         STDMETHOD_(LPITEMIDLIST, GetElement)(THIS_ UINT32 nIndex);
244         STDMETHOD_(UINT32, GetCount)(THIS);
245         STDMETHOD_(BOOL32, StoreItem)(THIS_ LPITEMIDLIST pidl);
246         STDMETHOD_(BOOL32, AddItems)(THIS_ LPITEMIDLIST *apidl, UINT32 cidl);
247         STDMETHOD_(BOOL32, InitList)(THIS);
248         STDMETHOD_(void, CleanList)(THIS);
249 } IDLList_VTable,*LPIDLLIST_VTABLE;
250
251 struct tagLPIDLLIST
252 {       LPIDLLIST_VTABLE        lpvtbl;
253         HDPA    dpa;
254         UINT32  uStep;
255 };
256
257 extern LPIDLLIST IDLList_Constructor (UINT32 uStep);
258 extern void IDLList_Destructor(LPIDLLIST this);
259 #undef THIS
260
261
262 /*****************************************************************************
263  * IShellExtInit interface
264  */
265 #define THIS LPSHELLEXTINIT this
266
267 typedef struct IShellExtInit_VTable 
268 {   /* *** IUnknown methods *** */
269     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
270     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
271     STDMETHOD_(ULONG,Release) (THIS) PURE;
272
273     /* *** IShellExtInit methods *** */
274     STDMETHOD(Initialize)(THIS_ LPCITEMIDLIST pidlFolder, LPDATAOBJECT lpdobj, HKEY hkeyProgID) PURE;
275 } IShellExtInit_VTable,*LPSHELLEXTINIT_VTABLE;
276
277 struct tagSHELLEXTINIT
278 { LPSHELLEXTINIT_VTABLE lpvtbl;
279   DWORD                  ref;
280 };
281
282 #undef THIS
283
284 /*****************************************************************************
285  * IEnumIDList interface
286  */
287 #define THIS LPENUMIDLIST this
288
289 typedef struct tagENUMLIST
290 { struct tagENUMLIST    *pNext;
291   LPITEMIDLIST pidl;
292 } ENUMLIST, *LPENUMLIST;
293
294 typedef struct IEnumIDList_VTable 
295 {    /* *** IUnknown methods *** */
296     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
297     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
298     STDMETHOD_(ULONG,Release) (THIS) PURE;
299
300     /* *** IEnumIDList methods *** */
301     STDMETHOD(Next)  (THIS_ ULONG celt,
302                       LPITEMIDLIST *rgelt,
303                       ULONG *pceltFetched) PURE;
304     STDMETHOD(Skip)  (THIS_ ULONG celt) PURE;
305     STDMETHOD(Reset) (THIS) PURE;
306     STDMETHOD(Clone) (THIS_ IEnumIDList **ppenum) PURE;
307                 /* *** private methods *** */
308     STDMETHOD_(BOOL32,CreateEnumList)(THIS_ LPCSTR, DWORD) PURE;
309     STDMETHOD_(BOOL32,AddToEnumList)(THIS_ LPITEMIDLIST) PURE;
310     STDMETHOD_(BOOL32,DeleteList)(THIS) PURE;
311
312                 
313 } IEnumIDList_VTable,*LPENUMIDLIST_VTABLE;
314
315 struct tagENUMIDLIST
316 { LPENUMIDLIST_VTABLE   lpvtbl;
317   DWORD          ref;
318   LPENUMLIST mpFirst;
319   LPENUMLIST mpLast;
320   LPENUMLIST mpCurrent;
321 };
322
323 #undef THIS
324 /*-------------------------------------------------------------------------- */
325 /* */
326 /* FOLDERSETTINGS */
327 /* */
328 /*  FOLDERSETTINGS is a data structure that explorer passes from one folder */
329 /* view to another, when the user is browsing. It calls ISV::GetCurrentInfo */
330 /* member to get the current settings and pass it to ISV::CreateViewWindow */
331 /* to allow the next folder view "inherit" it. These settings assumes a */
332 /* particular UI (which the shell's folder view has), and shell extensions */
333 /* may or may not use those settings. */
334 /* */
335 /*-------------------------------------------------------------------------- */
336
337 typedef LPBYTE LPVIEWSETTINGS;
338
339 /* NB Bitfields. */
340 /* FWF_DESKTOP implies FWF_TRANSPARENT/NOCLIENTEDGE/NOSCROLL */
341 typedef enum
342 { FWF_AUTOARRANGE =       0x0001,
343   FWF_ABBREVIATEDNAMES =  0x0002,
344   FWF_SNAPTOGRID =        0x0004,
345   FWF_OWNERDATA =         0x0008,
346   FWF_BESTFITWINDOW =     0x0010,
347   FWF_DESKTOP =           0x0020,
348   FWF_SINGLESEL =         0x0040,
349   FWF_NOSUBFOLDERS =      0x0080,
350   FWF_TRANSPARENT  =      0x0100,
351   FWF_NOCLIENTEDGE =      0x0200,
352   FWF_NOSCROLL     =      0x0400,
353   FWF_ALIGNLEFT    =      0x0800,
354   FWF_SINGLECLICKACTIVATE=0x8000  /* TEMPORARY -- NO UI FOR THIS */
355 } FOLDERFLAGS;
356
357 typedef enum
358 { FVM_ICON =              1,
359   FVM_SMALLICON =         2,
360   FVM_LIST =              3,
361   FVM_DETAILS =           4
362 } FOLDERVIEWMODE;
363
364 typedef struct
365 { UINT32 ViewMode;       /* View mode (FOLDERVIEWMODE values) */
366   UINT32 fFlags;         /* View options (FOLDERFLAGS bits) */
367 } FOLDERSETTINGS, *LPFOLDERSETTINGS;
368
369 typedef const FOLDERSETTINGS * LPCFOLDERSETTINGS;
370
371 /************************************************************************
372  * IShellFolder interface
373  */
374
375 #define THIS LPSHELLFOLDER this
376
377 /* IShellFolder::GetDisplayNameOf/SetNameOf uFlags */
378 typedef enum
379 { SHGDN_NORMAL            = 0,        /* default (display purpose) */
380   SHGDN_INFOLDER          = 1,        /* displayed under a folder (relative)*/
381   SHGDN_FORPARSING        = 0x8000    /* for ParseDisplayName or path */
382 } SHGNO;
383
384 /* IShellFolder::EnumObjects */
385 typedef enum tagSHCONTF
386 { SHCONTF_FOLDERS         = 32,       /* for shell browser */
387   SHCONTF_NONFOLDERS      = 64,       /* for default view */
388   SHCONTF_INCLUDEHIDDEN   = 128       /* for hidden/system objects */
389 } SHCONTF;
390
391 /* IShellFolder::GetAttributesOf flags */
392 #define SFGAO_CANCOPY           DROPEFFECT_COPY /* Objects can be copied */
393 #define SFGAO_CANMOVE           DROPEFFECT_MOVE /* Objects can be moved */
394 #define SFGAO_CANLINK           DROPEFFECT_LINK /* Objects can be linked */
395 #define SFGAO_CANRENAME         0x00000010L     /* Objects can be renamed */
396 #define SFGAO_CANDELETE         0x00000020L     /* Objects can be deleted */
397 #define SFGAO_HASPROPSHEET      0x00000040L     /* Objects have property sheets */
398 #define SFGAO_DROPTARGET        0x00000100L     /* Objects are drop target */
399 #define SFGAO_CAPABILITYMASK    0x00000177L
400 #define SFGAO_LINK              0x00010000L     /* Shortcut (link) */
401 #define SFGAO_SHARE             0x00020000L     /* shared */
402 #define SFGAO_READONLY          0x00040000L     /* read-only */
403 #define SFGAO_GHOSTED           0x00080000L     /* ghosted icon */
404 #define SFGAO_DISPLAYATTRMASK   0x000F0000L
405 #define SFGAO_FILESYSANCESTOR   0x10000000L     /* It contains file system folder */
406 #define SFGAO_FOLDER            0x20000000L     /* It's a folder. */
407 #define SFGAO_FILESYSTEM        0x40000000L     /* is a file system thing (file/folder/root) */
408 #define SFGAO_HASSUBFOLDER      0x80000000L     /* Expandable in the map pane */
409 #define SFGAO_CONTENTSMASK      0x80000000L
410 #define SFGAO_VALIDATE          0x01000000L     /* invalidate cached information */
411 #define SFGAO_REMOVABLE        0x02000000L      /* is this removeable media? */
412
413 typedef struct IShellFolder_VTable {
414     /* *** IUnknown methods *** */
415     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
416     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
417     STDMETHOD_(ULONG,Release) (THIS) PURE;
418
419     /* *** IShellFolder methods *** */
420     STDMETHOD(ParseDisplayName) (THIS_ HWND32 hwndOwner,LPBC pbcReserved, LPOLESTR32 lpszDisplayName,ULONG * pchEaten, LPITEMIDLIST * ppidl, ULONG *pdwAttributes) PURE;
421     STDMETHOD(EnumObjects)( THIS_ HWND32 hwndOwner, DWORD grfFlags, LPENUMIDLIST * ppenumIDList) PURE;
422     STDMETHOD(BindToObject)(THIS_ LPCITEMIDLIST pidl, LPBC pbcReserved,REFIID riid, LPVOID * ppvOut) PURE;
423     STDMETHOD(BindToStorage)(THIS_ LPCITEMIDLIST pidl, LPBC pbcReserved,REFIID riid, LPVOID * ppvObj) PURE;
424     STDMETHOD(CompareIDs)(THIS_ LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
425     STDMETHOD(CreateViewObject)(THIS_ HWND32 hwndOwner, REFIID riid, LPVOID * ppvOut) PURE;
426     STDMETHOD(GetAttributesOf)(THIS_ UINT32 cidl, LPCITEMIDLIST * apidl,ULONG * rgfInOut) PURE;
427     STDMETHOD(GetUIObjectOf)(THIS_ HWND32 hwndOwner, UINT32 cidl, LPCITEMIDLIST * apidl,REFIID riid, UINT32 * prgfInOut, LPVOID * ppvOut) PURE;
428     STDMETHOD(GetDisplayNameOf)(THIS_ LPCITEMIDLIST pidl, DWORD uFlags, LPSTRRET lpName) PURE;
429     STDMETHOD(SetNameOf)(THIS_ HWND32 hwndOwner, LPCITEMIDLIST pidl,LPCOLESTR32 lpszName, DWORD uFlags,LPITEMIDLIST * ppidlOut) PURE;
430
431         /* utility functions */
432    STDMETHOD_(BOOL32,GetFolderPath)(THIS_ LPSTR, DWORD);
433    
434 } *LPSHELLFOLDER_VTABLE,IShellFolder_VTable;
435
436 struct tagSHELLFOLDER {
437         LPSHELLFOLDER_VTABLE    lpvtbl;
438         DWORD                   ref;
439         LPSTR                   sMyPath;
440         LPITEMIDLIST            pMyPidl;
441         LPITEMIDLIST            mpidl;
442 };
443
444 extern LPSHELLFOLDER pdesktopfolder;
445
446 /************************
447 * Shellfolder API
448 */
449 DWORD WINAPI SHGetDesktopFolder(LPSHELLFOLDER *);
450 #undef THIS
451
452 /************************************************************************
453 * IShellBrowser interface
454 */
455 #define THIS LPSHELLBROWSER this
456 /* targets for GetWindow/SendControlMsg */
457 #define FCW_STATUS              0x0001
458 #define FCW_TOOLBAR             0x0002
459 #define FCW_TREE                0x0003
460 #define FCW_INTERNETBAR         0x0006
461 #define FCW_PROGRESS            0x0008
462
463 /* wFlags for BrowseObject*/
464 #define SBSP_DEFBROWSER         0x0000
465 #define SBSP_SAMEBROWSER        0x0001
466 #define SBSP_NEWBROWSER         0x0002
467
468 #define SBSP_DEFMODE            0x0000
469 #define SBSP_OPENMODE           0x0010
470 #define SBSP_EXPLOREMODE        0x0020
471
472 #define SBSP_ABSOLUTE           0x0000
473 #define SBSP_RELATIVE           0x1000
474 #define SBSP_PARENT             0x2000
475 #define SBSP_NAVIGATEBACK       0x4000
476 #define SBSP_NAVIGATEFORWARD    0x8000
477
478 #define SBSP_ALLOW_AUTONAVIGATE         0x10000
479
480 #define SBSP_INITIATEDBYHLINKFRAME      0x80000000
481 #define SBSP_REDIRECT                   0x40000000
482 #define SBSP_WRITENOHISTORY             0x08000000
483
484 /* uFlage for SetToolbarItems */
485 #define FCT_MERGE       0x0001
486 #define FCT_CONFIGABLE  0x0002
487 #define FCT_ADDTOEND    0x0004
488
489 /* undocumented, found in the web posted by Chris Becke */ 
490 #define CWM_SETPATH     (WM_USER+2)
491 #define CWM_WANTIDLE    (WM_USER+3)
492 #define CWM_GETSETCURRENTINFO   (WM_USER+4)
493 #define CWM_SELECTITEM  (WM_USER+5)
494 #define CWM_STOPWAITING (WM_USER+6)
495 #define CWM_GETISHELLBROWSER (WM_USER+7)
496
497 typedef struct IShellBrowser_VTable 
498 {    /* *** IUnknown methods *** */
499     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
500     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
501     STDMETHOD_(ULONG,Release) (THIS) PURE;
502
503     /* *** IOleWindow methods *** */
504     STDMETHOD(GetWindow) (THIS_ HWND32 * lphwnd) PURE;
505     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL32 fEnterMode) PURE;
506
507     /* *** IShellBrowser methods *** (same as IOleInPlaceFrame) */
508     STDMETHOD(InsertMenusSB) (THIS_ HMENU32 hmenuShared, LPOLEMENUGROUPWIDTHS32 lpMenuWidths) PURE;
509     STDMETHOD(SetMenuSB) (THIS_ HMENU32 hmenuShared, HOLEMENU32 holemenuReserved, HWND32 hwndActiveObject) PURE;
510     STDMETHOD(RemoveMenusSB) (THIS_ HMENU32 hmenuShared) PURE;
511     STDMETHOD(SetStatusTextSB) (THIS_ LPCOLESTR32 lpszStatusText) PURE;
512     STDMETHOD(EnableModelessSB) (THIS_ BOOL32 fEnable) PURE;
513     STDMETHOD(TranslateAcceleratorSB) (THIS_ LPMSG32 lpmsg, WORD wID) PURE;
514
515     /* *** IShellBrowser methods *** */
516     STDMETHOD(BrowseObject)(THIS_ LPCITEMIDLIST pidl, UINT32 wFlags) PURE;
517     STDMETHOD(GetViewStateStream)(THIS_ DWORD grfMode, LPSTREAM32  *ppStrm) PURE;
518     STDMETHOD(GetControlWindow)(THIS_ UINT32 id, HWND32 * lphwnd) PURE;
519     STDMETHOD(SendControlMsg)(THIS_ UINT32 id, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam, LRESULT * pret) PURE;
520     STDMETHOD(QueryActiveShellView)(THIS_ IShellView ** ppshv) PURE;
521     STDMETHOD(OnViewWindowActive)(THIS_ IShellView * ppshv) PURE;
522     STDMETHOD(SetToolbarItems)(THIS_ LPTBBUTTON lpButtons, UINT32 nButtons, UINT32 uFlags) PURE;
523 } *LPSHELLBROWSER_VTABLE,IShellBrowser_VTable;
524
525 struct tagSHELLBROWSER 
526 { LPSHELLBROWSER_VTABLE lpvtbl;
527   DWORD ref;
528 };
529
530 #undef THIS
531
532 /************************************************************************
533 * IShellView interface
534 */
535 #define THIS LPSHELLVIEW this
536
537 /* shellview select item flags*/
538 #define SVSI_DESELECT   0x0000
539 #define SVSI_SELECT     0x0001
540 #define SVSI_EDIT       0x0003  /* includes select */
541 #define SVSI_DESELECTOTHERS 0x0004
542 #define SVSI_ENSUREVISIBLE  0x0008
543 #define SVSI_FOCUSED        0x0010
544
545 /* shellview get item object flags */
546 #define SVGIO_BACKGROUND    0x00000000
547 #define SVGIO_SELECTION     0x00000001
548 #define SVGIO_ALLVIEW       0x00000002
549
550 /* The explorer dispatches WM_COMMAND messages based on the range of
551  command/menuitem IDs. All the IDs of menuitems that the view (right
552  pane) inserts must be in FCIDM_SHVIEWFIRST/LAST (otherwise, the explorer
553  won't dispatch them). The view should not deal with any menuitems
554  in FCIDM_BROWSERFIRST/LAST (otherwise, it won't work with the future
555  version of the shell).
556
557   FCIDM_SHVIEWFIRST/LAST      for the right pane (IShellView)
558   FCIDM_BROWSERFIRST/LAST     for the explorer frame (IShellBrowser)
559   FCIDM_GLOBAL/LAST           for the explorer's submenu IDs
560 */
561 #define FCIDM_SHVIEWFIRST       0x0000
562 /* undocumented */
563 #define FCIDM_SHVIEW_ARRANGE    0x7001
564 #define FCIDM_SHVIEW_DELETE     0x7011
565 #define FCIDM_SHVIEW_PROPERTIES 0x7013
566 #define FCIDM_SHVIEW_CUT        0x7018
567 #define FCIDM_SHVIEW_COPY       0x7019
568 #define FCIDM_SHVIEW_INSERT     0x701A
569 #define FCIDM_SHVIEW_UNDO       0x701B
570 #define FCIDM_SHVIEW_INSERTLINK 0x701C
571 #define FCIDM_SHVIEW_SELECTALL  0x7021
572 #define FCIDM_SHVIEW_INVERTSELECTION    0x7022
573 #define FCIDM_SHVIEW_BIGICON    0x7029
574 #define FCIDM_SHVIEW_SMALLICON  0x702A
575 #define FCIDM_SHVIEW_LISTVIEW   0x702B  
576 #define FCIDM_SHVIEW_REPORTVIEW 0x702C
577 #define FCIDM_SHVIEW_AUTOARRANGE        0x7031  
578 #define FCIDM_SHVIEW_SNAPTOGRID 0x7032
579 #define FCIDM_SHVIEW_HELP       0x7041
580
581 #define FCIDM_SHVIEWLAST        0x7fff
582 #define FCIDM_BROWSERFIRST      0xA000
583 /* undocumented toolbar items from stddlg's*/
584 #define FCIDM_TB_SMALLICON      0xA003
585 #define FCIDM_TB_REPORTVIEW     0xA004
586
587 #define FCIDM_BROWSERLAST       0xbf00
588 #define FCIDM_GLOBALFIRST       0x8000
589 #define FCIDM_GLOBALLAST        0x9fff
590
591 /*
592 * Global submenu IDs and separator IDs
593 */
594 #define FCIDM_MENU_FILE             (FCIDM_GLOBALFIRST+0x0000)
595 #define FCIDM_MENU_EDIT             (FCIDM_GLOBALFIRST+0x0040)
596 #define FCIDM_MENU_VIEW             (FCIDM_GLOBALFIRST+0x0080)
597 #define FCIDM_MENU_VIEW_SEP_OPTIONS (FCIDM_GLOBALFIRST+0x0081)
598 #define FCIDM_MENU_TOOLS            (FCIDM_GLOBALFIRST+0x00c0)
599 #define FCIDM_MENU_TOOLS_SEP_GOTO   (FCIDM_GLOBALFIRST+0x00c1)
600 #define FCIDM_MENU_HELP             (FCIDM_GLOBALFIRST+0x0100)
601 #define FCIDM_MENU_FIND             (FCIDM_GLOBALFIRST+0x0140)
602 #define FCIDM_MENU_EXPLORE          (FCIDM_GLOBALFIRST+0x0150)
603 #define FCIDM_MENU_FAVORITES        (FCIDM_GLOBALFIRST+0x0170)
604
605 /* control IDs known to the view */
606 #define FCIDM_TOOLBAR      (FCIDM_BROWSERFIRST + 0)
607 #define FCIDM_STATUS       (FCIDM_BROWSERFIRST + 1)
608
609 /* uState values for IShellView::UIActivate */
610 typedef enum 
611 { SVUIA_DEACTIVATE       = 0,
612   SVUIA_ACTIVATE_NOFOCUS = 1,
613   SVUIA_ACTIVATE_FOCUS   = 2,
614   SVUIA_INPLACEACTIVATE  = 3          /* new flag for IShellView2 */
615 } SVUIA_STATUS;
616
617
618
619 typedef struct IShellView_VTable
620 {   /* *** IUnknown methods *** */
621     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
622     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
623     STDMETHOD_(ULONG,Release) (THIS) PURE;
624
625     /* *** IOleWindow methods *** */
626     STDMETHOD(GetWindow) (THIS_ HWND32 * lphwnd) PURE;
627     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL32 fEnterMode) PURE;
628
629     /* *** IShellView methods *** */
630     STDMETHOD(TranslateAccelerator) (THIS_ LPMSG32 lpmsg) PURE;
631     STDMETHOD(EnableModeless) (THIS_ BOOL32 fEnable) PURE;
632     STDMETHOD(UIActivate) (THIS_ UINT32 uState) PURE;
633     STDMETHOD(Refresh) (THIS) PURE;
634     STDMETHOD(CreateViewWindow)(THIS_ IShellView *lpPrevView,LPCFOLDERSETTINGS lpfs, IShellBrowser * psb,RECT32 * prcView, HWND32  *phWnd) PURE;
635     STDMETHOD(DestroyViewWindow)(THIS) PURE;
636     STDMETHOD(GetCurrentInfo)(THIS_ LPFOLDERSETTINGS lpfs) PURE;
637     STDMETHOD(AddPropertySheetPages)(THIS_ DWORD dwReserved,LPFNADDPROPSHEETPAGE lpfn, LPARAM lparam) PURE;
638     STDMETHOD(SaveViewState)(THIS) PURE;
639     STDMETHOD(SelectItem)(THIS_ LPCITEMIDLIST pidlItem, UINT32 uFlags) PURE;
640     STDMETHOD(GetItemObject)(THIS_ UINT32 uItem, REFIID riid,LPVOID *ppv) PURE;
641 } IShellView_VTable,*LPSHELLVIEW_VTABLE;
642
643 struct tagSHELLVIEW 
644 { LPSHELLVIEW_VTABLE lpvtbl;
645   DWORD         ref;
646   LPITEMIDLIST  mpidl;
647   LPSHELLFOLDER pSFParent;
648   LPSHELLBROWSER        pShellBrowser;
649   LPCOMMDLGBROWSER      pCommDlgBrowser;
650   HWND32        hWnd;
651   HWND32        hWndList;
652   HWND32        hWndParent;
653   FOLDERSETTINGS        FolderSettings;
654   HMENU32       hMenu;
655   UINT32        uState;
656   UINT32        uSelected;
657   LPITEMIDLIST  *aSelectedItems;
658 };
659
660 typedef GUID SHELLVIEWID;
661 #define SV_CLASS_NAME   ("SHELLDLL_DefView")
662
663 #undef THIS
664 /****************************************************************************
665  * ICommDlgBrowser interface
666  */
667 #define THIS LPCOMMDLGBROWSER this
668
669 /* for OnStateChange*/
670 #define CDBOSC_SETFOCUS     0x00000000
671 #define CDBOSC_KILLFOCUS    0x00000001
672 #define CDBOSC_SELCHANGE    0x00000002
673 #define CDBOSC_RENAME       0x00000003
674
675 typedef struct ICommDlgBrowser_VTable
676 {   /* IUnknown methods */
677     STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
678     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
679     STDMETHOD_(ULONG,Release) (THIS) PURE;
680
681     /* ICommDlgBrowser methods */
682     STDMETHOD(OnDefaultCommand) (THIS_  LPSHELLVIEW ppshv) PURE;
683     STDMETHOD(OnStateChange) (THIS_ LPSHELLVIEW ppshv, ULONG uChange) PURE;
684     STDMETHOD(IncludeObject) (THIS_ LPSHELLVIEW ppshv, LPCITEMIDLIST pidl) PURE;
685 } ICommDlgBrowser_VTable,*LPCOMMDLGBROWSER_VTABLE;
686
687 struct tagCOMMDLGBROWSER
688 { LPCOMMDLGBROWSER_VTABLE lpvtbl;
689   DWORD                      ref;
690 };
691 #undef THIS
692
693 /****************************************************************************
694  * IExtractIconinterface
695  *
696  * FIXME
697  *  Is the ExtractIconA interface
698  */
699 #define THIS LPEXTRACTICON this
700
701 /* GetIconLocation() input flags*/
702 #define GIL_OPENICON     0x0001      /* allows containers to specify an "open" look */
703 #define GIL_FORSHELL     0x0002      /* icon is to be displayed in a ShellFolder */
704 #define GIL_ASYNC        0x0020      /* this is an async extract, return E_ASYNC */
705
706 /* GetIconLocation() return flags */
707 #define GIL_SIMULATEDOC  0x0001      /* simulate this document icon for this */
708 #define GIL_PERINSTANCE  0x0002      /* icons from this class are per instance (each file has its own) */
709 #define GIL_PERCLASS     0x0004      /* icons from this class per class (shared for all files of this type) */
710 #define GIL_NOTFILENAME  0x0008      /* location is not a filename, must call ::ExtractIcon */
711 #define GIL_DONTCACHE    0x0010      /* this icon should not be cached */
712
713 typedef struct IExtractIcon IExtractIcon,*LPEXTRACTICON;
714 typedef struct IExtractIcon_VTable
715 { /*** IUnknown methods ***/
716   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
717   STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
718   STDMETHOD_(ULONG,Release) (THIS) PURE;
719
720   /*** IExtractIcon methods ***/
721   STDMETHOD(GetIconLocation)(THIS_ UINT32 uFlags, LPSTR szIconFile, UINT32 cchMax,INT32 * piIndex, UINT32 * pwFlags) PURE;
722   STDMETHOD(Extract)(THIS_ LPCSTR pszFile, UINT32 nIconIndex, HICON32 *phiconLarge, HICON32 *phiconSmall, UINT32 nIconSize) PURE;
723 }IExtractIcon_VTable,*LPEXTRACTICON_VTABLE;
724
725 struct IExtractIcon 
726 { LPEXTRACTICON_VTABLE lpvtbl;
727   DWORD ref;
728   LPITEMIDLIST pidl;
729 };
730
731 #undef THIS
732
733 DWORD WINAPI SHMapPIDLToSystemImageListIndex(LPSHELLFOLDER sh,LPITEMIDLIST pidl,DWORD z);
734
735 /****************************************************************************
736  * IShellIcon interface
737  */
738
739 #define THIS LPSHELLICON this
740
741 typedef struct IShellIcon_VTable
742 { /*** IUnknown methods ***/
743   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
744   STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
745   STDMETHOD_(ULONG,Release) (THIS) PURE;
746
747   /*** IShellIcon methods ***/
748   STDMETHOD(GetIconOf)(THIS_ LPCITEMIDLIST pidl, UINT32 flags, LPINT32 lpIconIndex) PURE;
749 } IShellIcon_VTable,*LPSHELLICON_VTABLE;
750
751 struct tagSHELLICON
752 { LPSHELLICON_VTABLE lpvtbl;
753   DWORD ref;
754 };
755 #undef THIS
756 /****************************************************************************
757  * IDockingWindowFrame interface
758  */
759 #define THIS LPDOCKINGWINDOWFRAME this
760
761 #define DWFRF_NORMAL            0x0000  /* femove toolbar flags*/
762 #define DWFRF_DELETECONFIGDATA  0x0001
763 #define DWFAF_HIDDEN            0x0001   /* add tolbar*/
764
765 typedef struct IDockingWindowFrame_VTable
766 {   STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
767     STDMETHOD_(ULONG,AddRef) (THIS)  PURE;
768     STDMETHOD_(ULONG,Release) (THIS) PURE;
769
770     /*** IOleWindow methods ***/
771     STDMETHOD(GetWindow) (THIS_ HWND32 * lphwnd) PURE;
772     STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL32 fEnterMode) PURE;
773
774     /*** IDockingWindowFrame methods ***/
775     STDMETHOD(AddToolbar) (THIS_ IUnknown* punkSrc, LPCWSTR pwszItem, DWORD dwAddFlags) PURE;
776     STDMETHOD(RemoveToolbar) (THIS_ IUnknown* punkSrc, DWORD dwRemoveFlags) PURE;
777     STDMETHOD(FindToolbar) (THIS_ LPCWSTR pwszItem, REFIID riid, LPVOID* ppvObj) PURE;
778 } IDockingWindowFrame_VTable, *LPDOCKINGWINDOWFRAME_VTABLE;
779
780 struct tagDOCKINGWINDOWFRAME
781 { LPDOCKINGWINDOWFRAME_VTABLE lpvtbl;
782   DWORD ref;
783 };
784
785 #undef THIS
786 /****************************************************************************
787  * Shell Execute API
788  */
789 #define SE_ERR_FNF              2       /* file not found */
790 #define SE_ERR_PNF              3       /* path not found */
791 #define SE_ERR_ACCESSDENIED     5       /* access denied */
792 #define SE_ERR_OOM              8       /* out of memory */
793 #define SE_ERR_DLLNOTFOUND      32
794 #define SE_ERR_SHARE                    26
795 #define SE_ERR_ASSOCINCOMPLETE          27
796 #define SE_ERR_DDETIMEOUT               28
797 #define SE_ERR_DDEFAIL                  29
798 #define SE_ERR_DDEBUSY                  30
799 #define SE_ERR_NOASSOC                  31
800
801 #define SEE_MASK_CLASSNAME        0x00000001
802 #define SEE_MASK_CLASSKEY         0x00000003
803 #define SEE_MASK_IDLIST           0x00000004
804 #define SEE_MASK_INVOKEIDLIST     0x0000000c
805 #define SEE_MASK_ICON             0x00000010
806 #define SEE_MASK_HOTKEY           0x00000020
807 #define SEE_MASK_NOCLOSEPROCESS   0x00000040
808 #define SEE_MASK_CONNECTNETDRV    0x00000080
809 #define SEE_MASK_FLAG_DDEWAIT     0x00000100
810 #define SEE_MASK_DOENVSUBST       0x00000200
811 #define SEE_MASK_FLAG_NO_UI       0x00000400
812 #define SEE_MASK_UNICODE          0x00004000
813 #define SEE_MASK_NO_CONSOLE       0x00008000
814 #define SEE_MASK_ASYNCOK          0x00100000
815 #define SEE_MASK_HMONITOR         0x00200000
816
817 typedef struct _SHELLEXECUTEINFOA
818 {       DWORD cbSize;
819         ULONG fMask;
820         HWND32 hwnd;
821         LPCSTR   lpVerb;
822         LPCSTR   lpFile;
823         LPCSTR   lpParameters;
824         LPCSTR   lpDirectory;
825        INT32 nShow;
826         HINSTANCE32 hInstApp;
827         /* Optional fields */
828         LPVOID lpIDList;
829         LPCSTR   lpClass;
830         HKEY hkeyClass;
831         DWORD dwHotKey;
832         union 
833         { HANDLE32 hIcon;
834           HANDLE32 hMonitor;
835         } u;
836         HANDLE32 hProcess;
837 } SHELLEXECUTEINFO32A, *LPSHELLEXECUTEINFO32A;
838
839 typedef struct _SHELLEXECUTEINFOW
840 {       DWORD cbSize;
841         ULONG fMask;
842         HWND32 hwnd;
843         LPCWSTR  lpVerb;
844         LPCWSTR  lpFile;
845         LPCWSTR  lpParameters;
846         LPCWSTR  lpDirectory;
847        INT32 nShow;
848         HINSTANCE32 hInstApp;
849         /* Optional fields*/
850         LPVOID lpIDList;
851         LPCWSTR  lpClass;
852         HKEY hkeyClass;
853         DWORD dwHotKey;
854         union
855         { HANDLE32 hIcon;
856           HANDLE32 hMonitor;
857         } u;
858         HANDLE32 hProcess;
859 } SHELLEXECUTEINFO32W, *LPSHELLEXECUTEINFO32W;
860
861 #define SHELLEXECUTEINFO   WINELIB_NAME_AW(SHELLEXECUTEINFO)
862 #define LPSHELLEXECUTEINFO WINELIB_NAME_AW(LPSHELLEXECUTEINFO)
863
864 BOOL32 WINAPI ShellExecuteEx32A(LPSHELLEXECUTEINFO32A lpExecInfo);
865 BOOL32 WINAPI ShellExecuteEx32W(LPSHELLEXECUTEINFO32W lpExecInfo);
866 #define ShellExecuteEx  WINELIB_NAME_AW(ShellExecuteEx)
867
868 void WINAPI WinExecError32A(HWND32 hwnd,INT32 error, LPCSTR lpstrFileName, LPCSTR lpstrTitle);
869 void WINAPI WinExecError32W(HWND32 hwnd,INT32 error, LPCWSTR lpstrFileName, LPCWSTR lpstrTitle);
870 #define WinExecError  WINELIB_NAME_AW(WinExecError)
871
872
873
874 /****************************************************************************
875  * SHBrowseForFolder API
876  */
877 typedef INT32 (CALLBACK* BFFCALLBACK)(HWND32 hwnd, UINT32 uMsg, LPARAM lParam, LPARAM lpData);
878
879 typedef struct tagBROWSEINFO32A {
880     HWND32        hwndOwner;
881     LPCITEMIDLIST pidlRoot;
882     LPSTR         pszDisplayName;
883     LPCSTR        lpszTitle;
884     UINT32        ulFlags;
885     BFFCALLBACK   lpfn;
886     LPARAM        lParam;
887         INT32         iImage;
888 } BROWSEINFO32A, *PBROWSEINFO32A, *LPBROWSEINFO32A;
889
890 typedef struct tagBROWSEINFO32W {
891     HWND32        hwndOwner;
892     LPCITEMIDLIST pidlRoot;
893     LPWSTR        pszDisplayName;
894     LPCWSTR       lpszTitle;
895     UINT32        ulFlags;
896     BFFCALLBACK   lpfn;
897     LPARAM        lParam;
898         INT32         iImage;
899 } BROWSEINFO32W, *PBROWSEINFO32W, *LPBROWSEINFO32W; 
900
901 #define BROWSEINFO   WINELIB_NAME_AW(BROWSEINFO)
902 #define PBROWSEINFO  WINELIB_NAME_AW(PBROWSEINFO)
903 #define LPBROWSEINFO WINELIB_NAME_AW(LPBROWSEINFO)
904
905 /* Browsing for directory. */
906 #define BIF_RETURNONLYFSDIRS   0x0001
907 #define BIF_DONTGOBELOWDOMAIN  0x0002
908 #define BIF_STATUSTEXT         0x0004
909 #define BIF_RETURNFSANCESTORS  0x0008
910 #define BIF_EDITBOX            0x0010
911 #define BIF_VALIDATE           0x0020
912  
913 #define BIF_BROWSEFORCOMPUTER  0x1000
914 #define BIF_BROWSEFORPRINTER   0x2000
915 #define BIF_BROWSEINCLUDEFILES 0x4000
916
917 /* message from browser */
918 #define BFFM_INITIALIZED        1
919 #define BFFM_SELCHANGED         2
920 #define BFFM_VALIDATEFAILEDA    3   /* lParam:szPath ret:1(cont),0(EndDialog) */
921 #define BFFM_VALIDATEFAILEDW    4   /* lParam:wzPath ret:1(cont),0(EndDialog) */
922
923 /* messages to browser */
924 #define BFFM_SETSTATUSTEXTA     (WM_USER+100)
925 #define BFFM_ENABLEOK           (WM_USER+101)
926 #define BFFM_SETSELECTIONA      (WM_USER+102)
927 #define BFFM_SETSELECTIONW      (WM_USER+103)
928 #define BFFM_SETSTATUSTEXTW     (WM_USER+104)
929
930 /*
931 #ifdef UNICODE
932 #define SHBrowseForFolder   SHBrowseForFolderW
933 #define BFFM_SETSTATUSTEXT  BFFM_SETSTATUSTEXTW
934 #define BFFM_SETSELECTION   BFFM_SETSELECTIONW
935
936 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
937 #else
938 #define SHBrowseForFolder   SHBrowseForFolderA
939 #define BFFM_SETSTATUSTEXT  BFFM_SETSTATUSTEXTA
940 #define BFFM_SETSELECTION   BFFM_SETSELECTIONA
941
942 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA 
943 #endif 
944 */
945
946 LPITEMIDLIST WINAPI SHBrowseForFolder32A(LPBROWSEINFO32A lpbi);
947 /*LPITEMIDLIST WINAPI SHBrowseForFolder32W(LPBROWSEINFO32W lpbi);*/
948 #define  SHBrowseForFolder WINELIB_NAME_AW(SHBrowseForFolder)
949
950 /****************************************************************************
951 *       SHGetDataFromIDList API
952 */
953 #define SHGDFIL_FINDDATA        1
954 #define SHGDFIL_NETRESOURCE     2
955 #define SHGDFIL_DESCRIPTIONID   3
956
957 #define SHDID_ROOT_REGITEM          1
958 #define SHDID_FS_FILE               2
959 #define SHDID_FS_DIRECTORY          3
960 #define SHDID_FS_OTHER              4
961 #define SHDID_COMPUTER_DRIVE35      5
962 #define SHDID_COMPUTER_DRIVE525     6
963 #define SHDID_COMPUTER_REMOVABLE    7
964 #define SHDID_COMPUTER_FIXED        8
965 #define SHDID_COMPUTER_NETDRIVE     9
966 #define SHDID_COMPUTER_CDROM        10
967 #define SHDID_COMPUTER_RAMDISK      11
968 #define SHDID_COMPUTER_OTHER        12
969 #define SHDID_NET_DOMAIN            13
970 #define SHDID_NET_SERVER            14
971 #define SHDID_NET_SHARE             15
972 #define SHDID_NET_RESTOFNET         16
973 #define SHDID_NET_OTHER             17
974
975 typedef struct _SHDESCRIPTIONID 
976 {   DWORD   dwDescriptionId;
977     CLSID   clsid;
978 } SHDESCRIPTIONID, *LPSHDESCRIPTIONID;
979
980 HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID pv, int cb);
981 HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID pv, int cb);
982 #define  SHGetDataFromIDList WINELIB_NAME_AW(SHGetDataFromIDList)
983
984
985 /****************************************************************************
986 * shlview structures
987 */
988
989 /*
990 * IShellFolderViewCallback Callback
991 *  This "callback" is called by the shells default IShellView implementation (that
992 *  we got using SHCreateShellViewEx()), to notify us of the various things that
993 *  are happening to the shellview (and ask for things too).
994 *
995 *  You don't have to support anything here - anything you don't want to 
996 *  handle, the shell will do itself if you just return E_NOTIMPL. This parameters
997 *  that the shell passes to this function are entirely undocumented.
998 *
999 *  HOWEVER, as the cabview sample as originally written used this callback, the
1000 *  writers implemented the callback mechanism on top of their own IShellView.
1001 *  Look there for some clues on what to do here.
1002 */
1003
1004 typedef HRESULT(CALLBACK *SHELLVIEWPROC)(DWORD dwUserParam,LPSHELLFOLDER psf,
1005                          HWND32 hwnd,UINT32 uMsg,UINT32 wParam,LPARAM lParam);
1006
1007 /* NF valid values for the "viewmode" item of the SHELLTEMPLATE*/
1008 #define NF_INHERITVIEW    0x0000
1009 #define NF_LOCALVIEW        0x0001
1010
1011 typedef struct _SHELLVIEWDATA   /* idl */
1012 { DWORD           dwSize;
1013   LPSHELLFOLDER   pShellFolder;
1014   DWORD           dwUserParam;
1015   LPCITEMIDLIST   pidl;
1016   DWORD           v3;        /* always 0 */
1017   SHELLVIEWPROC   pCallBack;
1018   DWORD           viewmode;  /* NF_* enum */
1019 } SHELLVIEWDATA, * LPSHELLVIEWDATA;
1020
1021 /*
1022  The shell keeps track of some per-user state to handle display
1023  options that is of majorinterest to ISVs.
1024  The key one requested right now is "DoubleClickInWebView".
1025 */
1026 typedef struct 
1027 {   BOOL32 fShowAllObjects : 1;
1028     BOOL32 fShowExtensions : 1;
1029     BOOL32 fNoConfirmRecycle : 1;
1030     BOOL32 fShowSysFiles : 1;
1031     BOOL32 fShowCompColor : 1;
1032     BOOL32 fDoubleClickInWebView : 1;
1033     BOOL32 fDesktopHTML : 1;
1034     BOOL32 fWin95Classic : 1;
1035     BOOL32 fDontPrettyPath : 1;
1036     BOOL32 fShowAttribCol : 1;
1037     BOOL32 fMapNetDrvBtn : 1;
1038     BOOL32 fShowInfoTip : 1;
1039     BOOL32 fHideIcons : 1;
1040     UINT32 fRestFlags : 3;
1041 } SHELLFLAGSTATE, * LPSHELLFLAGSTATE;
1042
1043
1044 DWORD WINAPI SHGetMalloc(LPMALLOC32 *lpmal) ;
1045
1046 #undef PURE
1047 #undef FAR
1048 #undef THIS
1049 #undef THIS_
1050 #undef STDMETHOD
1051 #undef STDMETHOD_
1052
1053 #endif /* __WINE_SHLOBJ_H */