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