Implemented guard pages and stack overflow exceptions.
[wine/multimedia.git] / include / shlobj.h
blobf245399ad3970cded16667ba3fc00cc5d8b0fee1
1 #ifndef __WINE_SHLOBJ_H
2 #define __WINE_SHLOBJ_H
4 #include "wine/obj_base.h"
5 #include "wine/obj_shelllink.h"
6 #include "wine/obj_shellfolder.h"
7 #include "wine/obj_shellbrowser.h"
8 #include "wine/obj_contextmenu.h"
9 #include "wine/obj_shellextinit.h"
10 #include "wine/obj_extracticon.h"
11 #include "wine/obj_commdlgbrowser.h"
12 #include "wine/obj_dockingwindowframe.h"
14 #include "windef.h"
15 #include "winbase.h" /* WIN32_FIND_* */
16 #include "ole2.h"
17 #include "shell.h"
18 #include "commctrl.h"
19 #include "prsht.h"
21 #ifdef __cplusplus
22 extern "C" {
23 #endif /* defined(__cplusplus) */
25 /*****************************************************************************
26 * Predeclare interfaces
28 typedef struct IShellIcon IShellIcon, *LPSHELLICON;
31 /*****************************************************************************
32 * IContextMenu interface
36 /* DATAOBJECT_InitShellIDList*/
37 #define CFSTR_SHELLIDLIST "Shell IDList Array" /* CF_IDLIST */
39 extern UINT cfShellIDList;
41 typedef struct
42 { UINT cidl;
43 UINT aoffset[1];
44 } CIDA, *LPCIDA,*LPIDA;
46 #define CFSTR_SHELLIDLISTOFFSET "Shell Object Offsets" /* CF_OBJECTPOSITIONS */
47 #define CFSTR_NETRESOURCES "Net Resource" /* CF_NETRESOURCE */
49 /* DATAOBJECT_InitFileGroupDesc */
50 #define CFSTR_FILEDESCRIPTORA "FileGroupDescriptor" /* CF_FILEGROUPDESCRIPTORA */
51 extern UINT cfFileGroupDesc;
53 #define CFSTR_FILEDESCRIPTORW "FileGroupDescriptorW" /* CF_FILEGROUPDESCRIPTORW */
55 /* DATAOBJECT_InitFileContents*/
56 #define CFSTR_FILECONTENTS "FileContents" /* CF_FILECONTENTS */
57 extern UINT cfFileContents;
59 #define CFSTR_FILENAMEA "FileName" /* CF_FILENAMEA */
60 #define CFSTR_FILENAMEW "FileNameW" /* CF_FILENAMEW */
61 #define CFSTR_PRINTERGROUP "PrinterFriendlyName" /* CF_PRINTERS */
62 #define CFSTR_FILENAMEMAPA "FileNameMap" /* CF_FILENAMEMAPA */
63 #define CFSTR_FILENAMEMAPW "FileNameMapW" /* CF_FILENAMEMAPW */
64 #define CFSTR_SHELLURL "UniformResourceLocator"
65 #define CFSTR_PREFERREDDROPEFFECT "Preferred DropEffect"
66 #define CFSTR_PERFORMEDDROPEFFECT "Performed DropEffect"
67 #define CFSTR_PASTESUCCEEDED "Paste Succeeded"
68 #define CFSTR_INDRAGLOOP "InShellDragLoop"
71 /************************************************************************
72 * IShellView interface
77 typedef GUID SHELLVIEWID;
78 #define SV_CLASS_NAME ("SHELLDLL_DefView")
80 UINT WINAPI SHMapPIDLToSystemImageListIndex(LPSHELLFOLDER sh, LPITEMIDLIST pidl, UINT * pIndex);
82 /****************************************************************************
83 * IShellIcon interface
86 #define ICOM_INTERFACE IShellIcon
87 #define IShellIcon_METHODS \
88 ICOM_METHOD3(HRESULT, GetIconOf, LPCITEMIDLIST,pidl, UINT,flags, LPINT,lpIconIndex)
89 #define IShellIcon_IMETHODS \
90 IUnknown_IMETHODS \
91 IShellIcon_METHODS
92 ICOM_DEFINE(IShellIcon, IUnknown)
93 #undef ICOM_INTERFACE
95 /*** IUnknown methods ***/
96 #define IShellIcon_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
97 #define IShellIcon_AddRef(p) ICOM_CALL (AddRef,p)
98 #define IShellIcon_Release(p) ICOM_CALL (Release,p)
99 /*** IShellIcon methods ***/
100 #define IShellIcon_GetIconOf(p,a,b,c) ICOM_CALL3(GetIconOf,p,a,b,c)
102 /****************************************************************************
103 * Shell Execute API
105 #define SE_ERR_FNF 2 /* file not found */
106 #define SE_ERR_PNF 3 /* path not found */
107 #define SE_ERR_ACCESSDENIED 5 /* access denied */
108 #define SE_ERR_OOM 8 /* out of memory */
109 #define SE_ERR_DLLNOTFOUND 32
110 #define SE_ERR_SHARE 26
111 #define SE_ERR_ASSOCINCOMPLETE 27
112 #define SE_ERR_DDETIMEOUT 28
113 #define SE_ERR_DDEFAIL 29
114 #define SE_ERR_DDEBUSY 30
115 #define SE_ERR_NOASSOC 31
117 #define SEE_MASK_CLASSNAME 0x00000001
118 #define SEE_MASK_CLASSKEY 0x00000003
119 #define SEE_MASK_IDLIST 0x00000004
120 #define SEE_MASK_INVOKEIDLIST 0x0000000c
121 #define SEE_MASK_ICON 0x00000010
122 #define SEE_MASK_HOTKEY 0x00000020
123 #define SEE_MASK_NOCLOSEPROCESS 0x00000040
124 #define SEE_MASK_CONNECTNETDRV 0x00000080
125 #define SEE_MASK_FLAG_DDEWAIT 0x00000100
126 #define SEE_MASK_DOENVSUBST 0x00000200
127 #define SEE_MASK_FLAG_NO_UI 0x00000400
128 #define SEE_MASK_UNICODE 0x00004000
129 #define SEE_MASK_NO_CONSOLE 0x00008000
130 #define SEE_MASK_ASYNCOK 0x00100000
131 #define SEE_MASK_HMONITOR 0x00200000
133 typedef struct _SHELLEXECUTEINFOA
134 { DWORD cbSize;
135 ULONG fMask;
136 HWND hwnd;
137 LPCSTR lpVerb;
138 LPCSTR lpFile;
139 LPCSTR lpParameters;
140 LPCSTR lpDirectory;
141 INT nShow;
142 HINSTANCE hInstApp;
143 /* Optional fields */
144 LPVOID lpIDList;
145 LPCSTR lpClass;
146 HKEY hkeyClass;
147 DWORD dwHotKey;
148 union
149 { HANDLE hIcon;
150 HANDLE hMonitor;
151 } DUMMYUNIONNAME;
152 HANDLE hProcess;
153 } SHELLEXECUTEINFOA, *LPSHELLEXECUTEINFOA;
155 typedef struct _SHELLEXECUTEINFOW
156 { DWORD cbSize;
157 ULONG fMask;
158 HWND hwnd;
159 LPCWSTR lpVerb;
160 LPCWSTR lpFile;
161 LPCWSTR lpParameters;
162 LPCWSTR lpDirectory;
163 INT nShow;
164 HINSTANCE hInstApp;
165 /* Optional fields*/
166 LPVOID lpIDList;
167 LPCWSTR lpClass;
168 HKEY hkeyClass;
169 DWORD dwHotKey;
170 union
171 { HANDLE hIcon;
172 HANDLE hMonitor;
173 } DUMMYUNIONNAME;
174 HANDLE hProcess;
175 } SHELLEXECUTEINFOW, *LPSHELLEXECUTEINFOW;
177 #define SHELLEXECUTEINFO WINELIB_NAME_AW(SHELLEXECUTEINFO)
178 #define LPSHELLEXECUTEINFO WINELIB_NAME_AW(LPSHELLEXECUTEINFO)
180 BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA lpExecInfo);
181 BOOL WINAPI ShellExecuteExW(LPSHELLEXECUTEINFOW lpExecInfo);
182 #define ShellExecuteEx WINELIB_NAME_AW(ShellExecuteEx)
184 void WINAPI WinExecErrorA(HWND hwnd,INT error, LPCSTR lpstrFileName, LPCSTR lpstrTitle);
185 void WINAPI WinExecErrorW(HWND hwnd,INT error, LPCWSTR lpstrFileName, LPCWSTR lpstrTitle);
186 #define WinExecError WINELIB_NAME_AW(WinExecError)
190 /****************************************************************************
191 * SHBrowseForFolder API
193 typedef INT (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
195 typedef struct tagBROWSEINFOA {
196 HWND hwndOwner;
197 LPCITEMIDLIST pidlRoot;
198 LPSTR pszDisplayName;
199 LPCSTR lpszTitle;
200 UINT ulFlags;
201 BFFCALLBACK lpfn;
202 LPARAM lParam;
203 INT iImage;
204 } BROWSEINFOA, *PBROWSEINFOA, *LPBROWSEINFOA;
206 typedef struct tagBROWSEINFOW {
207 HWND hwndOwner;
208 LPCITEMIDLIST pidlRoot;
209 LPWSTR pszDisplayName;
210 LPCWSTR lpszTitle;
211 UINT ulFlags;
212 BFFCALLBACK lpfn;
213 LPARAM lParam;
214 INT iImage;
215 } BROWSEINFOW, *PBROWSEINFOW, *LPBROWSEINFOW;
217 #define BROWSEINFO WINELIB_NAME_AW(BROWSEINFO)
218 #define PBROWSEINFO WINELIB_NAME_AW(PBROWSEINFO)
219 #define LPBROWSEINFO WINELIB_NAME_AW(LPBROWSEINFO)
221 /* Browsing for directory. */
222 #define BIF_RETURNONLYFSDIRS 0x0001
223 #define BIF_DONTGOBELOWDOMAIN 0x0002
224 #define BIF_STATUSTEXT 0x0004
225 #define BIF_RETURNFSANCESTORS 0x0008
226 #define BIF_EDITBOX 0x0010
227 #define BIF_VALIDATE 0x0020
229 #define BIF_BROWSEFORCOMPUTER 0x1000
230 #define BIF_BROWSEFORPRINTER 0x2000
231 #define BIF_BROWSEINCLUDEFILES 0x4000
233 /* message from browser */
234 #define BFFM_INITIALIZED 1
235 #define BFFM_SELCHANGED 2
236 #define BFFM_VALIDATEFAILEDA 3 /* lParam:szPath ret:1(cont),0(EndDialog) */
237 #define BFFM_VALIDATEFAILEDW 4 /* lParam:wzPath ret:1(cont),0(EndDialog) */
239 /* messages to browser */
240 #define BFFM_SETSTATUSTEXTA (WM_USER+100)
241 #define BFFM_ENABLEOK (WM_USER+101)
242 #define BFFM_SETSELECTIONA (WM_USER+102)
243 #define BFFM_SETSELECTIONW (WM_USER+103)
244 #define BFFM_SETSTATUSTEXTW (WM_USER+104)
247 #ifdef UNICODE
248 #define SHBrowseForFolder SHBrowseForFolderW
249 #define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTW
250 #define BFFM_SETSELECTION BFFM_SETSELECTIONW
252 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
253 #else
254 #define SHBrowseForFolder SHBrowseForFolderA
255 #define BFFM_SETSTATUSTEXT BFFM_SETSTATUSTEXTA
256 #define BFFM_SETSELECTION BFFM_SETSELECTIONA
258 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA
259 #endif
262 LPITEMIDLIST WINAPI SHBrowseForFolderA(LPBROWSEINFOA lpbi);
263 LPITEMIDLIST WINAPI SHBrowseForFolder32W(LPBROWSEINFOW lpbi);
264 #define SHBrowseForFolder WINELIB_NAME_AW(SHBrowseForFolder)
266 /****************************************************************************
267 * SHGetDataFromIDList API
269 #define SHGDFIL_FINDDATA 1
270 #define SHGDFIL_NETRESOURCE 2
271 #define SHGDFIL_DESCRIPTIONID 3
273 #define SHDID_ROOT_REGITEM 1
274 #define SHDID_FS_FILE 2
275 #define SHDID_FS_DIRECTORY 3
276 #define SHDID_FS_OTHER 4
277 #define SHDID_COMPUTER_DRIVE35 5
278 #define SHDID_COMPUTER_DRIVE525 6
279 #define SHDID_COMPUTER_REMOVABLE 7
280 #define SHDID_COMPUTER_FIXED 8
281 #define SHDID_COMPUTER_NETDRIVE 9
282 #define SHDID_COMPUTER_CDROM 10
283 #define SHDID_COMPUTER_RAMDISK 11
284 #define SHDID_COMPUTER_OTHER 12
285 #define SHDID_NET_DOMAIN 13
286 #define SHDID_NET_SERVER 14
287 #define SHDID_NET_SHARE 15
288 #define SHDID_NET_RESTOFNET 16
289 #define SHDID_NET_OTHER 17
291 typedef struct _SHDESCRIPTIONID
292 { DWORD dwDescriptionId;
293 CLSID clsid;
294 } SHDESCRIPTIONID, *LPSHDESCRIPTIONID;
296 HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID pv, int cb);
297 HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID pv, int cb);
298 #define SHGetDataFromIDList WINELIB_NAME_AW(SHGetDataFromIDList)
300 BOOL WINAPI SHGetSpecialFolderPathA (HWND hwndOwner,LPSTR szPath,DWORD csidl,BOOL bCreate);
301 BOOL WINAPI SHGetSpecialFolderPathW (HWND hwndOwner,LPWSTR szPath,DWORD csidl,BOOL bCreate);
302 #define SHGetSpecialFolderPath WINELIB_NAME_AW(SHGetSpecialFolderPath)
304 HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST * ppidl);
306 /****************************************************************************
307 * shlview structures
311 * IShellFolderViewCallback Callback
312 * This "callback" is called by the shells default IShellView implementation (that
313 * we got using SHCreateShellViewEx()), to notify us of the various things that
314 * are happening to the shellview (and ask for things too).
316 * You don't have to support anything here - anything you don't want to
317 * handle, the shell will do itself if you just return E_NOTIMPL. This parameters
318 * that the shell passes to this function are entirely undocumented.
320 * HOWEVER, as the cabview sample as originally written used this callback, the
321 * writers implemented the callback mechanism on top of their own IShellView.
322 * Look there for some clues on what to do here.
325 typedef HRESULT(CALLBACK *SHELLVIEWPROC)(DWORD dwUserParam,LPSHELLFOLDER psf,
326 HWND hwnd,UINT uMsg,UINT wParam,LPARAM lParam);
328 /* NF valid values for the "viewmode" item of the SHELLTEMPLATE*/
329 #define NF_INHERITVIEW 0x0000
330 #define NF_LOCALVIEW 0x0001
332 typedef struct _SHELLVIEWDATA /* idl */
333 { DWORD dwSize;
334 LPSHELLFOLDER pShellFolder;
335 DWORD dwUserParam;
336 LPCITEMIDLIST pidl;
337 DWORD v3; /* always 0 */
338 SHELLVIEWPROC pCallBack;
339 DWORD viewmode; /* NF_* enum */
340 } SHELLVIEWDATA, * LPSHELLVIEWDATA;
342 DWORD WINAPI SHGetMalloc(LPMALLOC *lpmal) ;
344 /****************************************************************************
345 * Shell File Menu API
347 /* FileMenu_Create nSelHeight */
348 #define FM_FULL_SELHEIGHT -1;
349 #define FM_DEFAULT_SELHEIGHT 0
351 /* FileMenu_Create uFlags */
352 #define FMF_SMALL_ICONS 0x00
353 #define FMF_LARGE_ICONS 0x08
354 #define FMF_NO_COLUMN_BREAK 0x10
356 /* FileMenu_InsertUsingPidl uFlags */
357 #define FMF_NO_EMPTY_ITEM 0x01
358 #define FMF_NO_PROGRAM_GROUPS 0x04
360 typedef void (CALLBACK * LPFNFMCALLBACK)(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlFile);
362 /* FileMenu_AppendItem lpszText */
363 #define FM_SEPARATOR (LPCSTR)1
364 #define FM_BLANK_ICON -1
365 #define FM_DEFAULT_HEIGHT 0
367 /**********************************************************************
368 * SHGetSettings ()
370 typedef struct
371 { BOOL fShowAllObjects : 1;
372 BOOL fShowExtensions : 1;
373 BOOL fNoConfirmRecycle : 1;
374 BOOL fShowSysFiles : 1;
376 BOOL fShowCompColor : 1;
377 BOOL fDoubleClickInWebView : 1;
378 BOOL fDesktopHTML : 1;
379 BOOL fWin95Classic : 1;
381 BOOL fDontPrettyPath : 1;
382 BOOL fShowAttribCol : 1;
383 BOOL fMapNetDrvBtn : 1;
384 BOOL fShowInfoTip : 1;
386 BOOL fHideIcons : 1;
387 UINT fRestFlags : 3;
388 } SHELLFLAGSTATE, * LPSHELLFLAGSTATE;
390 void WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask, DWORD dwx);
392 #define SSF_SHOWALLOBJECTS 0x0001
393 #define SSF_SHOWEXTENSIONS 0x0002
394 #define SSF_SHOWCOMPCOLOR 0x0008
395 #define SSF_SHOWSYSFILES 0x0020
396 #define SSF_DOUBLECLICKINWEBVIEW 0x0080
397 #define SSF_SHOWATTRIBCOL 0x0100
398 #define SSF_DESKTOPHTML 0x0200
399 #define SSF_WIN95CLASSIC 0x0400
400 #define SSF_DONTPRETTYPATH 0x0800
401 #define SSF_SHOWINFOTIP 0x2000
402 #define SSF_MAPNETDRVBUTTON 0x1000
403 #define SSF_NOCONFIRMRECYCLE 0x8000
404 #define SSF_HIDEICONS 0x4000
406 /**********************************************************************
407 * SHChangeNotify
409 #define SHCNE_RENAMEITEM 0x00000001
410 #define SHCNE_CREATE 0x00000002
411 #define SHCNE_DELETE 0x00000004
412 #define SHCNE_MKDIR 0x00000008
413 #define SHCNE_RMDIR 0x00000010
414 #define SHCNE_MEDIAINSERTED 0x00000020
415 #define SHCNE_MEDIAREMOVED 0x00000040
416 #define SHCNE_DRIVEREMOVED 0x00000080
417 #define SHCNE_DRIVEADD 0x00000100
418 #define SHCNE_NETSHARE 0x00000200
419 #define SHCNE_NETUNSHARE 0x00000400
420 #define SHCNE_ATTRIBUTES 0x00000800
421 #define SHCNE_UPDATEDIR 0x00001000
422 #define SHCNE_UPDATEITEM 0x00002000
423 #define SHCNE_SERVERDISCONNECT 0x00004000
424 #define SHCNE_UPDATEIMAGE 0x00008000
425 #define SHCNE_DRIVEADDGUI 0x00010000
426 #define SHCNE_RENAMEFOLDER 0x00020000
427 #define SHCNE_FREESPACE 0x00040000
429 #define SHCNE_EXTENDED_EVENT 0x04000000
430 #define SHCNE_ASSOCCHANGED 0x08000000
431 #define SHCNE_DISKEVENTS 0x0002381F
432 #define SHCNE_GLOBALEVENTS 0x0C0581E0
433 #define SHCNE_ALLEVENTS 0x7FFFFFFF
434 #define SHCNE_INTERRUPT 0x80000000
436 #define SHCNEE_ORDERCHANGED 0x00000002
438 #define SHCNF_IDLIST 0x0000
439 #define SHCNF_PATHA 0x0001
440 #define SHCNF_PRINTERA 0x0002
441 #define SHCNF_DWORD 0x0003
442 #define SHCNF_PATHW 0x0005
443 #define SHCNF_PRINTERW 0x0006
444 #define SHCNF_TYPE 0x00FF
445 #define SHCNF_FLUSH 0x1000
446 #define SHCNF_FLUSHNOWAIT 0x2000
448 void WINAPI SHChangeNotifyA(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2);
449 void WINAPI SHChangeNotifyW(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2);
450 #define SHChangeNotify WINELIB_NAME_AW(SHChangeNotify)
452 /**********************************************************************/
454 #ifdef __cplusplus
455 } /* extern "C" */
456 #endif /* defined(__cplusplus) */
458 #endif /* __WINE_SHLOBJ_H */