shellapi.d revision 1.1.1.1
1/** 2 * Windows API header module 3 * 4 * Translated from MinGW Windows headers 5 * 6 * Authors: Stewart Gordon 7 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) 8 * Source: $(DRUNTIMESRC core/sys/windows/_shellapi.d) 9 */ 10module core.sys.windows.shellapi; 11version (Windows): 12@system: 13 14version (ANSI) {} else version = Unicode; 15pragma(lib, "shell32"); 16 17import core.sys.windows.w32api, core.sys.windows.windef, core.sys.windows.basetyps; 18 19enum : UINT { 20 ABE_LEFT, 21 ABE_TOP, 22 ABE_RIGHT, 23 ABE_BOTTOM // = 3 24} 25 26enum : UINT { 27 ABS_AUTOHIDE = 1, 28 ABS_ALWAYSONTOP 29} 30 31enum ULONG 32 SEE_MASK_CLASSNAME = 1, 33 SEE_MASK_CLASSKEY = 3, 34 SEE_MASK_IDLIST = 4, 35 SEE_MASK_INVOKEIDLIST = 12, 36 SEE_MASK_ICON = 0x000010, 37 SEE_MASK_HOTKEY = 0x000020, 38 SEE_MASK_NOCLOSEPROCESS = 0x000040, 39 SEE_MASK_CONNECTNETDRV = 0x000080, 40 SEE_MASK_FLAG_DDEWAIT = 0x000100, 41 SEE_MASK_DOENVSUBST = 0x000200, 42 SEE_MASK_FLAG_NO_UI = 0x000400, 43 SEE_MASK_NO_CONSOLE = 0x008000, 44 SEE_MASK_UNICODE = 0x010000, 45 SEE_MASK_ASYNCOK = 0x100000, 46 SEE_MASK_HMONITOR = 0x200000; 47 48enum : DWORD { 49 ABM_NEW, 50 ABM_REMOVE, 51 ABM_QUERYPOS, 52 ABM_SETPOS, 53 ABM_GETSTATE, 54 ABM_GETTASKBARPOS, 55 ABM_ACTIVATE, 56 ABM_GETAUTOHIDEBAR, 57 ABM_SETAUTOHIDEBAR, 58 ABM_WINDOWPOSCHANGED // = 9 59} 60 61static if (_WIN32_WINNT >= 0x501) { 62enum DWORD ABM_SETSTATE = 10; 63} 64 65enum : UINT { 66 ABN_STATECHANGE, 67 ABN_POSCHANGED, 68 ABN_FULLSCREENAPP, 69 ABN_WINDOWARRANGE 70} 71 72enum : DWORD { 73 NIM_ADD, 74 NIM_MODIFY, 75 NIM_DELETE 76} 77 78static if (_WIN32_IE >= 0x500) { 79enum NOTIFYICON_VERSION = 3; 80 81 enum : DWORD { 82 NIM_SETFOCUS = 3, 83 NIM_SETVERSION 84 } 85} 86 87enum UINT 88 NIF_MESSAGE = 1, 89 NIF_ICON = 2, 90 NIF_TIP = 4, 91 NIF_STATE = 8; 92 93static if (_WIN32_IE >= 0x500) { 94enum UINT NIF_INFO = 0x00000010; 95} 96 97static if (_WIN32_IE >= 0x600) { 98enum UINT NIF_GUID = 0x00000020; 99} 100 101static if (_WIN32_IE >= 0x500) { 102 enum : DWORD { 103 NIIF_NONE, 104 NIIF_INFO, 105 NIIF_WARNING, 106 NIIF_ERROR 107 } 108} 109 110static if (_WIN32_IE >= 0x600) { 111 enum : DWORD { 112 NIIF_ICON_MASK = 15, 113 NIIF_NOSOUND 114 } 115} 116 117enum DWORD 118 NIS_HIDDEN = 1, 119 NIS_SHAREDICON = 2; 120 121enum HINSTANCE 122 SE_ERR_FNF = cast(HINSTANCE) 2, 123 SE_ERR_PNF = cast(HINSTANCE) 3, 124 SE_ERR_ACCESSDENIED = cast(HINSTANCE) 5, 125 SE_ERR_OOM = cast(HINSTANCE) 8, 126 SE_ERR_DLLNOTFOUND = cast(HINSTANCE) 32, 127 SE_ERR_SHARE = cast(HINSTANCE) 26, 128 SE_ERR_ASSOCINCOMPLETE = cast(HINSTANCE) 27, 129 SE_ERR_DDETIMEOUT = cast(HINSTANCE) 28, 130 SE_ERR_DDEFAIL = cast(HINSTANCE) 29, 131 SE_ERR_DDEBUSY = cast(HINSTANCE) 30, 132 SE_ERR_NOASSOC = cast(HINSTANCE) 31; 133 134enum : UINT { 135 FO_MOVE = 1, 136 FO_COPY, 137 FO_DELETE, 138 FO_RENAME 139} 140 141enum FILEOP_FLAGS 142 FOF_MULTIDESTFILES = 0x0001, 143 FOF_CONFIRMMOUSE = 0x0002, 144 FOF_SILENT = 0x0004, 145 FOF_RENAMEONCOLLISION = 0x0008, 146 FOF_NOCONFIRMATION = 0x0010, 147 FOF_WANTMAPPINGHANDLE = 0x0020, 148 FOF_ALLOWUNDO = 0x0040, 149 FOF_FILESONLY = 0x0080, 150 FOF_SIMPLEPROGRESS = 0x0100, 151 FOF_NOCONFIRMMKDIR = 0x0200, 152 FOF_NOERRORUI = 0x0400, 153 FOF_NOCOPYSECURITYATTRIBS = 0x0800; 154 155// these are not documented on the MSDN site 156enum { 157 PO_DELETE = 19, 158 PO_RENAME = 20, 159 PO_PORTCHANGE = 32, 160 PO_REN_PORT = 52 161} 162 163enum UINT 164 SHGFI_LARGEICON = 0x000000, 165 SHGFI_SMALLICON = 0x000001, 166 SHGFI_OPENICON = 0x000002, 167 SHGFI_SHELLICONSIZE = 0x000004, 168 SHGFI_PIDL = 0x000008, 169 SHGFI_USEFILEATTRIBUTES = 0x000010, 170 SHGFI_ICON = 0x000100, 171 SHGFI_DISPLAYNAME = 0x000200, 172 SHGFI_TYPENAME = 0x000400, 173 SHGFI_ATTRIBUTES = 0x000800, 174 SHGFI_ICONLOCATION = 0x001000, 175 SHGFI_EXETYPE = 0x002000, 176 SHGFI_SYSICONINDEX = 0x004000, 177 SHGFI_LINKOVERLAY = 0x008000, 178 SHGFI_SELECTED = 0x010000, 179 SHGFI_ATTR_SPECIFIED = 0x020000; 180 181static if (_WIN32_IE >= 0x500) { 182enum uint 183 SHGFI_ADDOVERLAYS = 0x000020, 184 SHGFI_OVERLAYINDEX = 0x000040; 185} 186 187enum SHERB_NOCONFIRMATION = 1; 188enum SHERB_NOPROGRESSUI = 2; 189enum SHERB_NOSOUND = 4; 190 191alias WORD FILEOP_FLAGS, PRINTEROP_FLAGS; 192mixin DECLARE_HANDLE!("HDROP"); 193 194//align(2): // 1 in Win32, default in Win64 195 196struct APPBARDATA { 197 DWORD cbSize = APPBARDATA.sizeof; 198 HWND hWnd; 199 UINT uCallbackMessage; 200 UINT uEdge; 201 RECT rc; 202 LPARAM lParam; 203} 204alias APPBARDATA* PAPPBARDATA; 205 206struct NOTIFYICONDATAA { 207 DWORD cbSize = NOTIFYICONDATAA.sizeof; 208 HWND hWnd; 209 UINT uID; 210 UINT uFlags; 211 UINT uCallbackMessage; 212 HICON hIcon; 213 static if (_WIN32_IE >= 0x500) { 214 CHAR[128] szTip = 0; 215 DWORD dwState; 216 DWORD dwStateMask; 217 CHAR[256] szInfo = 0; 218 union { 219 UINT uTimeout; 220 UINT uVersion; 221 } 222 CHAR[64] szInfoTitle = 0; 223 DWORD dwInfoFlags; 224 } else { 225 CHAR[64] szTip = 0; 226 } 227 static if (_WIN32_IE >= 0x600) { 228 GUID guidItem; 229 } 230} 231alias NOTIFYICONDATAA* PNOTIFYICONDATAA; 232 233struct NOTIFYICONDATAW { 234 DWORD cbSize = NOTIFYICONDATAW.sizeof; 235 HWND hWnd; 236 UINT uID; 237 UINT uFlags; 238 UINT uCallbackMessage; 239 HICON hIcon; 240 static if (_WIN32_IE >= 0x500) { 241 WCHAR[128] szTip = 0; 242 DWORD dwState; 243 DWORD dwStateMask; 244 WCHAR[256] szInfo = 0; 245 union { 246 UINT uTimeout; 247 UINT uVersion; 248 } 249 WCHAR[64] szInfoTitle = 0; 250 DWORD dwInfoFlags; 251 } else { 252 WCHAR[64] szTip = 0; 253 } 254 static if (_WIN32_IE >= 0x600) { 255 GUID guidItem; 256 } 257} 258alias NOTIFYICONDATAW* PNOTIFYICONDATAW; 259 260struct SHELLEXECUTEINFOA { 261 DWORD cbSize = SHELLEXECUTEINFOA.sizeof; 262 ULONG fMask; 263 HWND hwnd; 264 LPCSTR lpVerb; 265 LPCSTR lpFile; 266 LPCSTR lpParameters; 267 LPCSTR lpDirectory; 268 int nShow; 269 HINSTANCE hInstApp; 270 PVOID lpIDList; 271 LPCSTR lpClass; 272 HKEY hkeyClass; 273 DWORD dwHotKey; 274 HANDLE hIcon; 275 HANDLE hProcess; 276} 277alias SHELLEXECUTEINFOA* LPSHELLEXECUTEINFOA; 278 279struct SHELLEXECUTEINFOW { 280 DWORD cbSize = SHELLEXECUTEINFOW.sizeof; 281 ULONG fMask; 282 HWND hwnd; 283 LPCWSTR lpVerb; 284 LPCWSTR lpFile; 285 LPCWSTR lpParameters; 286 LPCWSTR lpDirectory; 287 int nShow; 288 HINSTANCE hInstApp; 289 PVOID lpIDList; 290 LPCWSTR lpClass; 291 HKEY hkeyClass; 292 DWORD dwHotKey; 293 HANDLE hIcon; 294 HANDLE hProcess; 295} 296alias SHELLEXECUTEINFOW* LPSHELLEXECUTEINFOW; 297 298align(1) struct SHFILEOPSTRUCTA { 299align(1): 300 HWND hwnd; 301 UINT wFunc; 302 version (Win64) 303 WORD _padding1; 304 LPCSTR pFrom; 305 LPCSTR pTo; 306 FILEOP_FLAGS fFlags; 307 version (Win64) 308 DWORD _padding2; 309 BOOL fAnyOperationsAborted; 310 PVOID hNameMappings; 311 LPCSTR lpszProgressTitle; 312} 313alias SHFILEOPSTRUCTA* LPSHFILEOPSTRUCTA; 314 315align(1) struct SHFILEOPSTRUCTW { 316align(1): 317 HWND hwnd; 318 UINT wFunc; 319 version (Win64) 320 DWORD _padding1; 321 LPCWSTR pFrom; 322 LPCWSTR pTo; 323 FILEOP_FLAGS fFlags; 324 version (Win64) 325 WORD _padding2; 326 BOOL fAnyOperationsAborted; 327 PVOID hNameMappings; 328 LPCWSTR lpszProgressTitle; 329} 330alias SHFILEOPSTRUCTW* LPSHFILEOPSTRUCTW; 331 332struct SHFILEINFOA { 333 HICON hIcon; 334 int iIcon; 335 DWORD dwAttributes; 336 CHAR[MAX_PATH] szDisplayName = 0; 337 CHAR[80] szTypeName = 0; 338} 339 340struct SHFILEINFOW { 341 HICON hIcon; 342 int iIcon; 343 DWORD dwAttributes; 344 WCHAR[MAX_PATH] szDisplayName = 0; 345 WCHAR[80] szTypeName = 0; 346} 347 348align(1) struct SHQUERYRBINFO { 349align(1): 350 DWORD cbSize = SHQUERYRBINFO.sizeof; 351 version (Win64) 352 DWORD _padding; 353 long i64Size; 354 long i64NumItems; 355} 356alias SHQUERYRBINFO* LPSHQUERYRBINFO; 357 358extern (Windows) nothrow @nogc { 359 LPWSTR* CommandLineToArgvW(LPCWSTR, int*); 360 void DragAcceptFiles(HWND, BOOL); 361 void DragFinish(HDROP); 362 UINT DragQueryFileA(HDROP, UINT, LPSTR, UINT); 363 UINT DragQueryFileW(HDROP, UINT, LPWSTR, UINT); 364 BOOL DragQueryPoint(HDROP, LPPOINT); 365 HICON DuplicateIcon(HINSTANCE, HICON); 366 HICON ExtractAssociatedIconA(HINSTANCE, LPCSTR, PWORD); 367 HICON ExtractAssociatedIconW(HINSTANCE, LPCWSTR, PWORD); 368 HICON ExtractIconA(HINSTANCE, LPCSTR, UINT); 369 HICON ExtractIconW(HINSTANCE, LPCWSTR, UINT); 370 UINT ExtractIconExA(LPCSTR, int, HICON*, HICON*, UINT); 371 UINT ExtractIconExW(LPCWSTR, int, HICON*, HICON*, UINT); 372 HINSTANCE FindExecutableA(LPCSTR, LPCSTR, LPSTR); 373 HINSTANCE FindExecutableW(LPCWSTR, LPCWSTR, LPWSTR); 374 UINT_PTR SHAppBarMessage(DWORD, PAPPBARDATA); 375 BOOL Shell_NotifyIconA(DWORD, PNOTIFYICONDATAA); 376 BOOL Shell_NotifyIconW(DWORD, PNOTIFYICONDATAW); 377 int ShellAboutA(HWND, LPCSTR, LPCSTR, HICON); 378 int ShellAboutW(HWND, LPCWSTR, LPCWSTR, HICON); 379 HINSTANCE ShellExecuteA(HWND, LPCSTR, LPCSTR, LPCSTR, LPCSTR, INT); 380 HINSTANCE ShellExecuteW(HWND, LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR, INT); 381 BOOL ShellExecuteExA(LPSHELLEXECUTEINFOA); 382 BOOL ShellExecuteExW(LPSHELLEXECUTEINFOW); 383 int SHFileOperationA(LPSHFILEOPSTRUCTA); 384 int SHFileOperationW(LPSHFILEOPSTRUCTW); 385 void SHFreeNameMappings(HANDLE); 386 DWORD_PTR SHGetFileInfoA(LPCSTR, DWORD, SHFILEINFOA*, UINT, UINT); 387 DWORD_PTR SHGetFileInfoW(LPCWSTR, DWORD, SHFILEINFOW*, UINT, UINT); 388 HRESULT SHQueryRecycleBinA(LPCSTR, LPSHQUERYRBINFO); 389 HRESULT SHQueryRecycleBinW(LPCWSTR, LPSHQUERYRBINFO); 390 HRESULT SHEmptyRecycleBinA(HWND, LPCSTR, DWORD); 391 HRESULT SHEmptyRecycleBinW(HWND, LPCWSTR, DWORD); 392} 393 394version (Unicode) { 395 alias NOTIFYICONDATAW NOTIFYICONDATA; 396 alias SHELLEXECUTEINFOW SHELLEXECUTEINFO; 397 alias SHFILEOPSTRUCTW SHFILEOPSTRUCT; 398 alias SHFILEINFOW SHFILEINFO; 399 alias DragQueryFileW DragQueryFile; 400 alias ExtractAssociatedIconW ExtractAssociatedIcon; 401 alias ExtractIconW ExtractIcon; 402 alias ExtractIconExW ExtractIconEx; 403 alias FindExecutableW FindExecutable; 404 alias Shell_NotifyIconW Shell_NotifyIcon; 405 alias ShellAboutW ShellAbout; 406 alias ShellExecuteW ShellExecute; 407 alias ShellExecuteExW ShellExecuteEx; 408 alias SHFileOperationW SHFileOperation; 409 alias SHGetFileInfoW SHGetFileInfo; 410 alias SHQueryRecycleBinW SHQueryRecycleBin; 411 alias SHEmptyRecycleBinW SHEmptyRecycleBin; 412} else { 413 alias NOTIFYICONDATAA NOTIFYICONDATA; 414 alias SHELLEXECUTEINFOA SHELLEXECUTEINFO; 415 alias SHFILEOPSTRUCTA SHFILEOPSTRUCT; 416 alias SHFILEINFOA SHFILEINFO; 417 alias DragQueryFileA DragQueryFile; 418 alias ExtractAssociatedIconA ExtractAssociatedIcon; 419 alias ExtractIconA ExtractIcon; 420 alias ExtractIconExA ExtractIconEx; 421 alias FindExecutableA FindExecutable; 422 alias Shell_NotifyIconA Shell_NotifyIcon; 423 alias ShellAboutA ShellAbout; 424 alias ShellExecuteA ShellExecute; 425 alias ShellExecuteExA ShellExecuteEx; 426 alias SHFileOperationA SHFileOperation; 427 alias SHGetFileInfoA SHGetFileInfo; 428 alias SHQueryRecycleBinA SHQueryRecycleBin; 429 alias SHEmptyRecycleBinA SHEmptyRecycleBin; 430} 431 432alias NOTIFYICONDATA* PNOTIFYICONDATA; 433alias SHELLEXECUTEINFO* LPSHELLEXECUTEINFO; 434alias SHFILEOPSTRUCT* LPSHFILEOPSTRUCT; 435