OSDN Git Service

Apply LICENSE to all files as appropriate.
[mingw/mingw-org-wsl.git] / include / shellapi.h
1 /**
2  * @file shellapi.h
3  * @copy 2012 MinGW.org project
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  * 
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  * 
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 #ifndef _SHELLAPI_H
25 #define _SHELLAPI_H
26 #pragma GCC system_header
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 #define WINSHELLAPI DECLSPEC_IMPORT
32 #define ABE_LEFT        0
33 #define ABE_TOP 1
34 #define ABE_RIGHT       2
35 #define ABE_BOTTOM      3
36 #define ABS_AUTOHIDE    1
37 #define ABS_ALWAYSONTOP 2
38 #define SEE_MASK_CLASSNAME         0x1
39 #define SEE_MASK_CLASSKEY          0x3
40 #define SEE_MASK_IDLIST            0x4
41 #define SEE_MASK_INVOKEIDLIST      0xc
42 #define SEE_MASK_ICON              0x10
43 #define SEE_MASK_HOTKEY            0x20
44 #define SEE_MASK_NOCLOSEPROCESS    0x40
45 #define SEE_MASK_CONNECTNETDRV     0x80
46 #define SEE_MASK_FLAG_DDEWAIT      0x100
47 #define SEE_MASK_DOENVSUBST        0x200
48 #define SEE_MASK_FLAG_NO_UI        0x400
49 #define SEE_MASK_NO_CONSOLE        0x8000
50 #define SEE_MASK_UNICODE           0x10000
51 #define SEE_MASK_ASYNCOK           0x100000
52 #define SEE_MASK_HMONITOR          0x200000
53 #if (_WIN32_IE >= 0x0600)
54 #define SEE_MASK_NOZONECHECKS      0x800000
55 #define SEE_MASK_FLAG_LOG_USAGE    0x4000000
56 #endif
57 #define ABM_NEW 0
58 #define ABM_REMOVE      1
59 #define ABM_QUERYPOS    2
60 #define ABM_SETPOS      3
61 #define ABM_GETSTATE    4
62 #define ABM_GETTASKBARPOS       5
63 #define ABM_ACTIVATE    6
64 #define ABM_GETAUTOHIDEBAR      7
65 #define ABM_SETAUTOHIDEBAR      8
66 #define ABM_WINDOWPOSCHANGED    9
67 #define ABN_STATECHANGE         0
68 #define ABN_POSCHANGED          1
69 #define ABN_FULLSCREENAPP       2
70 #define ABN_WINDOWARRANGE       3
71 #define NIM_ADD 0
72 #define NIM_MODIFY      1
73 #define NIM_DELETE      2
74 #if (_WIN32_IE >= 0x0500)
75 #define NOTIFYICON_VERSION 3
76 #if (_WIN32_WINNT >= 0x600)
77 #define NOTIFYICON_VERSION_4  4
78 #endif
79 #define NIM_SETFOCUS    3
80 #define NIM_SETVERSION  4
81 #define NIN_POPUPOPEN WM_USER+6
82 #define NIN_POPUPCLOSE WM_USER+7
83 #endif
84 #define NIF_MESSAGE     0x00000001
85 #define NIF_ICON        0x00000002
86 #define NIF_TIP         0x00000004
87 #define NIF_STATE       0x00000008
88 #if (_WIN32_IE >= 0x0500)
89 #define NIF_INFO        0x00000010
90 #endif
91 #if (_WIN32_IE >= 0x0600)
92 #define NIF_GUID        0x00000020
93 #endif
94 #if (_WIN32_IE >= 0x0500)
95 #define NIIF_NONE       0x00000000
96 #define NIIF_INFO       0x00000001
97 #define NIIF_WARNING    0x00000002
98 #define NIIF_ERROR      0x00000003
99 #endif
100 #if (_WIN32_IE >= 0x0600)
101 #define NIIF_ICON_MASK  0x0000000F
102 #define NIIF_NOSOUND    0x00000010
103 #endif
104 #if (_WIN32_IE >= 0x0500)
105 #define NIS_HIDDEN      0x00000001
106 #define NIS_SHAREDICON  0x00000002
107 #endif
108 #define SE_ERR_FNF      2
109 #define SE_ERR_PNF      3
110 #define SE_ERR_ACCESSDENIED     5
111 #define SE_ERR_OOM      8
112 #define SE_ERR_DLLNOTFOUND      32
113 #define SE_ERR_SHARE    26
114 #define SE_ERR_ASSOCINCOMPLETE  27
115 #define SE_ERR_DDETIMEOUT       28
116 #define SE_ERR_DDEFAIL  29
117 #define SE_ERR_DDEBUSY  30
118 #define SE_ERR_NOASSOC  31
119 #define FO_MOVE 1
120 #define FO_COPY 2
121 #define FO_DELETE       3
122 #define FO_RENAME       4
123 #define FOF_MULTIDESTFILES      1
124 #define FOF_CONFIRMMOUSE        2
125 #define FOF_SILENT      4
126 #define FOF_RENAMEONCOLLISION   8
127 #define FOF_NOCONFIRMATION      16
128 #define FOF_WANTMAPPINGHANDLE   32
129 #define FOF_ALLOWUNDO   64
130 #define FOF_FILESONLY   128
131 #define FOF_SIMPLEPROGRESS      256
132 #define FOF_NOCONFIRMMKDIR      512
133 #define FOF_NOERRORUI   1024
134 #define FOF_NOCOPYSECURITYATTRIBS       2048
135 #define PO_DELETE 19
136 #define PO_RENAME 20
137 #define PO_PORTCHANGE 32
138 #define PO_REN_PORT 52
139 #define SHGFI_ICON      256
140 #define SHGFI_DISPLAYNAME       512
141 #define SHGFI_TYPENAME  1024
142 #define SHGFI_ATTRIBUTES        2048
143 #define SHGFI_ICONLOCATION      4096
144 #define SHGFI_EXETYPE 8192
145 #define SHGFI_SYSICONINDEX 16384
146 #define SHGFI_LINKOVERLAY 32768
147 #define SHGFI_SELECTED 65536
148 #define SHGFI_ATTR_SPECIFIED 131072
149 #define SHGFI_LARGEICON 0
150 #define SHGFI_SMALLICON 1
151 #define SHGFI_OPENICON  2
152 #define SHGFI_SHELLICONSIZE     4
153 #define SHGFI_PIDL      8
154 #define SHGFI_USEFILEATTRIBUTES 16
155 #define SHERB_NOCONFIRMATION 1
156 #define SHERB_NOPROGRESSUI 2
157 #define SHERB_NOSOUND 4
158 #ifdef UNICODE
159 #define NOTIFYICONDATA_V2_SIZE 936
160 #define NOTIFYICONDATA_V1_SIZE 152
161 #else
162 #define NOTIFYICONDATA_V2_SIZE 488
163 #define NOTIFYICONDATA_V1_SIZE 88
164 #endif
165
166 typedef WORD FILEOP_FLAGS;
167 typedef WORD PRINTEROP_FLAGS;
168 #include <pshpack2.h>
169 typedef struct _AppBarData {
170         DWORD   cbSize;
171         HWND    hWnd;
172         UINT    uCallbackMessage;
173         UINT    uEdge;
174         RECT    rc;
175         LPARAM lParam;
176 } APPBARDATA,*PAPPBARDATA;
177 DECLARE_HANDLE(HDROP);
178
179 typedef struct _NOTIFYICONDATAA {
180   DWORD cbSize;
181   HWND hWnd;
182   UINT uID;
183   UINT uFlags;
184   UINT uCallbackMessage;
185   HICON hIcon;
186 #if _WIN32_IE >= 0x0500
187   CHAR szTip[128];
188   DWORD dwState;
189   DWORD dwStateMask;
190   CHAR szInfo[256];
191   _ANONYMOUS_UNION union {
192     UINT uTimeout;
193     UINT uVersion;
194   } DUMMYUNIONNAME;
195   CHAR szInfoTitle[64];
196   DWORD dwInfoFlags;
197 #else
198   CHAR szTip[64];
199 #endif
200 #if _WIN32_IE >= 0x600
201   GUID guidItem;
202 #endif
203 #if _WIN32_WINNT >= 0x600
204   HICON hBalloonIcon;
205 #endif
206 } NOTIFYICONDATAA,*PNOTIFYICONDATAA;
207
208 typedef struct _NOTIFYICONDATAW {
209   DWORD cbSize;
210   HWND hWnd;
211   UINT uID;
212   UINT uFlags;
213   UINT uCallbackMessage;
214   HICON hIcon;
215 #if _WIN32_IE >= 0x0500
216   WCHAR szTip[128];
217   DWORD dwState;
218   DWORD dwStateMask;
219   WCHAR szInfo[256];
220   _ANONYMOUS_UNION union {
221     UINT uTimeout;
222     UINT uVersion;
223   } DUMMYUNIONNAME;
224   WCHAR szInfoTitle[64];
225   DWORD dwInfoFlags;
226 #else
227   WCHAR szTip[64];
228 #endif
229 #if _WIN32_IE >= 0x600
230   GUID guidItem;
231 #endif
232 #if _WIN32_WINNT >= 0x600
233   HICON hBalloonIcon;
234 #endif
235 } NOTIFYICONDATAW,*PNOTIFYICONDATAW;
236
237 typedef struct _SHELLEXECUTEINFOA {
238         DWORD cbSize;
239         ULONG fMask;
240         HWND hwnd;
241         LPCSTR lpVerb;
242         LPCSTR lpFile;
243         LPCSTR lpParameters;
244         LPCSTR lpDirectory;
245         int nShow;
246         HINSTANCE hInstApp;
247         PVOID lpIDList;
248         LPCSTR lpClass;
249         HKEY hkeyClass;
250         DWORD dwHotKey;
251         HANDLE hIcon;
252         HANDLE hProcess;
253 } SHELLEXECUTEINFOA,*LPSHELLEXECUTEINFOA;
254 typedef struct _SHELLEXECUTEINFOW {
255         DWORD cbSize;
256         ULONG fMask;
257         HWND hwnd;
258         LPCWSTR lpVerb;
259         LPCWSTR lpFile;
260         LPCWSTR lpParameters;
261         LPCWSTR lpDirectory;
262         int nShow;
263         HINSTANCE hInstApp;
264         PVOID lpIDList;
265         LPCWSTR lpClass;
266         HKEY hkeyClass;
267         DWORD dwHotKey;
268         HANDLE hIcon;
269         HANDLE hProcess;
270 } SHELLEXECUTEINFOW,*LPSHELLEXECUTEINFOW;
271 typedef struct _SHFILEOPSTRUCTA {
272         HWND hwnd;
273         UINT wFunc;
274         LPCSTR pFrom;
275         LPCSTR pTo;
276         FILEOP_FLAGS fFlags;
277         BOOL fAnyOperationsAborted;
278         PVOID hNameMappings;
279         LPCSTR lpszProgressTitle;
280 } SHFILEOPSTRUCTA,*LPSHFILEOPSTRUCTA;
281 typedef struct _SHFILEOPSTRUCTW {
282         HWND hwnd;
283         UINT wFunc;
284         LPCWSTR pFrom;
285         LPCWSTR pTo;
286         FILEOP_FLAGS fFlags;
287         BOOL fAnyOperationsAborted;
288         PVOID hNameMappings;
289         LPCWSTR lpszProgressTitle;
290 } SHFILEOPSTRUCTW,*LPSHFILEOPSTRUCTW;
291 typedef struct _SHFILEINFOA {
292         HICON hIcon;
293         int iIcon;
294         DWORD dwAttributes;
295         CHAR szDisplayName[MAX_PATH];
296         CHAR szTypeName[80];
297 } SHFILEINFOA;
298 typedef struct _SHFILEINFOW {
299         HICON hIcon;
300         int iIcon;
301         DWORD dwAttributes;
302         WCHAR szDisplayName[MAX_PATH];
303         WCHAR szTypeName[80];
304 } SHFILEINFOW;
305 typedef struct _SHQUERYRBINFO {
306         DWORD   cbSize;
307         __int64 i64Size;
308         __int64 i64NumItems;
309 } SHQUERYRBINFO, *LPSHQUERYRBINFO;
310 #include <poppack.h>
311
312 LPWSTR * WINAPI CommandLineToArgvW(LPCWSTR,int*);
313 void WINAPI DragAcceptFiles(HWND,BOOL);
314 void WINAPI DragFinish(HDROP);
315 UINT WINAPI DragQueryFileA(HDROP,UINT,LPSTR,UINT);
316 UINT WINAPI DragQueryFileW(HDROP,UINT,LPWSTR,UINT);
317 BOOL WINAPI DragQueryPoint(HDROP,LPPOINT);
318 HICON WINAPI DuplicateIcon(HINSTANCE,HICON);
319 HICON WINAPI ExtractAssociatedIconA(HINSTANCE,LPCSTR,PWORD);
320 HICON WINAPI ExtractAssociatedIconW(HINSTANCE,LPCWSTR,PWORD);
321 HICON WINAPI ExtractIconA(HINSTANCE,LPCSTR,UINT);
322 HICON WINAPI ExtractIconW(HINSTANCE,LPCWSTR,UINT);
323 UINT WINAPI ExtractIconExA(LPCSTR,int,HICON*,HICON*,UINT);
324 UINT WINAPI ExtractIconExW(LPCWSTR,int,HICON*,HICON*,UINT);
325 HINSTANCE WINAPI FindExecutableA(LPCSTR,LPCSTR,LPSTR);
326 HINSTANCE WINAPI FindExecutableW(LPCWSTR,LPCWSTR,LPWSTR);
327 UINT WINAPI SHAppBarMessage(DWORD,PAPPBARDATA);
328 BOOL WINAPI Shell_NotifyIconA(DWORD,PNOTIFYICONDATAA);
329 BOOL WINAPI Shell_NotifyIconW(DWORD,PNOTIFYICONDATAW);
330 int WINAPI ShellAboutA(HWND,LPCSTR,LPCSTR,HICON);
331 int WINAPI ShellAboutW(HWND,LPCWSTR,LPCWSTR,HICON);
332 HINSTANCE WINAPI ShellExecuteA(HWND,LPCSTR,LPCSTR,LPCSTR,LPCSTR,INT);
333 HINSTANCE WINAPI ShellExecuteW(HWND,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,INT);
334 BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA);
335 BOOL WINAPI ShellExecuteExW(LPSHELLEXECUTEINFOW);
336 int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA);
337 int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW);
338 void WINAPI SHFreeNameMappings(HANDLE);
339 DWORD WINAPI SHGetFileInfoA(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT);
340 DWORD WINAPI SHGetFileInfoW(LPCWSTR,DWORD,SHFILEINFOW*,UINT,UINT);
341 HRESULT WINAPI SHQueryRecycleBinA(LPCSTR, LPSHQUERYRBINFO);
342 HRESULT WINAPI SHQueryRecycleBinW(LPCWSTR, LPSHQUERYRBINFO);
343 HRESULT WINAPI SHEmptyRecycleBinA(HWND,LPCSTR,DWORD);
344 HRESULT WINAPI SHEmptyRecycleBinW(HWND,LPCWSTR,DWORD);
345
346 #if (_WIN32_WINNT >= 0x600)
347 #define SHIL_LARGE 0x0
348 #define SHIL_SMALL 0x1
349 #define SHIL_EXTRALARGE 0x2
350 #define SHIL_SYSSMALL 0x3
351 #define SHIL_JUMBO 0x4
352 #define SHIL_LAST SHIL_JUMBO
353 HRESULT WINAPI SHGetImageList(int,REFIID,void**);
354 #endif
355
356 #ifdef UNICODE
357 typedef NOTIFYICONDATAW NOTIFYICONDATA,*PNOTIFYICONDATA;
358 typedef SHELLEXECUTEINFOW SHELLEXECUTEINFO,*LPSHELLEXECUTEINFO;
359 typedef SHFILEOPSTRUCTW SHFILEOPSTRUCT,*LPSHFILEOPSTRUCT;
360 typedef SHFILEINFOW SHFILEINFO;
361 #define DragQueryFile DragQueryFileW
362 #define ExtractAssociatedIcon ExtractAssociatedIconW
363 #define ExtractIcon ExtractIconW
364 #define ExtractIconEx ExtractIconExW
365 #define FindExecutable FindExecutableW
366 #define Shell_NotifyIcon Shell_NotifyIconW
367 #define ShellAbout ShellAboutW
368 #define ShellExecute ShellExecuteW
369 #define ShellExecuteEx ShellExecuteExW
370 #define SHFileOperation SHFileOperationW
371 #define SHGetFileInfo SHGetFileInfoW
372 #define SHQueryRecycleBin SHQueryRecycleBinW
373 #define SHEmptyRecycleBin SHEmptyRecycleBinW
374
375 #else
376 typedef NOTIFYICONDATAA NOTIFYICONDATA,*PNOTIFYICONDATA;
377 typedef SHELLEXECUTEINFOA SHELLEXECUTEINFO,*LPSHELLEXECUTEINFO;
378 typedef SHFILEOPSTRUCTA SHFILEOPSTRUCT,*LPSHFILEOPSTRUCT;
379 typedef SHFILEINFOA SHFILEINFO;
380 #define DragQueryFile DragQueryFileA
381 #define ExtractAssociatedIcon ExtractAssociatedIconA
382 #define ExtractIcon ExtractIconA
383 #define ExtractIconEx ExtractIconExA
384 #define FindExecutable FindExecutableA
385 #define Shell_NotifyIcon Shell_NotifyIconA
386 #define ShellAbout ShellAboutA
387 #define ShellExecute ShellExecuteA
388 #define ShellExecuteEx ShellExecuteExA
389 #define SHFileOperation SHFileOperationA
390 #define SHGetFileInfo SHGetFileInfoA
391 #define SHQueryRecycleBin SHQueryRecycleBinA
392 #define SHEmptyRecycleBin SHEmptyRecycleBinA
393 #endif
394 #ifdef __cplusplus
395 }
396 #endif
397 #endif