- added a dump of the palette creation flags
[wine] / include / shell.h
1 /*
2  *                              Shell Library definitions
3  */
4 #ifndef __WINE_SHELL_H
5 #define __WINE_SHELL_H
6
7 #include "windows.h"
8 #include "winreg.h"
9 #include "imagelist.h"
10
11
12 /****************************************************************************
13 * shell 16
14 */
15 extern void SHELL_LoadRegistry(void);
16 extern void SHELL_SaveRegistry(void);
17 extern void SHELL_Init(void);
18
19 /* global functions used from shell32 */
20 extern HINSTANCE32 SHELL_FindExecutable(LPCSTR,LPCSTR ,LPSTR);
21 extern HGLOBAL16 WINAPI InternalExtractIcon(HINSTANCE16,LPCSTR,UINT16,WORD);
22
23 /****************************************************************************
24 * shell 32
25 */
26 /****************************************************************************
27 * common return codes 
28 */
29 #define SHELL_ERROR_SUCCESS           0L
30 #define SHELL_ERROR_BADDB             1L
31 #define SHELL_ERROR_BADKEY            2L
32 #define SHELL_ERROR_CANTOPEN          3L
33 #define SHELL_ERROR_CANTREAD          4L
34 #define SHELL_ERROR_CANTWRITE         5L
35 #define SHELL_ERROR_OUTOFMEMORY       6L
36 #define SHELL_ERROR_INVALID_PARAMETER 7L
37 #define SHELL_ERROR_ACCESS_DENIED     8L
38
39 /****************************************************************************
40 * common shell file structures 
41 */
42 #define FO_MOVE           0x0001
43 #define FO_COPY           0x0002
44 #define FO_DELETE         0x0003
45 #define FO_RENAME         0x0004
46
47 #define FOF_MULTIDESTFILES         0x0001
48 #define FOF_CONFIRMMOUSE           0x0002
49 #define FOF_SILENT                 0x0004  
50 #define FOF_RENAMEONCOLLISION      0x0008
51 #define FOF_NOCONFIRMATION         0x0010  
52 #define FOF_WANTMAPPINGHANDLE      0x0020  
53 #define FOF_ALLOWUNDO              0x0040
54 #define FOF_FILESONLY              0x0080  
55 #define FOF_SIMPLEPROGRESS         0x0100  
56 #define FOF_NOCONFIRMMKDIR         0x0200  
57 #define FOF_NOERRORUI              0x0400  
58
59 typedef WORD FILEOP_FLAGS;
60
61 #define PO_DELETE       0x0013  
62 #define PO_RENAME       0x0014  
63 #define PO_PORTCHANGE   0x0020  
64
65 typedef WORD PRINTEROP_FLAGS;
66
67 /******************************
68 * DRAG&DROP API
69 */
70 typedef struct {           /* structure for dropped files */ 
71         WORD            wSize;
72         POINT16         ptMousePos;   
73         BOOL16          fInNonClientArea;
74         /* memory block with filenames follows */     
75 } DROPFILESTRUCT16, *LPDROPFILESTRUCT16; 
76
77 typedef struct {           /* structure for dropped files */ 
78         DWORD           lSize;
79         POINT32         ptMousePos;   
80         BOOL32          fInNonClientArea;
81         BOOL32          fWideChar;
82         /* memory block with filenames follows */     
83 } DROPFILESTRUCT32, *LPDROPFILESTRUCT32; 
84
85 DECL_WINELIB_TYPE(DROPFILESTRUCT)
86 DECL_WINELIB_TYPE(LPDROPFILESTRUCT)
87
88 void        WINAPI DragAcceptFiles16(HWND16 hWnd, BOOL16 b);
89 void        WINAPI DragAcceptFiles32(HWND32 hWnd, BOOL32 b);
90 #define     DragAcceptFiles WINELIB_NAME(DragAcceptFiles)
91 UINT16      WINAPI DragQueryFile16(HDROP16 hDrop, WORD wFile, LPSTR lpszFile, WORD wLength);
92 UINT32      WINAPI DragQueryFile32A(HDROP32 hDrop, UINT32 lFile, LPSTR lpszFile, UINT32 lLength);
93 UINT32      WINAPI DragQueryFile32W(HDROP32 hDrop, UINT32 lFile, LPWSTR lpszFile, UINT32 lLength);
94 #define     DragQueryFile WINELIB_NAME_AW(DragQueryFile)
95 void        WINAPI DragFinish32(HDROP32 h);
96 void        WINAPI DragFinish16(HDROP16 h);
97 #define     DragFinish WINELIB_NAME(DragFinish)
98 BOOL32      WINAPI DragQueryPoint32(HDROP32 hDrop, POINT32 *p);
99 BOOL16      WINAPI DragQueryPoint16(HDROP16 hDrop, POINT16 *p);
100 #define     DragQueryPoint WINELIB_NAME(DragQueryPoint)
101
102
103 /****************************************************************************
104 * NOTIFYICONDATA 
105 */
106 typedef struct _NOTIFYICONDATA {
107         DWORD cbSize;
108         HWND32 hWnd;
109         UINT32 uID;
110         UINT32 uFlags;
111         UINT32 uCallbackMessage;
112         HICON32 hIcon;
113         CHAR szTip[64];
114 } NOTIFYICONDATA, *PNOTIFYICONDATA;
115
116 /****************************************************************************
117 * SHITEMID, ITEMIDLIST, PIDL API 
118 */
119 #pragma pack(1)
120 typedef struct 
121 { WORD  cb;     /* nr of bytes in this item */
122   BYTE  abID[1];/* first byte in this item */
123 } SHITEMID,*LPSHITEMID;
124
125 typedef struct 
126 { SHITEMID mkid; /* first itemid in list */
127 } ITEMIDLIST,*LPITEMIDLIST,*LPCITEMIDLIST;
128 #pragma pack(4)
129
130 DWORD WINAPI SHGetPathFromIDList32A (LPCITEMIDLIST pidl,LPSTR pszPath);
131 DWORD WINAPI SHGetPathFromIDList32W (LPCITEMIDLIST pidl,LPWSTR pszPath);
132 #define  SHGetPathFromIDList WINELIB_NAME_AW(SHGetPathFromIDList)
133
134 /****************************************************************************
135 * SHFILEINFO API 
136 */
137 typedef struct tagSHFILEINFO32A {
138         HICON32 hIcon;                  /* icon */
139         int     iIcon;                  /* icon index */
140         DWORD   dwAttributes;           /* SFGAO_ flags */
141         CHAR    szDisplayName[MAX_PATH];/* display name (or path) */
142         CHAR    szTypeName[80];         /* type name */
143 } SHFILEINFO32A;
144
145 typedef struct tagSHFILEINFO32W {
146         HICON32 hIcon;                  /* icon */
147         int     iIcon;                  /* icon index */
148         DWORD   dwAttributes;           /* SFGAO_ flags */
149         WCHAR   szDisplayName[MAX_PATH];/* display name (or path) */
150         WCHAR   szTypeName[80];         /* type name */
151 } SHFILEINFO32W;
152
153 DECL_WINELIB_TYPE_AW(SHFILEINFO)
154
155 DWORD    WINAPI SHGetFileInfo32A(LPCSTR,DWORD,SHFILEINFO32A*,UINT32,UINT32);
156 DWORD    WINAPI SHGetFileInfo32W(LPCWSTR,DWORD,SHFILEINFO32W*,UINT32,UINT32);
157 #define  SHGetFileInfo WINELIB_NAME_AW(SHGetFileInfo)
158
159 /****************************************************************************
160 * SHFILEOPSTRUCT API 
161 */
162 typedef struct _SHFILEOPSTRUCTA
163 { HWND32          hwnd;
164   UINT32          wFunc;
165   LPCSTR          pFrom;
166   LPCSTR          pTo;
167   FILEOP_FLAGS    fFlags;
168   BOOL32          fAnyOperationsAborted;
169   LPVOID          hNameMappings;
170   LPCSTR          lpszProgressTitle;
171 } SHFILEOPSTRUCT32A, *LPSHFILEOPSTRUCT32A;
172
173 typedef struct _SHFILEOPSTRUCTW
174 { HWND32          hwnd;
175   UINT32          wFunc;
176   LPCWSTR         pFrom;
177   LPCWSTR         pTo;
178   FILEOP_FLAGS    fFlags;
179   BOOL32          fAnyOperationsAborted;
180   LPVOID          hNameMappings;
181   LPCWSTR         lpszProgressTitle;
182 } SHFILEOPSTRUCT32W, *LPSHFILEOPSTRUCT32W;
183
184 #define  SHFILEOPSTRUCT WINELIB_NAME_AW(SHFILEOPSTRUCT)
185 #define  LPSHFILEOPSTRUCT WINELIB_NAME_AW(LPSHFILEOPSTRUCT)
186
187 DWORD WINAPI SHFileOperation32A (LPSHFILEOPSTRUCT32A lpFileOp);  
188 DWORD WINAPI SHFileOperation32W (LPSHFILEOPSTRUCT32W lpFileOp);
189 #define  SHFileOperation WINELIB_NAME_AW(SHFileOperation)
190
191 DWORD WINAPI SHFileOperation32(DWORD x);
192
193 /****************************************************************************
194 * APPBARDATA 
195 */
196 typedef struct _AppBarData {
197         DWORD   cbSize;
198         HWND32  hWnd;
199         UINT32  uCallbackMessage;
200         UINT32  uEdge;
201         RECT32  rc;
202         LPARAM  lParam;
203 } APPBARDATA, *PAPPBARDATA;
204
205 #define SHGFI_ICON              0x000000100     /* get icon */
206 #define SHGFI_DISPLAYNAME       0x000000200     /* get display name */
207 #define SHGFI_TYPENAME          0x000000400     /* get type name */
208 #define SHGFI_ATTRIBUTES        0x000000800     /* get attributes */
209 #define SHGFI_ICONLOCATION      0x000001000     /* get icon location */
210 #define SHGFI_EXETYPE           0x000002000     /* return exe type */
211 #define SHGFI_SYSICONINDEX      0x000004000     /* get system icon index */
212 #define SHGFI_LINKOVERLAY       0x000008000     /* put a link overlay on icon */
213 #define SHGFI_SELECTED          0x000010000     /* show icon in selected state */
214 #define SHGFI_LARGEICON         0x000000000     /* get large icon */
215 #define SHGFI_SMALLICON         0x000000001     /* get small icon */
216 #define SHGFI_OPENICON          0x000000002     /* get open icon */
217 #define SHGFI_SHELLICONSIZE     0x000000004     /* get shell size icon */
218 #define SHGFI_PIDL              0x000000008     /* pszPath is a pidl */
219 #define SHGFI_USEFILEATTRIBUTES 0x000000010     /* use passed dwFileAttribute */
220
221 /****************************************************************************
222 * SHChangeNotifyRegister API
223 */
224 typedef struct
225 { LPITEMIDLIST pidl;
226   DWORD unknown;
227 } IDSTRUCT;
228
229 DWORD WINAPI SHChangeNotifyRegister(HWND32 hwnd,LONG events1,LONG events2,DWORD msg,int count,IDSTRUCT *idlist);
230 DWORD WINAPI SHChangeNotifyDeregister(LONG x1);
231
232 /****************************************************************************
233 * SHAddToRecentDocs API
234 */
235 #define SHARD_PIDL      0x00000001L
236 #define SHARD_PATH      0x00000002L
237
238 DWORD WINAPI SHAddToRecentDocs(UINT32 uFlags, LPCVOID pv);
239
240 /****************************************************************************
241 * SHGetSpecialFolderLocation API
242 */
243 HRESULT WINAPI SHGetSpecialFolderLocation(HWND32, INT32, LPITEMIDLIST *);
244 /****************************************************************************
245 *  string and path functions
246 */
247 BOOL32 WINAPI PathIsRoot32A(LPCSTR x);
248 BOOL32 WINAPI PathIsRoot32W(LPCWSTR x);
249 #define  PathIsRoot WINELIB_NAME_AW(PathIsRoot)
250 BOOL32 WINAPI PathIsRoot32AW(LPCVOID x);
251
252 LPSTR  WINAPI PathAddBackslash32A(LPSTR path);  
253 LPWSTR WINAPI PathAddBackslash32W(LPWSTR path); 
254 #define  PathAddBackslash WINELIB_NAME_AW(PathAddBackslash)
255 LPVOID  WINAPI PathAddBackslash32AW(LPVOID path);       
256
257 BOOL32  WINAPI PathQualify32A(LPCSTR path);     
258 BOOL32 WINAPI PathQualify32W(LPCWSTR path);     
259 #define  PathQualify WINELIB_NAME_AW(PathQualify)
260 BOOL32  WINAPI PathQualify32AW(LPCVOID path);   
261
262 LPSTR  WINAPI PathQuoteSpaces32A(LPCSTR path);  
263 LPWSTR WINAPI PathQuoteSpaces32W(LPCWSTR path); 
264 #define  PathQuoteSpaces WINELIB_NAME_AW(PathQuoteSpaces)
265 LPVOID  WINAPI PathQuoteSpaces32AW(LPCVOID path);       
266
267 LPSTR  WINAPI PathCombine32A(LPSTR szDest, LPCSTR lpszDir, LPCSTR lpszFile);
268 LPWSTR WINAPI PathCombine32W(LPWSTR szDest, LPCWSTR lpszDir, LPCWSTR lpszFile);
269 #define  PathCombine WINELIB_NAME_AW(PathCombine)
270 LPVOID WINAPI PathCombine32AW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile);
271
272 LPCSTR WINAPI PathFindExtension32A(LPCSTR path);
273 LPCWSTR WINAPI PathFindExtension32W(LPCWSTR path);
274 #define  PathFindExtension WINELIB_NAME_AW(PathFindExtension)
275 LPCVOID WINAPI PathFindExtension32AW(LPCVOID path); 
276
277 LPCSTR WINAPI PathGetExtension32A(LPCSTR path, DWORD y, DWORD x);
278 LPCWSTR WINAPI PathGetExtension32W(LPCWSTR path, DWORD y, DWORD x);
279 #define  PathGetExtension WINELIB_NAME_AW(PathGetExtension)
280 LPCVOID WINAPI PathGetExtension32AW(LPCVOID path, DWORD y, DWORD x); 
281
282 LPCSTR WINAPI PathFindFilename32A(LPCSTR path);
283 LPCWSTR WINAPI PathFindFilename32W(LPCWSTR path);
284 #define  PathFindFilename WINELIB_NAME_AW(PathFindFilename)
285 LPCVOID WINAPI PathFindFilename32AW(LPCVOID path); 
286
287 BOOL32 WINAPI PathMatchSpec32A(LPCSTR x, LPCSTR y);
288 BOOL32 WINAPI PathMatchSpec32W(LPCWSTR x, LPCWSTR y);
289 #define  PathMatchSpec WINELIB_NAME_AW(PathMatchSpec)
290 BOOL32 WINAPI PathMatchSpec32AW(LPVOID x, LPVOID y);
291
292 LPSTR WINAPI PathRemoveBlanks32A(LPSTR str);
293 LPWSTR WINAPI PathRemoveBlanks32W(LPWSTR str);
294 #define  PathRemoveBlanks WINELIB_NAME_AW(PathRemoveBlanks)
295 LPVOID WINAPI PathRemoveBlanks32AW(LPVOID str);
296
297 BOOL32 WINAPI PathIsRelative32A(LPCSTR str);
298 BOOL32 WINAPI PathIsRelative32W(LPCWSTR str);
299 #define  PathIsRelative WINELIB_NAME_AW(PathIsRelative)
300 BOOL32 WINAPI PathIsRelative32AW(LPCVOID str);
301
302 BOOL32 WINAPI PathIsUNC32A(LPCSTR str);
303 BOOL32 WINAPI PathIsUNC32W(LPCWSTR str);
304 #define  PathIsUNC WINELIB_NAME_AW(PathIsUNC)
305 BOOL32 WINAPI PathIsUNC32AW(LPCVOID str);
306
307 BOOL32 WINAPI PathFindOnPath32A(LPSTR sFile, LPCSTR sOtherDirs);
308 BOOL32 WINAPI PathFindOnPath32W(LPWSTR sFile, LPCWSTR sOtherDirs);
309 #define PathFindOnPath WINELIB_NAME_AW(PathFindOnPath)
310 BOOL32 WINAPI PathFindOnPath32AW(LPVOID sFile, LPCVOID sOtherDirs);
311
312 LPSTR WINAPI StrFormatByteSize32A ( DWORD dw, LPSTR pszBuf, UINT32 cchBuf );
313 LPWSTR WINAPI StrFormatByteSize32W ( DWORD dw, LPWSTR pszBuf, UINT32 cchBuf );
314 #define  StrFormatByteSize WINELIB_NAME_AW(StrFormatByteSize)
315
316 /****************************************************************************
317 *  other functions
318 */
319 HICON16 WINAPI ExtractIconEx16 ( LPCSTR, INT16, HICON16 *, HICON16 *, UINT16 );
320 HICON32 WINAPI ExtractIconEx32A( LPCSTR, INT32, HICON32 *, HICON32 *, UINT32 );
321 HICON32 WINAPI ExtractIconEx32W( LPCWSTR, INT32, HICON32 *, HICON32 *, UINT32 );
322 #define  ExtractIconEx WINELIB_NAME_AW(ExtractIconEx)
323 HICON32 WINAPI ExtractIconEx32AW(LPCVOID, INT32, HICON32 *, HICON32 *, UINT32 );
324
325 LPVOID WINAPI SHAlloc(DWORD len);
326 DWORD WINAPI SHFree(LPVOID x);
327
328 #define SE_ERR_SHARE            26
329 #define SE_ERR_ASSOCINCOMPLETE  27
330 #define SE_ERR_DDETIMEOUT       28
331 #define SE_ERR_DDEFAIL          29
332 #define SE_ERR_DDEBUSY          30
333 #define SE_ERR_NOASSOC          31
334
335 #define CSIDL_DESKTOP           0x0000
336 #define CSIDL_PROGRAMS          0x0002
337 #define CSIDL_CONTROLS          0x0003
338 #define CSIDL_PRINTERS          0x0004
339 #define CSIDL_PERSONAL          0x0005
340 #define CSIDL_FAVORITES         0x0006
341 #define CSIDL_STARTUP           0x0007
342 #define CSIDL_RECENT            0x0008
343 #define CSIDL_SENDTO            0x0009
344 #define CSIDL_BITBUCKET         0x000a
345 #define CSIDL_STARTMENU         0x000b
346 #define CSIDL_DESKTOPDIRECTORY  0x0010
347 #define CSIDL_DRIVES            0x0011
348 #define CSIDL_NETWORK           0x0012
349 #define CSIDL_NETHOOD           0x0013
350 #define CSIDL_FONTS             0x0014
351 #define CSIDL_TEMPLATES         0x0015
352 #define CSIDL_COMMON_STARTMENU  0x0016
353 #define CSIDL_COMMON_PROGRAMS   0X0017
354 #define CSIDL_COMMON_STARTUP    0x0018
355 #define CSIDL_COMMON_DESKTOPDIRECTORY   0x0019
356 #define CSIDL_APPDATA           0x001a
357 #define CSIDL_PRINTHOOD         0x001b
358
359
360 #endif  /* __WINE_SHELL_H */