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