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