Many fixes/reimplementations.
[wine] / include / shell.h
1 /*
2  *                              Shell Library definitions
3  */
4 #ifndef __WINE_SHELL_H
5 #define __WINE_SHELL_H
6
7 #include "windef.h"
8
9 #ifdef __cplusplus
10 extern "C" {
11 #endif /* defined(__cplusplus) */
12
13 /****************************************************************************
14 * shell 16
15 */
16 extern void SHELL_LoadRegistry(void);
17 extern void SHELL_SaveRegistry(void);
18 extern void SHELL_Init(void);
19
20 /* global functions used from shell32 */
21 extern HINSTANCE SHELL_FindExecutable(LPCSTR,LPCSTR ,LPSTR);
22 extern HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16,LPCSTR,UINT16,WORD);
23
24 /****************************************************************************
25 * shell 32
26 */
27 /****************************************************************************
28 * common return codes 
29 */
30 #define SHELL_ERROR_SUCCESS           0L
31 #define SHELL_ERROR_BADDB             1L
32 #define SHELL_ERROR_BADKEY            2L
33 #define SHELL_ERROR_CANTOPEN          3L
34 #define SHELL_ERROR_CANTREAD          4L
35 #define SHELL_ERROR_CANTWRITE         5L
36 #define SHELL_ERROR_OUTOFMEMORY       6L
37 #define SHELL_ERROR_INVALID_PARAMETER 7L
38 #define SHELL_ERROR_ACCESS_DENIED     8L
39
40 /****************************************************************************
41 * common shell file structures 
42 */
43 /******************************
44 * DRAG&DROP API
45 */
46 typedef struct {           /* structure for dropped files */ 
47         WORD            wSize;
48         POINT16         ptMousePos;   
49         BOOL16          fInNonClientArea;
50         /* memory block with filenames follows */     
51 } DROPFILESTRUCT16, *LPDROPFILESTRUCT16; 
52
53 typedef struct {           /* structure for dropped files */ 
54         DWORD           lSize;
55         POINT           ptMousePos;   
56         BOOL            fInNonClientArea;
57         BOOL          fWideChar;
58         /* memory block with filenames follows */     
59 } DROPFILESTRUCT, *LPDROPFILESTRUCT; 
60
61
62 /****************************************************************************
63 * SHITEMID, ITEMIDLIST, PIDL API 
64 */
65 #include "pshpack1.h"
66 typedef struct 
67 { WORD  cb;     /* nr of bytes in this item */
68   BYTE  abID[1];/* first byte in this item */
69 } SHITEMID,*LPSHITEMID;
70
71 typedef struct 
72 { SHITEMID mkid; /* first itemid in list */
73 } ITEMIDLIST,*LPITEMIDLIST,*LPCITEMIDLIST;
74 #include "poppack.h"
75
76 BOOL WINAPI SHGetPathFromIDListA (LPCITEMIDLIST pidl,LPSTR pszPath);
77 BOOL WINAPI SHGetPathFromIDListW (LPCITEMIDLIST pidl,LPWSTR pszPath);
78 #define  SHGetPathFromIDList WINELIB_NAME_AW(SHGetPathFromIDList)
79
80
81
82 /****************************************************************************
83 * SHChangeNotifyRegister API
84 */
85 typedef struct
86 { LPITEMIDLIST pidl;
87   DWORD unknown;
88 } IDSTRUCT;
89
90 DWORD WINAPI SHChangeNotifyRegister(HWND hwnd,LONG events1,LONG events2,DWORD msg,int count,IDSTRUCT *idlist);
91 DWORD WINAPI SHChangeNotifyDeregister(LONG x1);
92
93 /****************************************************************************
94 * SHAddToRecentDocs API
95 */
96 #define SHARD_PIDL      0x00000001L
97 #define SHARD_PATH      0x00000002L
98
99 DWORD WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv);
100
101 /****************************************************************************
102 * SHGetSpecialFolderLocation API
103 */
104 HRESULT WINAPI SHGetSpecialFolderLocation(HWND, INT, LPITEMIDLIST *);
105 /****************************************************************************
106 *  string and path functions
107 */
108 BOOL WINAPI PathIsRootA(LPCSTR x);
109 BOOL WINAPI PathIsRootW(LPCWSTR x);
110 #define  PathIsRoot WINELIB_NAME_AW(PathIsRoot)
111 BOOL WINAPI PathIsRootAW(LPCVOID x);
112
113 LPSTR  WINAPI PathAddBackslashA(LPSTR path);    
114 LPWSTR WINAPI PathAddBackslashW(LPWSTR path);   
115 #define  PathAddBackslash WINELIB_NAME_AW(PathAddBackslash)
116 LPVOID  WINAPI PathAddBackslashAW(LPVOID path); 
117
118 BOOL  WINAPI PathQualifyA(LPCSTR path); 
119 BOOL WINAPI PathQualifyW(LPCWSTR path); 
120 #define  PathQualify WINELIB_NAME_AW(PathQualify)
121 BOOL  WINAPI PathQualifyAW(LPCVOID path);       
122
123 LPSTR  WINAPI PathQuoteSpacesA(LPCSTR path);    
124 LPWSTR WINAPI PathQuoteSpacesW(LPCWSTR path);   
125 #define  PathQuoteSpaces WINELIB_NAME_AW(PathQuoteSpaces)
126 LPVOID  WINAPI PathQuoteSpacesAW(LPCVOID path); 
127
128 LPSTR  WINAPI PathCombineA(LPSTR szDest, LPCSTR lpszDir, LPCSTR lpszFile);
129 LPWSTR WINAPI PathCombineW(LPWSTR szDest, LPCWSTR lpszDir, LPCWSTR lpszFile);
130 #define  PathCombine WINELIB_NAME_AW(PathCombine)
131 LPVOID WINAPI PathCombineAW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile);
132
133 LPCSTR WINAPI PathFindExtensionA(LPCSTR path);
134 LPCWSTR WINAPI PathFindExtensionW(LPCWSTR path);
135 #define  PathFindExtension WINELIB_NAME_AW(PathFindExtension)
136 LPCVOID WINAPI PathFindExtensionAW(LPCVOID path); 
137
138 LPCSTR WINAPI PathGetExtensionA(LPCSTR path, DWORD y, DWORD x);
139 LPCWSTR WINAPI PathGetExtensionW(LPCWSTR path, DWORD y, DWORD x);
140 #define  PathGetExtension WINELIB_NAME_AW(PathGetExtension)
141 LPCVOID WINAPI PathGetExtensionAW(LPCVOID path, DWORD y, DWORD x); 
142
143 LPCSTR WINAPI PathFindFilenameA(LPCSTR path);
144 LPCWSTR WINAPI PathFindFilenameW(LPCWSTR path);
145 #define  PathFindFilename WINELIB_NAME_AW(PathFindFilename)
146 LPCVOID WINAPI PathFindFilenameAW(LPCVOID path); 
147
148 BOOL WINAPI PathMatchSpecA(LPCSTR x, LPCSTR y);
149 BOOL WINAPI PathMatchSpecW(LPCWSTR x, LPCWSTR y);
150 #define  PathMatchSpec WINELIB_NAME_AW(PathMatchSpec)
151 BOOL WINAPI PathMatchSpecAW(LPVOID x, LPVOID y);
152
153 LPSTR WINAPI PathRemoveBlanksA(LPSTR str);
154 LPWSTR WINAPI PathRemoveBlanksW(LPWSTR str);
155 #define  PathRemoveBlanks WINELIB_NAME_AW(PathRemoveBlanks)
156 LPVOID WINAPI PathRemoveBlanksAW(LPVOID str);
157
158 BOOL WINAPI PathIsRelativeA(LPCSTR str);
159 BOOL WINAPI PathIsRelativeW(LPCWSTR str);
160 #define  PathIsRelative WINELIB_NAME_AW(PathIsRelative)
161 BOOL WINAPI PathIsRelativeAW(LPCVOID str);
162
163 BOOL WINAPI PathIsUNCA(LPCSTR str);
164 BOOL WINAPI PathIsUNCW(LPCWSTR str);
165 #define  PathIsUNC WINELIB_NAME_AW(PathIsUNC)
166 BOOL WINAPI PathIsUNCAW(LPCVOID str);
167
168 BOOL WINAPI PathFindOnPathA(LPSTR sFile, LPCSTR sOtherDirs);
169 BOOL WINAPI PathFindOnPathW(LPWSTR sFile, LPCWSTR sOtherDirs);
170 #define PathFindOnPath WINELIB_NAME_AW(PathFindOnPath)
171 BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs);
172
173 LPSTR WINAPI StrFormatByteSizeA ( DWORD dw, LPSTR pszBuf, UINT cchBuf );
174 LPWSTR WINAPI StrFormatByteSizeW ( DWORD dw, LPWSTR pszBuf, UINT cchBuf );
175 #define  StrFormatByteSize WINELIB_NAME_AW(StrFormatByteSize)
176
177 /****************************************************************************
178 *  other functions
179 */
180
181 LPVOID WINAPI SHAlloc(DWORD len);
182 DWORD WINAPI SHFree(LPVOID x);
183
184 #define CSIDL_DESKTOP           0x0000
185 #define CSIDL_PROGRAMS          0x0002
186 #define CSIDL_CONTROLS          0x0003
187 #define CSIDL_PRINTERS          0x0004
188 #define CSIDL_PERSONAL          0x0005
189 #define CSIDL_FAVORITES         0x0006
190 #define CSIDL_STARTUP           0x0007
191 #define CSIDL_RECENT            0x0008
192 #define CSIDL_SENDTO            0x0009
193 #define CSIDL_BITBUCKET         0x000a
194 #define CSIDL_STARTMENU         0x000b
195 #define CSIDL_DESKTOPDIRECTORY  0x0010
196 #define CSIDL_DRIVES            0x0011
197 #define CSIDL_NETWORK           0x0012
198 #define CSIDL_NETHOOD           0x0013
199 #define CSIDL_FONTS             0x0014
200 #define CSIDL_TEMPLATES         0x0015
201 #define CSIDL_COMMON_STARTMENU  0x0016
202 #define CSIDL_COMMON_PROGRAMS   0X0017
203 #define CSIDL_COMMON_STARTUP    0x0018
204 #define CSIDL_COMMON_DESKTOPDIRECTORY   0x0019
205 #define CSIDL_APPDATA           0x001a
206 #define CSIDL_PRINTHOOD         0x001b
207 #define CSIDL_ALTSTARTUP        0x001d
208 #define CSIDL_COMMON_ALTSTARTUP 0x001e
209 #define CSIDL_COMMON_FAVORITES  0x001f
210 #define CSIDL_INTERNET_CACHE    0x0020
211 #define CSIDL_COOKIES           0x0021
212 #define CSIDL_HISTORY           0x0022
213
214 #ifdef __cplusplus
215 } /* extern "C" */
216 #endif /* defined(__cplusplus) */
217
218 #endif  /* __WINE_SHELL_H */