shellapi.h 14.7 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (C) the Wine project
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 18
 */

19 20
#ifndef __WINE_SHELLAPI_H
#define __WINE_SHELLAPI_H
21

22 23 24 25
#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */

26
#include <pshpack1.h>
27

28 29
DECLARE_HANDLE(HDROP);

30 31 32 33
/******************************************
 * DragObject
 */

34
typedef struct _DRAGINFOA
35 36 37 38 39
{	UINT uSize;
	POINT pt;
	BOOL fNC;
	LPSTR   lpFileList;
	DWORD grfKeyState;
40
} DRAGINFOA, *LPDRAGINFOA;
41

42
typedef struct _DRAGINFOW
43 44 45 46 47
{	UINT uSize;
	POINT pt;
	BOOL fNC;
	LPWSTR  lpFileList;
	DWORD grfKeyState;
48
} DRAGINFOW, *LPDRAGINFOW;
49

50 51
DECL_WINELIB_TYPE_AW(DRAGINFO)
DECL_WINELIB_TYPE_AW(LPDRAGINFO)
52

53
void	WINAPI DragAcceptFiles(HWND hWnd, BOOL b);
54 55
UINT	WINAPI DragQueryFileA(HDROP hDrop, UINT lFile, LPSTR lpszFile, UINT lLength);
UINT	WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszFile, UINT lLength);
56
#define        DragQueryFile WINELIB_NAME_AW(DragQueryFile)
57 58 59
void	WINAPI DragFinish(HDROP h);
BOOL	WINAPI DragQueryPoint(HDROP hDrop, POINT *p);

60 61 62
#define NIF_MESSAGE             0x00000001
#define NIF_ICON                0x00000002
#define NIF_TIP                 0x00000004
Peter Lemenkov's avatar
Peter Lemenkov committed
63 64 65
#define NIF_STATE               0x00000008
#define NIF_INFO                0x00000010
#define NIF_GUID                0x00000020
66 67 68 69 70 71

#define NIM_ADD                 0x00000000
#define NIM_MODIFY              0x00000001
#define NIM_DELETE              0x00000002


72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99

/******************************************
 * Application Bar
 */
#define ABM_NEW			0x00000000
#define ABM_REMOVE		0x00000001
#define ABM_QUERYPOS		0x00000002
#define ABM_SETPOS		0x00000003
#define ABM_GETSTATE		0x00000004
#define ABM_GETTASKBARPOS	0x00000005
#define ABM_ACTIVATE		0x00000006
#define ABM_GETAUTOHIDEBAR	0x00000007
#define ABM_SETAUTOHIDEBAR	0x00000008
#define ABM_WINDOWPOSCHANGED	0x00000009

#define ABN_STATECHANGE		0x00000000
#define ABN_POSCHANGED		0x00000001
#define ABN_FULLSCREENAPP	0x00000002
#define ABN_WINDOWARRANGE	0x00000003

#define ABS_AUTOHIDE		0x00000001
#define ABS_ALWAYSONTOP		0x00000002

#define ABE_LEFT		0
#define ABE_TOP			1
#define ABE_RIGHT		2
#define ABE_BOTTOM		3

100
typedef struct _AppBarData
101 102 103 104 105 106 107 108
{	DWORD	cbSize;
	HWND	hWnd;
	UINT	uCallbackMessage;
	UINT	uEdge;
	RECT	rc;
	LPARAM	lParam;
} APPBARDATA, *PAPPBARDATA;

109
UINT    WINAPI SHAppBarMessage(DWORD,PAPPBARDATA);
110 111 112 113 114 115 116 117 118 119 120

/******************************************
 * SHGetFileInfo
 */

#define SHGFI_LARGEICON         0x000000000     /* get large icon */
#define SHGFI_SMALLICON         0x000000001     /* get small icon */
#define SHGFI_OPENICON          0x000000002     /* get open icon */
#define SHGFI_SHELLICONSIZE     0x000000004     /* get shell size icon */
#define SHGFI_PIDL              0x000000008     /* pszPath is a pidl */
#define SHGFI_USEFILEATTRIBUTES 0x000000010     /* use passed dwFileAttribute */
121 122
#define SHGFI_ADDOVERLAYS       0x000000020
#define SHGFI_OVERLAYINDEX      0x000000040
123 124 125 126 127 128 129 130 131 132 133
#define SHGFI_ICON              0x000000100     /* get icon */
#define SHGFI_DISPLAYNAME       0x000000200     /* get display name */
#define SHGFI_TYPENAME          0x000000400     /* get type name */
#define SHGFI_ATTRIBUTES        0x000000800     /* get attributes */
#define SHGFI_ICONLOCATION      0x000001000     /* get icon location */
#define SHGFI_EXETYPE           0x000002000     /* return exe type */
#define SHGFI_SYSICONINDEX      0x000004000     /* get system icon index */
#define SHGFI_LINKOVERLAY       0x000008000     /* put a link overlay on icon */
#define SHGFI_SELECTED          0x000010000     /* show icon in selected state */
#define SHGFI_ATTR_SPECIFIED    0x000020000     /* get only specified attributes */

134
typedef struct tagSHFILEINFOA
135 136 137 138 139 140 141
{	HICON	hIcon;			/* icon */
	int	iIcon;			/* icon index */
	DWORD	dwAttributes;		/* SFGAO_ flags */
	CHAR	szDisplayName[MAX_PATH];/* display name (or path) */
	CHAR	szTypeName[80];		/* type name */
} SHFILEINFOA;

142
typedef struct tagSHFILEINFOW
143 144 145 146 147 148 149 150 151
{	HICON	hIcon;			/* icon */
	int	iIcon;			/* icon index */
	DWORD	dwAttributes;		/* SFGAO_ flags */
	WCHAR	szDisplayName[MAX_PATH];/* display name (or path) */
	WCHAR	szTypeName[80];		/* type name */
} SHFILEINFOW;

DECL_WINELIB_TYPE_AW(SHFILEINFO)

Kevin Koltzau's avatar
Kevin Koltzau committed
152 153
DWORD_PTR	WINAPI SHGetFileInfoA(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT);
DWORD_PTR	WINAPI SHGetFileInfoW(LPCWSTR,DWORD,SHFILEINFOW*,UINT,UINT);
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
#define  SHGetFileInfo WINELIB_NAME_AW(SHGetFileInfo)

/******************************************
 * SHSetFileInfo
 */

/******************************************
* SHFileOperation
*/
#define FO_MOVE           0x0001
#define FO_COPY           0x0002
#define FO_DELETE         0x0003
#define FO_RENAME         0x0004

#define FOF_MULTIDESTFILES         0x0001
#define FOF_CONFIRMMOUSE           0x0002
170
#define FOF_SILENT                 0x0004
171
#define FOF_RENAMEONCOLLISION      0x0008
172 173
#define FOF_NOCONFIRMATION         0x0010
#define FOF_WANTMAPPINGHANDLE      0x0020
174
#define FOF_ALLOWUNDO              0x0040
175 176 177 178
#define FOF_FILESONLY              0x0080
#define FOF_SIMPLEPROGRESS         0x0100
#define FOF_NOCONFIRMMKDIR         0x0200
#define FOF_NOERRORUI              0x0400
179
#define FOF_NOCOPYSECURITYATTRIBS  0x0800
180 181 182 183 184
#define FOF_NORECURSION            0x1000  /* don't do recursion into directories */
#define FOF_NO_CONNECTED_ELEMENTS  0x2000  /* don't do connected files */
#define FOF_WANTNUKEWARNING        0x4000  /* during delete operation, warn if delete instead
                                              of recycling (even if FOF_NOCONFIRMATION) */
#define FOF_NORECURSEREPARSE       0x8000  /* don't do recursion into reparse points */
185 186 187

typedef WORD FILEOP_FLAGS;

188 189 190
#define PO_DELETE       0x0013
#define PO_RENAME       0x0014
#define PO_PORTCHANGE   0x0020
191
#define PO_REN_PORT     (PO_RENAME | PO_PORTCHANGE)
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219

typedef WORD PRINTEROP_FLAGS;

typedef struct _SHFILEOPSTRUCTA
{ HWND          hwnd;
  UINT          wFunc;
  LPCSTR          pFrom;
  LPCSTR          pTo;
  FILEOP_FLAGS    fFlags;
  BOOL          fAnyOperationsAborted;
  LPVOID          hNameMappings;
  LPCSTR          lpszProgressTitle;
} SHFILEOPSTRUCTA, *LPSHFILEOPSTRUCTA;

typedef struct _SHFILEOPSTRUCTW
{ HWND          hwnd;
  UINT          wFunc;
  LPCWSTR         pFrom;
  LPCWSTR         pTo;
  FILEOP_FLAGS    fFlags;
  BOOL          fAnyOperationsAborted;
  LPVOID          hNameMappings;
  LPCWSTR         lpszProgressTitle;
} SHFILEOPSTRUCTW, *LPSHFILEOPSTRUCTW;

#define  SHFILEOPSTRUCT WINELIB_NAME_AW(SHFILEOPSTRUCT)
#define  LPSHFILEOPSTRUCT WINELIB_NAME_AW(LPSHFILEOPSTRUCT)

220 221
int	WINAPI SHFileOperationA (LPSHFILEOPSTRUCTA lpFileOp);
int	WINAPI SHFileOperationW (LPSHFILEOPSTRUCTW lpFileOp);
222 223
#define  SHFileOperation WINELIB_NAME_AW(SHFileOperation)

224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242
typedef struct _SHNAMEMAPPINGA
{
  LPSTR    pszOldPath;
  LPSTR    pszNewPath;
  int      cchOldPath;
  int      cchNewPath;
} SHNAMEMAPPINGA, *LPSHNAMEMAPPINGA;

typedef struct _SHNAMEMAPPINGW
{
  LPWSTR   pszOldPath;
  LPWSTR   pszNewPath;
  int      cchOldPath;
  int      cchNewPath;
} SHNAMEMAPPINGW, *LPSHNAMEMAPPINGW;

DECL_WINELIB_TYPE_AW(SHNAMEMAPPING)
DECL_WINELIB_TYPE_AW(LPSHNAMEMAPPING)

243 244
void WINAPI SHFreeNameMappings(HANDLE hNameMappings);

245 246 247 248 249 250 251 252 253 254 255 256 257 258
/******************************************
 * ShellExecute
 */
#define SE_ERR_SHARE            26
#define SE_ERR_ASSOCINCOMPLETE  27
#define SE_ERR_DDETIMEOUT       28
#define SE_ERR_DDEFAIL          29
#define SE_ERR_DDEBUSY          30
#define SE_ERR_NOASSOC          31

HINSTANCE	WINAPI ShellExecuteA(HWND,LPCSTR,LPCSTR,LPCSTR,LPCSTR,INT);
HINSTANCE	WINAPI ShellExecuteW(HWND,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,INT);
#define     ShellExecute WINELIB_NAME_AW(ShellExecute)

259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
#define SE_ERR_FNF              2       /* file not found */
#define SE_ERR_PNF              3       /* path not found */
#define SE_ERR_ACCESSDENIED     5       /* access denied */
#define SE_ERR_OOM              8       /* out of memory */
#define SE_ERR_DLLNOTFOUND      32
#define SE_ERR_SHARE                    26
#define SE_ERR_ASSOCINCOMPLETE          27
#define SE_ERR_DDETIMEOUT               28
#define SE_ERR_DDEFAIL                  29
#define SE_ERR_DDEBUSY                  30
#define SE_ERR_NOASSOC                  31

#define SEE_MASK_CLASSNAME        0x00000001
#define SEE_MASK_CLASSKEY         0x00000003
#define SEE_MASK_IDLIST           0x00000004
#define SEE_MASK_INVOKEIDLIST     0x0000000c
#define SEE_MASK_ICON             0x00000010
#define SEE_MASK_HOTKEY           0x00000020
#define SEE_MASK_NOCLOSEPROCESS   0x00000040
#define SEE_MASK_CONNECTNETDRV    0x00000080
#define SEE_MASK_FLAG_DDEWAIT     0x00000100
#define SEE_MASK_DOENVSUBST       0x00000200
#define SEE_MASK_FLAG_NO_UI       0x00000400
#define SEE_MASK_UNICODE          0x00004000
#define SEE_MASK_NO_CONSOLE       0x00008000
#define SEE_MASK_ASYNCOK          0x00100000
#define SEE_MASK_HMONITOR         0x00200000
286 287 288 289
#define SEE_MASK_NOZONECHECKS     0x00800000
#define SEE_MASK_NOQUERYCLASSSTORE 0x01000000
#define SEE_MASK_WAITFORINPUTIDLE 0x02000000
#define SEE_MASK_FLAG_LOG_USAGE   0x04000000
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345

typedef struct _SHELLEXECUTEINFOA
{       DWORD cbSize;
        ULONG fMask;
        HWND hwnd;
        LPCSTR   lpVerb;
        LPCSTR   lpFile;
        LPCSTR   lpParameters;
        LPCSTR   lpDirectory;
       INT nShow;
        HINSTANCE hInstApp;
        /* Optional fields */
        LPVOID lpIDList;
        LPCSTR   lpClass;
        HKEY hkeyClass;
        DWORD dwHotKey;
        union
        { HANDLE hIcon;
          HANDLE hMonitor;
        } DUMMYUNIONNAME;
        HANDLE hProcess;
} SHELLEXECUTEINFOA, *LPSHELLEXECUTEINFOA;

typedef struct _SHELLEXECUTEINFOW
{       DWORD cbSize;
        ULONG fMask;
        HWND hwnd;
        LPCWSTR  lpVerb;
        LPCWSTR  lpFile;
        LPCWSTR  lpParameters;
        LPCWSTR  lpDirectory;
       INT nShow;
        HINSTANCE hInstApp;
        /* Optional fields*/
        LPVOID lpIDList;
        LPCWSTR  lpClass;
        HKEY hkeyClass;
        DWORD dwHotKey;
        union
        { HANDLE hIcon;
          HANDLE hMonitor;
        } DUMMYUNIONNAME;
        HANDLE hProcess;
} SHELLEXECUTEINFOW, *LPSHELLEXECUTEINFOW;

#define SHELLEXECUTEINFO   WINELIB_NAME_AW(SHELLEXECUTEINFO)
#define LPSHELLEXECUTEINFO WINELIB_NAME_AW(LPSHELLEXECUTEINFO)

BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA lpExecInfo);
BOOL WINAPI ShellExecuteExW(LPSHELLEXECUTEINFOW lpExecInfo);
#define ShellExecuteEx  WINELIB_NAME_AW(ShellExecuteEx)

void WINAPI WinExecErrorA(HWND hwnd,INT error, LPCSTR lpstrFileName, LPCSTR lpstrTitle);
void WINAPI WinExecErrorW(HWND hwnd,INT error, LPCWSTR lpstrFileName, LPCWSTR lpstrTitle);
#define WinExecError  WINELIB_NAME_AW(WinExecError)

346 347 348 349 350 351 352 353 354 355
/******************************************
 * Tray Notification
 */
typedef struct _NOTIFYICONDATAA
{	DWORD cbSize;
	HWND hWnd;
	UINT uID;
	UINT uFlags;
	UINT uCallbackMessage;
	HICON hIcon;
356 357 358 359 360 361 362 363 364 365
	CHAR szTip[128];
	DWORD dwState;
	DWORD dwStateMask;
	CHAR szInfo[256];
	union {
	    UINT uTimeout;
	    UINT uVersion;
	} DUMMYUNIONNAME;
	CHAR szInfoTitle[64];
	DWORD dwInfoFlags;
366 367 368 369 370 371 372 373 374
} NOTIFYICONDATAA, *PNOTIFYICONDATAA;

typedef struct _NOTIFYICONDATAW
{	DWORD cbSize;
	HWND hWnd;
	UINT uID;
	UINT uFlags;
	UINT uCallbackMessage;
	HICON hIcon;
375 376 377 378 379 380 381 382 383 384
	WCHAR szTip[128];
	DWORD dwState;
	DWORD dwStateMask;
	WCHAR szInfo[256];
	union {
	    UINT uTimeout;
	    UINT uVersion;
	} DUMMYUNIONNAME;
	WCHAR szInfoTitle[64];
	DWORD dwInfoFlags;
385 386
} NOTIFYICONDATAW, *PNOTIFYICONDATAW;

387 388 389 390 391 392 393
DECL_WINELIB_TYPE_AW(NOTIFYICONDATA)
DECL_WINELIB_TYPE_AW(PNOTIFYICONDATA)

BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA lpData);
BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW lpData);

#define Shell_NotifyIcon WINELIB_NAME_AW(Shell_NotifyIcon)
394

395 396 397 398 399 400 401 402 403 404 405 406 407
/******************************************
 * Links
 */

#define SHGNLI_PIDL        0x01
#define SHGNLI_PREFIXNAME  0x02
#define SHGNLI_NOUNIQUE    0x04
#define SHGNLI_NOLNK       0x08

BOOL WINAPI SHGetNewLinkInfoA(LPCSTR,LPCSTR,LPSTR,BOOL*,UINT);
BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR,LPCWSTR,LPWSTR,BOOL*,UINT);
#define     SHGetNewLinkInfo WINELIB_NAME_AW(SHGetNewLinkInfo)

408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
/******************************************
 * Recycle bin
 */

typedef struct _SHQUERYRBINFO
{
    DWORD cbSize;
    DWORDLONG i64Size;
    DWORDLONG i64NumItems;
} SHQUERYRBINFO, *LPSHQUERYRBINFO;

HRESULT     WINAPI SHEmptyRecycleBinA(HWND,LPCSTR,DWORD);
HRESULT     WINAPI SHEmptyRecycleBinW(HWND,LPCWSTR,DWORD);
#define     SHEmptyRecycleBin WINELIB_NAME_AW(SHEmptyRecycleBin)
HRESULT     WINAPI SHQueryRecycleBinA(LPCSTR,LPSHQUERYRBINFO);
HRESULT     WINAPI SHQueryRecycleBinW(LPCWSTR,LPSHQUERYRBINFO);
#define     SHQueryRecycleBin WINELIB_NAME_AW(SHQueryRecycleBin)

426 427 428 429
/******************************************
 * Misc
 */

430
LPWSTR*     WINAPI CommandLineToArgvW(LPCWSTR,int*);
431 432
HICON       WINAPI ExtractIconA(HINSTANCE,LPCSTR,UINT);
HICON       WINAPI ExtractIconW(HINSTANCE,LPCWSTR,UINT);
433
#define     ExtractIcon WINELIB_NAME_AW(ExtractIcon)
434 435
HICON       WINAPI ExtractAssociatedIconA(HINSTANCE,LPSTR,LPWORD);
HICON       WINAPI ExtractAssociatedIconW(HINSTANCE,LPWSTR,LPWORD);
436
#define     ExtractAssociatedIcon WINELIB_NAME_AW(ExtractAssociatedIcon)
437 438 439
HICON       WINAPI ExtractAssociatedIconExA(HINSTANCE,LPSTR,LPWORD,LPWORD);
HICON       WINAPI ExtractAssociatedIconExW(HINSTANCE,LPWSTR,LPWORD,LPWORD);
#define     ExtractAssociatedIconEx WINELIB_NAME_AW(ExtractAssociatedIconEx)
440 441
UINT        WINAPI ExtractIconExA(LPCSTR,INT,HICON*,HICON*,UINT);
UINT        WINAPI ExtractIconExW(LPCWSTR,INT,HICON*,HICON*,UINT);
442 443 444
#define     ExtractIconEx WINELIB_NAME_AW(ExtractIconEx)
HINSTANCE   WINAPI FindExecutableA(LPCSTR,LPCSTR,LPSTR);
HINSTANCE   WINAPI FindExecutableW(LPCWSTR,LPCWSTR,LPWSTR);
445
#define     FindExecutable WINELIB_NAME_AW(FindExecutable)
446 447
BOOL        WINAPI ShellAboutA(HWND,LPCSTR,LPCSTR,HICON);
BOOL        WINAPI ShellAboutW(HWND,LPCWSTR,LPCWSTR,HICON);
448
#define     ShellAbout WINELIB_NAME_AW(ShellAbout)
449 450 451
int         WINAPIV ShellMessageBoxA(HINSTANCE,HWND,LPCSTR,LPCSTR,UINT,...);
int         WINAPIV ShellMessageBoxW(HINSTANCE,HWND,LPCWSTR,LPCWSTR,UINT,...);
#define     ShellMessageBox WINELIB_NAME_AW(ShellMessageBox)
452 453 454 455
DWORD       WINAPI DoEnvironmentSubstA(LPSTR, UINT);
DWORD       WINAPI DoEnvironmentSubstW(LPWSTR, UINT);
#define     DoEnvironmentSubst WINELIB_NAME_AW(DoEnvironmentSubst)

456

457 458 459 460
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */

461
#include <poppack.h>
462

463
#endif /* __WINE_SHELLAPI_H */