Release 990613.
[wine] / include / shlobj.h
1 #ifndef __WINE_SHLOBJ_H
2 #define __WINE_SHLOBJ_H
3
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"
13
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"
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif /* defined(__cplusplus) */
24
25 /*****************************************************************************
26  * Predeclare interfaces
27  */
28 typedef struct IShellIcon IShellIcon, *LPSHELLICON;
29
30
31 /*****************************************************************************
32  * IContextMenu interface
33  */
34
35
36 /* DATAOBJECT_InitShellIDList*/
37 #define CFSTR_SHELLIDLIST       "Shell IDList Array"      /* CF_IDLIST */
38
39 extern UINT cfShellIDList;
40
41 typedef struct
42 {       UINT cidl;
43         UINT aoffset[1];
44 } CIDA, *LPCIDA;
45
46 #define CFSTR_SHELLIDLISTOFFSET "Shell Object Offsets"    /* CF_OBJECTPOSITIONS */
47 #define CFSTR_NETRESOURCES      "Net Resource"            /* CF_NETRESOURCE */
48
49 /* DATAOBJECT_InitFileGroupDesc */
50 #define CFSTR_FILEDESCRIPTORA   "FileGroupDescriptor"     /* CF_FILEGROUPDESCRIPTORA */
51 extern UINT cfFileGroupDesc;
52
53 #define CFSTR_FILEDESCRIPTORW   "FileGroupDescriptorW"    /* CF_FILEGROUPDESCRIPTORW */
54
55 /* DATAOBJECT_InitFileContents*/
56 #define CFSTR_FILECONTENTS      "FileContents"            /* CF_FILECONTENTS */
57 extern UINT cfFileContents;
58
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"
69
70
71 /************************************************************************
72 * IShellView interface
73 */
74
75
76
77 typedef GUID SHELLVIEWID;
78 #define SV_CLASS_NAME   ("SHELLDLL_DefView")
79
80 UINT WINAPI SHMapPIDLToSystemImageListIndex(LPSHELLFOLDER sh, LPITEMIDLIST pidl, UINT * pIndex);
81
82 /****************************************************************************
83  * IShellIcon interface
84  */
85
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
94
95 #ifdef ICOM_CINTERFACE
96 /*** IUnknown methods ***/
97 #define IShellIcon_QueryInterface(p,a,b)      ICOM_CALL2(QueryInterface,p,a,b)
98 #define IShellIcon_AddRef(p)                  ICOM_CALL (AddRef,p)
99 #define IShellIcon_Release(p)                 ICOM_CALL (Release,p)
100 /*** IShellIcon methods ***/
101 #define IShellIcon_GetIconOf(p,a,b,c)         ICOM_CALL3(GetIconOf,p,a,b,c)
102 #endif
103
104 /****************************************************************************
105  * Shell Execute API
106  */
107 #define SE_ERR_FNF              2       /* file not found */
108 #define SE_ERR_PNF              3       /* path not found */
109 #define SE_ERR_ACCESSDENIED     5       /* access denied */
110 #define SE_ERR_OOM              8       /* out of memory */
111 #define SE_ERR_DLLNOTFOUND      32
112 #define SE_ERR_SHARE                    26
113 #define SE_ERR_ASSOCINCOMPLETE          27
114 #define SE_ERR_DDETIMEOUT               28
115 #define SE_ERR_DDEFAIL                  29
116 #define SE_ERR_DDEBUSY                  30
117 #define SE_ERR_NOASSOC                  31
118
119 #define SEE_MASK_CLASSNAME        0x00000001
120 #define SEE_MASK_CLASSKEY         0x00000003
121 #define SEE_MASK_IDLIST           0x00000004
122 #define SEE_MASK_INVOKEIDLIST     0x0000000c
123 #define SEE_MASK_ICON             0x00000010
124 #define SEE_MASK_HOTKEY           0x00000020
125 #define SEE_MASK_NOCLOSEPROCESS   0x00000040
126 #define SEE_MASK_CONNECTNETDRV    0x00000080
127 #define SEE_MASK_FLAG_DDEWAIT     0x00000100
128 #define SEE_MASK_DOENVSUBST       0x00000200
129 #define SEE_MASK_FLAG_NO_UI       0x00000400
130 #define SEE_MASK_UNICODE          0x00004000
131 #define SEE_MASK_NO_CONSOLE       0x00008000
132 #define SEE_MASK_ASYNCOK          0x00100000
133 #define SEE_MASK_HMONITOR         0x00200000
134
135 typedef struct _SHELLEXECUTEINFOA
136 {       DWORD cbSize;
137         ULONG fMask;
138         HWND hwnd;
139         LPCSTR   lpVerb;
140         LPCSTR   lpFile;
141         LPCSTR   lpParameters;
142         LPCSTR   lpDirectory;
143        INT nShow;
144         HINSTANCE hInstApp;
145         /* Optional fields */
146         LPVOID lpIDList;
147         LPCSTR   lpClass;
148         HKEY hkeyClass;
149         DWORD dwHotKey;
150         union 
151         { HANDLE hIcon;
152           HANDLE hMonitor;
153         } u;
154         HANDLE hProcess;
155 } SHELLEXECUTEINFOA, *LPSHELLEXECUTEINFOA;
156
157 typedef struct _SHELLEXECUTEINFOW
158 {       DWORD cbSize;
159         ULONG fMask;
160         HWND hwnd;
161         LPCWSTR  lpVerb;
162         LPCWSTR  lpFile;
163         LPCWSTR  lpParameters;
164         LPCWSTR  lpDirectory;
165        INT nShow;
166         HINSTANCE hInstApp;
167         /* Optional fields*/
168         LPVOID lpIDList;
169         LPCWSTR  lpClass;
170         HKEY hkeyClass;
171         DWORD dwHotKey;
172         union
173         { HANDLE hIcon;
174           HANDLE hMonitor;
175         } u;
176         HANDLE hProcess;
177 } SHELLEXECUTEINFOW, *LPSHELLEXECUTEINFOW;
178
179 #define SHELLEXECUTEINFO   WINELIB_NAME_AW(SHELLEXECUTEINFO)
180 #define LPSHELLEXECUTEINFO WINELIB_NAME_AW(LPSHELLEXECUTEINFO)
181
182 BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA lpExecInfo);
183 BOOL WINAPI ShellExecuteExW(LPSHELLEXECUTEINFOW lpExecInfo);
184 #define ShellExecuteEx  WINELIB_NAME_AW(ShellExecuteEx)
185
186 void WINAPI WinExecErrorA(HWND hwnd,INT error, LPCSTR lpstrFileName, LPCSTR lpstrTitle);
187 void WINAPI WinExecErrorW(HWND hwnd,INT error, LPCWSTR lpstrFileName, LPCWSTR lpstrTitle);
188 #define WinExecError  WINELIB_NAME_AW(WinExecError)
189
190
191
192 /****************************************************************************
193  * SHBrowseForFolder API
194  */
195 typedef INT (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
196
197 typedef struct tagBROWSEINFOA {
198     HWND        hwndOwner;
199     LPCITEMIDLIST pidlRoot;
200     LPSTR         pszDisplayName;
201     LPCSTR        lpszTitle;
202     UINT        ulFlags;
203     BFFCALLBACK   lpfn;
204     LPARAM        lParam;
205         INT         iImage;
206 } BROWSEINFOA, *PBROWSEINFOA, *LPBROWSEINFOA;
207
208 typedef struct tagBROWSEINFOW {
209     HWND        hwndOwner;
210     LPCITEMIDLIST pidlRoot;
211     LPWSTR        pszDisplayName;
212     LPCWSTR       lpszTitle;
213     UINT        ulFlags;
214     BFFCALLBACK   lpfn;
215     LPARAM        lParam;
216         INT         iImage;
217 } BROWSEINFOW, *PBROWSEINFOW, *LPBROWSEINFOW; 
218
219 #define BROWSEINFO   WINELIB_NAME_AW(BROWSEINFO)
220 #define PBROWSEINFO  WINELIB_NAME_AW(PBROWSEINFO)
221 #define LPBROWSEINFO WINELIB_NAME_AW(LPBROWSEINFO)
222
223 /* Browsing for directory. */
224 #define BIF_RETURNONLYFSDIRS   0x0001
225 #define BIF_DONTGOBELOWDOMAIN  0x0002
226 #define BIF_STATUSTEXT         0x0004
227 #define BIF_RETURNFSANCESTORS  0x0008
228 #define BIF_EDITBOX            0x0010
229 #define BIF_VALIDATE           0x0020
230  
231 #define BIF_BROWSEFORCOMPUTER  0x1000
232 #define BIF_BROWSEFORPRINTER   0x2000
233 #define BIF_BROWSEINCLUDEFILES 0x4000
234
235 /* message from browser */
236 #define BFFM_INITIALIZED        1
237 #define BFFM_SELCHANGED         2
238 #define BFFM_VALIDATEFAILEDA    3   /* lParam:szPath ret:1(cont),0(EndDialog) */
239 #define BFFM_VALIDATEFAILEDW    4   /* lParam:wzPath ret:1(cont),0(EndDialog) */
240
241 /* messages to browser */
242 #define BFFM_SETSTATUSTEXTA     (WM_USER+100)
243 #define BFFM_ENABLEOK           (WM_USER+101)
244 #define BFFM_SETSELECTIONA      (WM_USER+102)
245 #define BFFM_SETSELECTIONW      (WM_USER+103)
246 #define BFFM_SETSTATUSTEXTW     (WM_USER+104)
247
248 /*
249 #ifdef UNICODE
250 #define SHBrowseForFolder   SHBrowseForFolderW
251 #define BFFM_SETSTATUSTEXT  BFFM_SETSTATUSTEXTW
252 #define BFFM_SETSELECTION   BFFM_SETSELECTIONW
253
254 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDW
255 #else
256 #define SHBrowseForFolder   SHBrowseForFolderA
257 #define BFFM_SETSTATUSTEXT  BFFM_SETSTATUSTEXTA
258 #define BFFM_SETSELECTION   BFFM_SETSELECTIONA
259
260 #define BFFM_VALIDATEFAILED BFFM_VALIDATEFAILEDA 
261 #endif 
262 */
263
264 LPITEMIDLIST WINAPI SHBrowseForFolderA(LPBROWSEINFOA lpbi);
265 /*LPITEMIDLIST WINAPI SHBrowseForFolder32W(LPBROWSEINFO32W lpbi);*/
266 #define  SHBrowseForFolder WINELIB_NAME_AW(SHBrowseForFolder)
267
268 /****************************************************************************
269 *       SHGetDataFromIDList API
270 */
271 #define SHGDFIL_FINDDATA        1
272 #define SHGDFIL_NETRESOURCE     2
273 #define SHGDFIL_DESCRIPTIONID   3
274
275 #define SHDID_ROOT_REGITEM          1
276 #define SHDID_FS_FILE               2
277 #define SHDID_FS_DIRECTORY          3
278 #define SHDID_FS_OTHER              4
279 #define SHDID_COMPUTER_DRIVE35      5
280 #define SHDID_COMPUTER_DRIVE525     6
281 #define SHDID_COMPUTER_REMOVABLE    7
282 #define SHDID_COMPUTER_FIXED        8
283 #define SHDID_COMPUTER_NETDRIVE     9
284 #define SHDID_COMPUTER_CDROM        10
285 #define SHDID_COMPUTER_RAMDISK      11
286 #define SHDID_COMPUTER_OTHER        12
287 #define SHDID_NET_DOMAIN            13
288 #define SHDID_NET_SERVER            14
289 #define SHDID_NET_SHARE             15
290 #define SHDID_NET_RESTOFNET         16
291 #define SHDID_NET_OTHER             17
292
293 typedef struct _SHDESCRIPTIONID 
294 {   DWORD   dwDescriptionId;
295     CLSID   clsid;
296 } SHDESCRIPTIONID, *LPSHDESCRIPTIONID;
297
298 HRESULT WINAPI SHGetDataFromIDListA(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID pv, int cb);
299 HRESULT WINAPI SHGetDataFromIDListW(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID pv, int cb);
300 #define  SHGetDataFromIDList WINELIB_NAME_AW(SHGetDataFromIDList)
301
302
303 /****************************************************************************
304 * shlview structures
305 */
306
307 /*
308 * IShellFolderViewCallback Callback
309 *  This "callback" is called by the shells default IShellView implementation (that
310 *  we got using SHCreateShellViewEx()), to notify us of the various things that
311 *  are happening to the shellview (and ask for things too).
312 *
313 *  You don't have to support anything here - anything you don't want to 
314 *  handle, the shell will do itself if you just return E_NOTIMPL. This parameters
315 *  that the shell passes to this function are entirely undocumented.
316 *
317 *  HOWEVER, as the cabview sample as originally written used this callback, the
318 *  writers implemented the callback mechanism on top of their own IShellView.
319 *  Look there for some clues on what to do here.
320 */
321
322 typedef HRESULT(CALLBACK *SHELLVIEWPROC)(DWORD dwUserParam,LPSHELLFOLDER psf,
323                          HWND hwnd,UINT uMsg,UINT wParam,LPARAM lParam);
324
325 /* NF valid values for the "viewmode" item of the SHELLTEMPLATE*/
326 #define NF_INHERITVIEW    0x0000
327 #define NF_LOCALVIEW        0x0001
328
329 typedef struct _SHELLVIEWDATA   /* idl */
330 { DWORD           dwSize;
331   LPSHELLFOLDER   pShellFolder;
332   DWORD           dwUserParam;
333   LPCITEMIDLIST   pidl;
334   DWORD           v3;        /* always 0 */
335   SHELLVIEWPROC   pCallBack;
336   DWORD           viewmode;  /* NF_* enum */
337 } SHELLVIEWDATA, * LPSHELLVIEWDATA;
338
339 DWORD WINAPI SHGetMalloc(LPMALLOC *lpmal) ;
340
341 /****************************************************************************
342  *      Shell File Menu API
343  */
344 /* FileMenu_Create nSelHeight */
345 #define FM_FULL_SELHEIGHT       -1;
346 #define FM_DEFAULT_SELHEIGHT    0
347
348 /* FileMenu_Create uFlags */
349 #define FMF_SMALL_ICONS         0x00
350 #define FMF_LARGE_ICONS         0x08
351 #define FMF_NO_COLUMN_BREAK     0x10
352
353 /* FileMenu_InsertUsingPidl uFlags */
354 #define FMF_NO_EMPTY_ITEM       0x01
355 #define FMF_NO_PROGRAM_GROUPS   0x04
356
357 typedef void (CALLBACK * LPFNFMCALLBACK)(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlFile);
358
359 /* FileMenu_AppendItem lpszText */
360 #define FM_SEPARATOR            (LPCSTR)1
361 #define FM_BLANK_ICON           -1
362 #define FM_DEFAULT_HEIGHT       0
363
364 /**********************************************************************
365  * SHGetSettings ()
366  */
367 typedef struct
368 {       BOOL fShowAllObjects : 1;
369         BOOL fShowExtensions : 1;
370         BOOL fNoConfirmRecycle : 1;
371         BOOL fShowSysFiles : 1;
372
373         BOOL fShowCompColor : 1;
374         BOOL fDoubleClickInWebView : 1;
375         BOOL fDesktopHTML : 1;
376         BOOL fWin95Classic : 1;
377
378         BOOL fDontPrettyPath : 1;
379         BOOL fShowAttribCol : 1;
380         BOOL fMapNetDrvBtn : 1;
381         BOOL fShowInfoTip : 1;
382
383         BOOL fHideIcons : 1;
384         UINT fRestFlags : 3;
385 } SHELLFLAGSTATE, * LPSHELLFLAGSTATE;
386
387 void WINAPI SHGetSettings(LPSHELLFLAGSTATE lpsfs, DWORD dwMask, DWORD dwx);
388
389 #define SSF_SHOWALLOBJECTS              0x0001
390 #define SSF_SHOWEXTENSIONS              0x0002
391 #define SSF_SHOWCOMPCOLOR               0x0008
392 #define SSF_SHOWSYSFILES                0x0020
393 #define SSF_DOUBLECLICKINWEBVIEW        0x0080
394 #define SSF_SHOWATTRIBCOL               0x0100
395 #define SSF_DESKTOPHTML                 0x0200
396 #define SSF_WIN95CLASSIC                0x0400
397 #define SSF_DONTPRETTYPATH              0x0800
398 #define SSF_SHOWINFOTIP                 0x2000
399 #define SSF_MAPNETDRVBUTTON             0x1000
400 #define SSF_NOCONFIRMRECYCLE            0x8000
401 #define SSF_HIDEICONS                   0x4000
402
403 /**********************************************************************/
404
405 #ifdef __cplusplus
406 } /* extern "C" */
407 #endif /* defined(__cplusplus) */
408
409 #endif /* __WINE_SHLOBJ_H */