Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

969 lines
32 KiB

  1. /*****************************************************************************\
  2. * *
  3. * shellapi.h - SHELL.DLL functions, types, and definitions *
  4. * *
  5. * Copyright (c) Microsoft Corporation. All rights reserved. *
  6. * *
  7. \*****************************************************************************/
  8. #ifndef _INC_SHELLAPI
  9. #define _INC_SHELLAPI
  10. //
  11. // Define API decoration for direct importing of DLL references.
  12. //
  13. #ifndef WINSHELLAPI
  14. #if !defined(_SHELL32_)
  15. #define WINSHELLAPI DECLSPEC_IMPORT
  16. #else
  17. #define WINSHELLAPI
  18. #endif
  19. #endif // WINSHELLAPI
  20. #ifndef SHSTDAPI
  21. #if !defined(_SHELL32_)
  22. #define SHSTDAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  23. #define SHSTDAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  24. #else
  25. #define SHSTDAPI STDAPI
  26. #define SHSTDAPI_(type) STDAPI_(type)
  27. #endif
  28. #endif // SHSTDAPI
  29. #ifndef SHDOCAPI
  30. #if !defined(_SHDOCVW_)
  31. #define SHDOCAPI EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  32. #define SHDOCAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  33. #else
  34. #define SHDOCAPI STDAPI
  35. #define SHDOCAPI_(type) STDAPI_(type)
  36. #endif
  37. #endif // SHDOCAPI
  38. #if !defined(_WIN64)
  39. #include <pshpack1.h>
  40. #endif
  41. #ifdef __cplusplus
  42. extern "C" { /* Assume C declarations for C++ */
  43. #endif /* __cplusplus */
  44. DECLARE_HANDLE(HDROP);
  45. SHSTDAPI_(UINT) DragQueryFileA(HDROP,UINT,LPSTR,UINT);
  46. SHSTDAPI_(UINT) DragQueryFileW(HDROP,UINT,LPWSTR,UINT);
  47. #ifdef UNICODE
  48. #define DragQueryFile DragQueryFileW
  49. #else
  50. #define DragQueryFile DragQueryFileA
  51. #endif // !UNICODE
  52. SHSTDAPI_(BOOL) DragQueryPoint(HDROP,LPPOINT);
  53. SHSTDAPI_(void) DragFinish(HDROP);
  54. SHSTDAPI_(void) DragAcceptFiles(HWND,BOOL);
  55. SHSTDAPI_(HINSTANCE) ShellExecuteA(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd);
  56. SHSTDAPI_(HINSTANCE) ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd);
  57. #ifdef UNICODE
  58. #define ShellExecute ShellExecuteW
  59. #else
  60. #define ShellExecute ShellExecuteA
  61. #endif // !UNICODE
  62. SHSTDAPI_(HINSTANCE) FindExecutableA(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult);
  63. SHSTDAPI_(HINSTANCE) FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult);
  64. #ifdef UNICODE
  65. #define FindExecutable FindExecutableW
  66. #else
  67. #define FindExecutable FindExecutableA
  68. #endif // !UNICODE
  69. SHSTDAPI_(LPWSTR *) CommandLineToArgvW(LPCWSTR lpCmdLine, int*pNumArgs);
  70. SHSTDAPI_(INT) ShellAboutA(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon);
  71. SHSTDAPI_(INT) ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon);
  72. #ifdef UNICODE
  73. #define ShellAbout ShellAboutW
  74. #else
  75. #define ShellAbout ShellAboutA
  76. #endif // !UNICODE
  77. SHSTDAPI_(HICON) DuplicateIcon(HINSTANCE hInst, HICON hIcon);
  78. SHSTDAPI_(HICON) ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon);
  79. SHSTDAPI_(HICON) ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIcon);
  80. #ifdef UNICODE
  81. #define ExtractAssociatedIcon ExtractAssociatedIconW
  82. #else
  83. #define ExtractAssociatedIcon ExtractAssociatedIconA
  84. #endif // !UNICODE
  85. SHSTDAPI_(HICON) ExtractAssociatedIconExA(HINSTANCE hInst,LPSTR lpIconPath,LPWORD lpiIconIndex, LPWORD lpiIconId);
  86. SHSTDAPI_(HICON) ExtractAssociatedIconExW(HINSTANCE hInst,LPWSTR lpIconPath,LPWORD lpiIconIndex, LPWORD lpiIconId);
  87. #ifdef UNICODE
  88. #define ExtractAssociatedIconEx ExtractAssociatedIconExW
  89. #else
  90. #define ExtractAssociatedIconEx ExtractAssociatedIconExA
  91. #endif // !UNICODE
  92. SHSTDAPI_(HICON) ExtractIconA(HINSTANCE hInst, LPCSTR lpszExeFileName, UINT nIconIndex);
  93. SHSTDAPI_(HICON) ExtractIconW(HINSTANCE hInst, LPCWSTR lpszExeFileName, UINT nIconIndex);
  94. #ifdef UNICODE
  95. #define ExtractIcon ExtractIconW
  96. #else
  97. #define ExtractIcon ExtractIconA
  98. #endif // !UNICODE
  99. #if(WINVER >= 0x0400)
  100. typedef struct _DRAGINFOA {
  101. UINT uSize; /* init with sizeof(DRAGINFO) */
  102. POINT pt;
  103. BOOL fNC;
  104. LPSTR lpFileList;
  105. DWORD grfKeyState;
  106. } DRAGINFOA, *LPDRAGINFOA;
  107. typedef struct _DRAGINFOW {
  108. UINT uSize; /* init with sizeof(DRAGINFO) */
  109. POINT pt;
  110. BOOL fNC;
  111. LPWSTR lpFileList;
  112. DWORD grfKeyState;
  113. } DRAGINFOW, *LPDRAGINFOW;
  114. #ifdef UNICODE
  115. typedef DRAGINFOW DRAGINFO;
  116. typedef LPDRAGINFOW LPDRAGINFO;
  117. #else
  118. typedef DRAGINFOA DRAGINFO;
  119. typedef LPDRAGINFOA LPDRAGINFO;
  120. #endif // UNICODE
  121. ////
  122. //// AppBar stuff
  123. ////
  124. #define ABM_NEW 0x00000000
  125. #define ABM_REMOVE 0x00000001
  126. #define ABM_QUERYPOS 0x00000002
  127. #define ABM_SETPOS 0x00000003
  128. #define ABM_GETSTATE 0x00000004
  129. #define ABM_GETTASKBARPOS 0x00000005
  130. #define ABM_ACTIVATE 0x00000006 // lParam == TRUE/FALSE means activate/deactivate
  131. #define ABM_GETAUTOHIDEBAR 0x00000007
  132. #define ABM_SETAUTOHIDEBAR 0x00000008 // this can fail at any time. MUST check the result
  133. // lParam = TRUE/FALSE Set/Unset
  134. // uEdge = what edge
  135. #define ABM_WINDOWPOSCHANGED 0x0000009
  136. #define ABM_SETSTATE 0x0000000a
  137. // these are put in the wparam of callback messages
  138. #define ABN_STATECHANGE 0x0000000
  139. #define ABN_POSCHANGED 0x0000001
  140. #define ABN_FULLSCREENAPP 0x0000002
  141. #define ABN_WINDOWARRANGE 0x0000003 // lParam == TRUE means hide
  142. // flags for get state
  143. #define ABS_AUTOHIDE 0x0000001
  144. #define ABS_ALWAYSONTOP 0x0000002
  145. #define ABE_LEFT 0
  146. #define ABE_TOP 1
  147. #define ABE_RIGHT 2
  148. #define ABE_BOTTOM 3
  149. typedef struct _AppBarData
  150. {
  151. DWORD cbSize;
  152. HWND hWnd;
  153. UINT uCallbackMessage;
  154. UINT uEdge;
  155. RECT rc;
  156. LPARAM lParam; // message specific
  157. } APPBARDATA, *PAPPBARDATA;
  158. SHSTDAPI_(UINT_PTR) SHAppBarMessage(DWORD dwMessage, PAPPBARDATA pData);
  159. ////
  160. //// EndAppBar
  161. ////
  162. SHSTDAPI_(DWORD) DoEnvironmentSubstA(LPSTR szString, UINT cchString);
  163. SHSTDAPI_(DWORD) DoEnvironmentSubstW(LPWSTR szString, UINT cchString);
  164. #ifdef UNICODE
  165. #define DoEnvironmentSubst DoEnvironmentSubstW
  166. #else
  167. #define DoEnvironmentSubst DoEnvironmentSubstA
  168. #endif // !UNICODE
  169. #define EIRESID(x) (-1 * (int)(x))
  170. SHSTDAPI_(UINT) ExtractIconExA(LPCSTR lpszFile, int nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons);
  171. SHSTDAPI_(UINT) ExtractIconExW(LPCWSTR lpszFile, int nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIcons);
  172. #ifdef UNICODE
  173. #define ExtractIconEx ExtractIconExW
  174. #else
  175. #define ExtractIconEx ExtractIconExA
  176. #endif // !UNICODE
  177. ////
  178. //// Shell File Operations
  179. ////
  180. #ifndef FO_MOVE //these need to be kept in sync with the ones in shlobj.h
  181. #define FO_MOVE 0x0001
  182. #define FO_COPY 0x0002
  183. #define FO_DELETE 0x0003
  184. #define FO_RENAME 0x0004
  185. #define FOF_MULTIDESTFILES 0x0001
  186. #define FOF_CONFIRMMOUSE 0x0002
  187. #define FOF_SILENT 0x0004 // don't create progress/report
  188. #define FOF_RENAMEONCOLLISION 0x0008
  189. #define FOF_NOCONFIRMATION 0x0010 // Don't prompt the user.
  190. #define FOF_WANTMAPPINGHANDLE 0x0020 // Fill in SHFILEOPSTRUCT.hNameMappings
  191. // Must be freed using SHFreeNameMappings
  192. #define FOF_ALLOWUNDO 0x0040
  193. #define FOF_FILESONLY 0x0080 // on *.*, do only files
  194. #define FOF_SIMPLEPROGRESS 0x0100 // means don't show names of files
  195. #define FOF_NOCONFIRMMKDIR 0x0200 // don't confirm making any needed dirs
  196. #define FOF_NOERRORUI 0x0400 // don't put up error UI
  197. #define FOF_NOCOPYSECURITYATTRIBS 0x0800 // dont copy NT file Security Attributes
  198. #define FOF_NORECURSION 0x1000 // don't recurse into directories.
  199. #if (_WIN32_IE >= 0x0500)
  200. #define FOF_NO_CONNECTED_ELEMENTS 0x2000 // don't operate on connected elements.
  201. #define FOF_WANTNUKEWARNING 0x4000 // during delete operation, warn if nuking instead of recycling (partially overrides FOF_NOCONFIRMATION)
  202. #endif // (_WIN32_IE >= 0x500)
  203. #if (_WIN32_WINNT >= 0x0501)
  204. #define FOF_NORECURSEREPARSE 0x8000 // treat reparse points as objects, not containers
  205. #endif // (_WIN32_WINNT >= 0x501)
  206. typedef WORD FILEOP_FLAGS;
  207. #define PO_DELETE 0x0013 // printer is being deleted
  208. #define PO_RENAME 0x0014 // printer is being renamed
  209. #define PO_PORTCHANGE 0x0020 // port this printer connected to is being changed
  210. // if this id is set, the strings received by
  211. // the copyhook are a doubly-null terminated
  212. // list of strings. The first is the printer
  213. // name and the second is the printer port.
  214. #define PO_REN_PORT 0x0034 // PO_RENAME and PO_PORTCHANGE at same time.
  215. // no POF_ flags currently defined
  216. typedef WORD PRINTEROP_FLAGS;
  217. #endif // FO_MOVE
  218. // implicit parameters are:
  219. // if pFrom or pTo are unqualified names the current directories are
  220. // taken from the global current drive/directory settings managed
  221. // by Get/SetCurrentDrive/Directory
  222. //
  223. // the global confirmation settings
  224. typedef struct _SHFILEOPSTRUCTA
  225. {
  226. HWND hwnd;
  227. UINT wFunc;
  228. LPCSTR pFrom;
  229. LPCSTR pTo;
  230. FILEOP_FLAGS fFlags;
  231. BOOL fAnyOperationsAborted;
  232. LPVOID hNameMappings;
  233. LPCSTR lpszProgressTitle; // only used if FOF_SIMPLEPROGRESS
  234. } SHFILEOPSTRUCTA, *LPSHFILEOPSTRUCTA;
  235. typedef struct _SHFILEOPSTRUCTW
  236. {
  237. HWND hwnd;
  238. UINT wFunc;
  239. LPCWSTR pFrom;
  240. LPCWSTR pTo;
  241. FILEOP_FLAGS fFlags;
  242. BOOL fAnyOperationsAborted;
  243. LPVOID hNameMappings;
  244. LPCWSTR lpszProgressTitle; // only used if FOF_SIMPLEPROGRESS
  245. } SHFILEOPSTRUCTW, *LPSHFILEOPSTRUCTW;
  246. #ifdef UNICODE
  247. typedef SHFILEOPSTRUCTW SHFILEOPSTRUCT;
  248. typedef LPSHFILEOPSTRUCTW LPSHFILEOPSTRUCT;
  249. #else
  250. typedef SHFILEOPSTRUCTA SHFILEOPSTRUCT;
  251. typedef LPSHFILEOPSTRUCTA LPSHFILEOPSTRUCT;
  252. #endif // UNICODE
  253. SHSTDAPI_(int) SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp);
  254. SHSTDAPI_(int) SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp);
  255. #ifdef UNICODE
  256. #define SHFileOperation SHFileOperationW
  257. #else
  258. #define SHFileOperation SHFileOperationA
  259. #endif // !UNICODE
  260. SHSTDAPI_(void) SHFreeNameMappings(HANDLE hNameMappings);
  261. typedef struct _SHNAMEMAPPINGA
  262. {
  263. LPSTR pszOldPath;
  264. LPSTR pszNewPath;
  265. int cchOldPath;
  266. int cchNewPath;
  267. } SHNAMEMAPPINGA, *LPSHNAMEMAPPINGA;
  268. typedef struct _SHNAMEMAPPINGW
  269. {
  270. LPWSTR pszOldPath;
  271. LPWSTR pszNewPath;
  272. int cchOldPath;
  273. int cchNewPath;
  274. } SHNAMEMAPPINGW, *LPSHNAMEMAPPINGW;
  275. #ifdef UNICODE
  276. typedef SHNAMEMAPPINGW SHNAMEMAPPING;
  277. typedef LPSHNAMEMAPPINGW LPSHNAMEMAPPING;
  278. #else
  279. typedef SHNAMEMAPPINGA SHNAMEMAPPING;
  280. typedef LPSHNAMEMAPPINGA LPSHNAMEMAPPING;
  281. #endif // UNICODE
  282. ////
  283. //// End Shell File Operations
  284. ////
  285. ////
  286. //// Begin ShellExecuteEx and family
  287. ////
  288. /* ShellExecute() and ShellExecuteEx() error codes */
  289. /* regular WinExec() codes */
  290. #define SE_ERR_FNF 2 // file not found
  291. #define SE_ERR_PNF 3 // path not found
  292. #define SE_ERR_ACCESSDENIED 5 // access denied
  293. #define SE_ERR_OOM 8 // out of memory
  294. #define SE_ERR_DLLNOTFOUND 32
  295. #endif /* WINVER >= 0x0400 */
  296. /* error values for ShellExecute() beyond the regular WinExec() codes */
  297. #define SE_ERR_SHARE 26
  298. #define SE_ERR_ASSOCINCOMPLETE 27
  299. #define SE_ERR_DDETIMEOUT 28
  300. #define SE_ERR_DDEFAIL 29
  301. #define SE_ERR_DDEBUSY 30
  302. #define SE_ERR_NOASSOC 31
  303. #if(WINVER >= 0x0400)
  304. // Note CLASSKEY overrides CLASSNAME
  305. #define SEE_MASK_CLASSNAME 0x00000001
  306. #define SEE_MASK_CLASSKEY 0x00000003
  307. // Note INVOKEIDLIST overrides IDLIST
  308. #define SEE_MASK_IDLIST 0x00000004
  309. #define SEE_MASK_INVOKEIDLIST 0x0000000c
  310. #define SEE_MASK_ICON 0x00000010
  311. #define SEE_MASK_HOTKEY 0x00000020
  312. #define SEE_MASK_NOCLOSEPROCESS 0x00000040
  313. #define SEE_MASK_CONNECTNETDRV 0x00000080
  314. #define SEE_MASK_FLAG_DDEWAIT 0x00000100
  315. #define SEE_MASK_DOENVSUBST 0x00000200
  316. #define SEE_MASK_FLAG_NO_UI 0x00000400
  317. #define SEE_MASK_UNICODE 0x00004000
  318. #define SEE_MASK_NO_CONSOLE 0x00008000
  319. #define SEE_MASK_ASYNCOK 0x00100000
  320. #define SEE_MASK_HMONITOR 0x00200000
  321. #if (_WIN32_IE >= 0x0560)
  322. #define SEE_MASK_NOZONECHECKS 0x00800000
  323. #endif // (_WIN32_IE >= 0x560)
  324. #if (_WIN32_IE >= 0x0500)
  325. #define SEE_MASK_NOQUERYCLASSSTORE 0x01000000
  326. #define SEE_MASK_WAITFORINPUTIDLE 0x02000000
  327. #endif // (_WIN32_IE >= 0x500)
  328. #if (_WIN32_IE >= 0x0560)
  329. #define SEE_MASK_FLAG_LOG_USAGE 0x04000000
  330. #endif // (_WIN32_IE >= 0x560)
  331. //
  332. // For compilers that don't support nameless unions
  333. //
  334. #ifndef DUMMYUNIONNAME
  335. #ifdef NONAMELESSUNION
  336. #define DUMMYUNIONNAME u
  337. #define DUMMYUNIONNAME2 u2
  338. #define DUMMYUNIONNAME3 u3
  339. #define DUMMYUNIONNAME4 u4
  340. #define DUMMYUNIONNAME5 u5
  341. #else
  342. #define DUMMYUNIONNAME
  343. #define DUMMYUNIONNAME2
  344. #define DUMMYUNIONNAME3
  345. #define DUMMYUNIONNAME4
  346. #define DUMMYUNIONNAME5
  347. #endif
  348. #endif // DUMMYUNIONNAME
  349. typedef struct _SHELLEXECUTEINFOA
  350. {
  351. DWORD cbSize;
  352. ULONG fMask;
  353. HWND hwnd;
  354. LPCSTR lpVerb;
  355. LPCSTR lpFile;
  356. LPCSTR lpParameters;
  357. LPCSTR lpDirectory;
  358. int nShow;
  359. HINSTANCE hInstApp;
  360. // Optional fields
  361. LPVOID lpIDList;
  362. LPCSTR lpClass;
  363. HKEY hkeyClass;
  364. DWORD dwHotKey;
  365. union {
  366. HANDLE hIcon;
  367. HANDLE hMonitor;
  368. } DUMMYUNIONNAME;
  369. HANDLE hProcess;
  370. } SHELLEXECUTEINFOA, *LPSHELLEXECUTEINFOA;
  371. typedef struct _SHELLEXECUTEINFOW
  372. {
  373. DWORD cbSize;
  374. ULONG fMask;
  375. HWND hwnd;
  376. LPCWSTR lpVerb;
  377. LPCWSTR lpFile;
  378. LPCWSTR lpParameters;
  379. LPCWSTR lpDirectory;
  380. int nShow;
  381. HINSTANCE hInstApp;
  382. // Optional fields
  383. LPVOID lpIDList;
  384. LPCWSTR lpClass;
  385. HKEY hkeyClass;
  386. DWORD dwHotKey;
  387. union {
  388. HANDLE hIcon;
  389. HANDLE hMonitor;
  390. } DUMMYUNIONNAME;
  391. HANDLE hProcess;
  392. } SHELLEXECUTEINFOW, *LPSHELLEXECUTEINFOW;
  393. #ifdef UNICODE
  394. typedef SHELLEXECUTEINFOW SHELLEXECUTEINFO;
  395. typedef LPSHELLEXECUTEINFOW LPSHELLEXECUTEINFO;
  396. #else
  397. typedef SHELLEXECUTEINFOA SHELLEXECUTEINFO;
  398. typedef LPSHELLEXECUTEINFOA LPSHELLEXECUTEINFO;
  399. #endif // UNICODE
  400. SHSTDAPI_(BOOL) ShellExecuteExA(LPSHELLEXECUTEINFOA lpExecInfo);
  401. SHSTDAPI_(BOOL) ShellExecuteExW(LPSHELLEXECUTEINFOW lpExecInfo);
  402. #ifdef UNICODE
  403. #define ShellExecuteEx ShellExecuteExW
  404. #else
  405. #define ShellExecuteEx ShellExecuteExA
  406. #endif // !UNICODE
  407. SHSTDAPI_(void) WinExecErrorA(HWND hwnd, int error, LPCSTR lpstrFileName, LPCSTR lpstrTitle);
  408. SHSTDAPI_(void) WinExecErrorW(HWND hwnd, int error, LPCWSTR lpstrFileName, LPCWSTR lpstrTitle);
  409. #ifdef UNICODE
  410. #define WinExecError WinExecErrorW
  411. #else
  412. #define WinExecError WinExecErrorA
  413. #endif // !UNICODE
  414. //
  415. // SHCreateProcessAsUser()
  416. typedef struct _SHCREATEPROCESSINFOW
  417. {
  418. DWORD cbSize;
  419. ULONG fMask;
  420. HWND hwnd;
  421. LPCWSTR pszFile;
  422. LPCWSTR pszParameters;
  423. LPCWSTR pszCurrentDirectory;
  424. IN HANDLE hUserToken;
  425. IN LPSECURITY_ATTRIBUTES lpProcessAttributes;
  426. IN LPSECURITY_ATTRIBUTES lpThreadAttributes;
  427. IN BOOL bInheritHandles;
  428. IN DWORD dwCreationFlags;
  429. IN LPSTARTUPINFOW lpStartupInfo;
  430. OUT LPPROCESS_INFORMATION lpProcessInformation;
  431. } SHCREATEPROCESSINFOW, *PSHCREATEPROCESSINFOW;
  432. SHSTDAPI_(BOOL) SHCreateProcessAsUserW(PSHCREATEPROCESSINFOW pscpi);
  433. ////
  434. //// End ShellExecuteEx and family
  435. ////
  436. //
  437. // RecycleBin
  438. //
  439. // struct for query recycle bin info
  440. typedef struct _SHQUERYRBINFO {
  441. DWORD cbSize;
  442. #if !defined(_MAC) || defined(_MAC_INT_64)
  443. __int64 i64Size;
  444. __int64 i64NumItems;
  445. #else
  446. DWORDLONG i64Size;
  447. DWORDLONG i64NumItems;
  448. #endif
  449. } SHQUERYRBINFO, *LPSHQUERYRBINFO;
  450. // flags for SHEmptyRecycleBin
  451. //
  452. #define SHERB_NOCONFIRMATION 0x00000001
  453. #define SHERB_NOPROGRESSUI 0x00000002
  454. #define SHERB_NOSOUND 0x00000004
  455. SHSTDAPI SHQueryRecycleBinA(LPCSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo);
  456. SHSTDAPI SHQueryRecycleBinW(LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo);
  457. #ifdef UNICODE
  458. #define SHQueryRecycleBin SHQueryRecycleBinW
  459. #else
  460. #define SHQueryRecycleBin SHQueryRecycleBinA
  461. #endif // !UNICODE
  462. SHSTDAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags);
  463. SHSTDAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags);
  464. #ifdef UNICODE
  465. #define SHEmptyRecycleBin SHEmptyRecycleBinW
  466. #else
  467. #define SHEmptyRecycleBin SHEmptyRecycleBinA
  468. #endif // !UNICODE
  469. ////
  470. //// end of RecycleBin
  471. ////
  472. //// Tray notification definitions
  473. ////
  474. typedef struct _NOTIFYICONDATAA {
  475. DWORD cbSize;
  476. HWND hWnd;
  477. UINT uID;
  478. UINT uFlags;
  479. UINT uCallbackMessage;
  480. HICON hIcon;
  481. #if (_WIN32_IE < 0x0500)
  482. CHAR szTip[64];
  483. #else
  484. CHAR szTip[128];
  485. #endif
  486. #if (_WIN32_IE >= 0x0500)
  487. DWORD dwState;
  488. DWORD dwStateMask;
  489. CHAR szInfo[256];
  490. union {
  491. UINT uTimeout;
  492. UINT uVersion;
  493. } DUMMYUNIONNAME;
  494. CHAR szInfoTitle[64];
  495. DWORD dwInfoFlags;
  496. #endif
  497. #if (_WIN32_IE >= 0x600)
  498. GUID guidItem;
  499. #endif
  500. } NOTIFYICONDATAA, *PNOTIFYICONDATAA;
  501. typedef struct _NOTIFYICONDATAW {
  502. DWORD cbSize;
  503. HWND hWnd;
  504. UINT uID;
  505. UINT uFlags;
  506. UINT uCallbackMessage;
  507. HICON hIcon;
  508. #if (_WIN32_IE < 0x0500)
  509. WCHAR szTip[64];
  510. #else
  511. WCHAR szTip[128];
  512. #endif
  513. #if (_WIN32_IE >= 0x0500)
  514. DWORD dwState;
  515. DWORD dwStateMask;
  516. WCHAR szInfo[256];
  517. union {
  518. UINT uTimeout;
  519. UINT uVersion;
  520. } DUMMYUNIONNAME;
  521. WCHAR szInfoTitle[64];
  522. DWORD dwInfoFlags;
  523. #endif
  524. #if (_WIN32_IE >= 0x600)
  525. GUID guidItem;
  526. #endif
  527. } NOTIFYICONDATAW, *PNOTIFYICONDATAW;
  528. #ifdef UNICODE
  529. typedef NOTIFYICONDATAW NOTIFYICONDATA;
  530. typedef PNOTIFYICONDATAW PNOTIFYICONDATA;
  531. #else
  532. typedef NOTIFYICONDATAA NOTIFYICONDATA;
  533. typedef PNOTIFYICONDATAA PNOTIFYICONDATA;
  534. #endif // UNICODE
  535. #define NOTIFYICONDATAA_V1_SIZE FIELD_OFFSET(NOTIFYICONDATAA, szTip[64])
  536. #define NOTIFYICONDATAW_V1_SIZE FIELD_OFFSET(NOTIFYICONDATAW, szTip[64])
  537. #ifdef UNICODE
  538. #define NOTIFYICONDATA_V1_SIZE NOTIFYICONDATAW_V1_SIZE
  539. #else
  540. #define NOTIFYICONDATA_V1_SIZE NOTIFYICONDATAA_V1_SIZE
  541. #endif
  542. #define NOTIFYICONDATAA_V2_SIZE FIELD_OFFSET(NOTIFYICONDATAA, guidItem)
  543. #define NOTIFYICONDATAW_V2_SIZE FIELD_OFFSET(NOTIFYICONDATAW, guidItem)
  544. #ifdef UNICODE
  545. #define NOTIFYICONDATA_V2_SIZE NOTIFYICONDATAW_V2_SIZE
  546. #else
  547. #define NOTIFYICONDATA_V2_SIZE NOTIFYICONDATAA_V2_SIZE
  548. #endif
  549. #if (_WIN32_IE >= 0x0500)
  550. #define NIN_SELECT (WM_USER + 0)
  551. #define NINF_KEY 0x1
  552. #define NIN_KEYSELECT (NIN_SELECT | NINF_KEY)
  553. #endif
  554. #if (_WIN32_IE >= 0x0501)
  555. #define NIN_BALLOONSHOW (WM_USER + 2)
  556. #define NIN_BALLOONHIDE (WM_USER + 3)
  557. #define NIN_BALLOONTIMEOUT (WM_USER + 4)
  558. #define NIN_BALLOONUSERCLICK (WM_USER + 5)
  559. #endif
  560. #define NIM_ADD 0x00000000
  561. #define NIM_MODIFY 0x00000001
  562. #define NIM_DELETE 0x00000002
  563. #if (_WIN32_IE >= 0x0500)
  564. #define NIM_SETFOCUS 0x00000003
  565. #define NIM_SETVERSION 0x00000004
  566. #define NOTIFYICON_VERSION 3
  567. #endif
  568. #define NIF_MESSAGE 0x00000001
  569. #define NIF_ICON 0x00000002
  570. #define NIF_TIP 0x00000004
  571. #if (_WIN32_IE >= 0x0500)
  572. #define NIF_STATE 0x00000008
  573. #define NIF_INFO 0x00000010
  574. #endif
  575. #if (_WIN32_IE >= 0x600)
  576. #define NIF_GUID 0x00000020
  577. #endif
  578. #if (_WIN32_IE >= 0x0500)
  579. #define NIS_HIDDEN 0x00000001
  580. #define NIS_SHAREDICON 0x00000002
  581. // says this is the source of a shared icon
  582. // Notify Icon Infotip flags
  583. #define NIIF_NONE 0x00000000
  584. // icon flags are mutually exclusive
  585. // and take only the lowest 2 bits
  586. #define NIIF_INFO 0x00000001
  587. #define NIIF_WARNING 0x00000002
  588. #define NIIF_ERROR 0x00000003
  589. #define NIIF_ICON_MASK 0x0000000F
  590. #if (_WIN32_IE >= 0x0501)
  591. #define NIIF_NOSOUND 0x00000010
  592. #endif
  593. #endif
  594. SHSTDAPI_(BOOL) Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA lpData);
  595. SHSTDAPI_(BOOL) Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW lpData);
  596. #ifdef UNICODE
  597. #define Shell_NotifyIcon Shell_NotifyIconW
  598. #else
  599. #define Shell_NotifyIcon Shell_NotifyIconA
  600. #endif // !UNICODE
  601. ////
  602. //// End Tray Notification Icons
  603. ////
  604. #ifndef SHFILEINFO_DEFINED
  605. #define SHFILEINFO_DEFINED
  606. ////
  607. //// Begin SHGetFileInfo
  608. ////
  609. /*
  610. * The SHGetFileInfo API provides an easy way to get attributes
  611. * for a file given a pathname.
  612. *
  613. * PARAMETERS
  614. *
  615. * pszPath file name to get info about
  616. * dwFileAttributes file attribs, only used with SHGFI_USEFILEATTRIBUTES
  617. * psfi place to return file info
  618. * cbFileInfo size of structure
  619. * uFlags flags
  620. *
  621. * RETURN
  622. * TRUE if things worked
  623. */
  624. typedef struct _SHFILEINFOA
  625. {
  626. HICON hIcon; // out: icon
  627. int iIcon; // out: icon index
  628. DWORD dwAttributes; // out: SFGAO_ flags
  629. CHAR szDisplayName[MAX_PATH]; // out: display name (or path)
  630. CHAR szTypeName[80]; // out: type name
  631. } SHFILEINFOA;
  632. typedef struct _SHFILEINFOW
  633. {
  634. HICON hIcon; // out: icon
  635. int iIcon; // out: icon index
  636. DWORD dwAttributes; // out: SFGAO_ flags
  637. WCHAR szDisplayName[MAX_PATH]; // out: display name (or path)
  638. WCHAR szTypeName[80]; // out: type name
  639. } SHFILEINFOW;
  640. #ifdef UNICODE
  641. typedef SHFILEINFOW SHFILEINFO;
  642. #else
  643. typedef SHFILEINFOA SHFILEINFO;
  644. #endif // UNICODE
  645. // NOTE: This is also in shlwapi.h. Please keep in synch.
  646. #endif // !SHFILEINFO_DEFINED
  647. #define SHGFI_ICON 0x000000100 // get icon
  648. #define SHGFI_DISPLAYNAME 0x000000200 // get display name
  649. #define SHGFI_TYPENAME 0x000000400 // get type name
  650. #define SHGFI_ATTRIBUTES 0x000000800 // get attributes
  651. #define SHGFI_ICONLOCATION 0x000001000 // get icon location
  652. #define SHGFI_EXETYPE 0x000002000 // return exe type
  653. #define SHGFI_SYSICONINDEX 0x000004000 // get system icon index
  654. #define SHGFI_LINKOVERLAY 0x000008000 // put a link overlay on icon
  655. #define SHGFI_SELECTED 0x000010000 // show icon in selected state
  656. #define SHGFI_ATTR_SPECIFIED 0x000020000 // get only specified attributes
  657. #define SHGFI_LARGEICON 0x000000000 // get large icon
  658. #define SHGFI_SMALLICON 0x000000001 // get small icon
  659. #define SHGFI_OPENICON 0x000000002 // get open icon
  660. #define SHGFI_SHELLICONSIZE 0x000000004 // get shell size icon
  661. #define SHGFI_PIDL 0x000000008 // pszPath is a pidl
  662. #define SHGFI_USEFILEATTRIBUTES 0x000000010 // use passed dwFileAttribute
  663. #if (_WIN32_IE >= 0x0500)
  664. #define SHGFI_ADDOVERLAYS 0x000000020 // apply the appropriate overlays
  665. #define SHGFI_OVERLAYINDEX 0x000000040 // Get the index of the overlay
  666. // in the upper 8 bits of the iIcon
  667. #endif
  668. SHSTDAPI_(DWORD_PTR) SHGetFileInfoA(LPCSTR pszPath, DWORD dwFileAttributes, SHFILEINFOA *psfi, UINT cbFileInfo, UINT uFlags);
  669. SHSTDAPI_(DWORD_PTR) SHGetFileInfoW(LPCWSTR pszPath, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags);
  670. #ifdef UNICODE
  671. #define SHGetFileInfo SHGetFileInfoW
  672. #else
  673. #define SHGetFileInfo SHGetFileInfoA
  674. #endif // !UNICODE
  675. #define SHGetDiskFreeSpace SHGetDiskFreeSpaceEx
  676. SHSTDAPI_(BOOL) SHGetDiskFreeSpaceExA(LPCSTR pszDirectoryName, ULARGE_INTEGER* pulFreeBytesAvailableToCaller, ULARGE_INTEGER* pulTotalNumberOfBytes, ULARGE_INTEGER* pulTotalNumberOfFreeBytes);
  677. SHSTDAPI_(BOOL) SHGetDiskFreeSpaceExW(LPCWSTR pszDirectoryName, ULARGE_INTEGER* pulFreeBytesAvailableToCaller, ULARGE_INTEGER* pulTotalNumberOfBytes, ULARGE_INTEGER* pulTotalNumberOfFreeBytes);
  678. #ifdef UNICODE
  679. #define SHGetDiskFreeSpaceEx SHGetDiskFreeSpaceExW
  680. #else
  681. #define SHGetDiskFreeSpaceEx SHGetDiskFreeSpaceExA
  682. #endif // !UNICODE
  683. SHSTDAPI_(BOOL) SHGetNewLinkInfoA(LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName, BOOL *pfMustCopy, UINT uFlags);
  684. SHSTDAPI_(BOOL) SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags);
  685. #ifdef UNICODE
  686. #define SHGetNewLinkInfo SHGetNewLinkInfoW
  687. #else
  688. #define SHGetNewLinkInfo SHGetNewLinkInfoA
  689. #endif // !UNICODE
  690. #define SHGNLI_PIDL 0x000000001 // pszLinkTo is a pidl
  691. #define SHGNLI_PREFIXNAME 0x000000002 // Make name "Shortcut to xxx"
  692. #define SHGNLI_NOUNIQUE 0x000000004 // don't do the unique name generation
  693. #if (_WIN32_IE >= 0x0501)
  694. #define SHGNLI_NOLNK 0x000000008 // don't add ".lnk" extension
  695. #endif // _WIN2_IE >= 0x0501
  696. ////
  697. //// End SHGetFileInfo
  698. ////
  699. // Printer stuff
  700. #define PRINTACTION_OPEN 0
  701. #define PRINTACTION_PROPERTIES 1
  702. #define PRINTACTION_NETINSTALL 2
  703. #define PRINTACTION_NETINSTALLLINK 3
  704. #define PRINTACTION_TESTPAGE 4
  705. #define PRINTACTION_OPENNETPRN 5
  706. #ifdef WINNT
  707. #define PRINTACTION_DOCUMENTDEFAULTS 6
  708. #define PRINTACTION_SERVERPROPERTIES 7
  709. #endif
  710. SHSTDAPI_(BOOL) SHInvokePrinterCommandA(HWND hwnd, UINT uAction, LPCSTR lpBuf1, LPCSTR lpBuf2, BOOL fModal);
  711. SHSTDAPI_(BOOL) SHInvokePrinterCommandW(HWND hwnd, UINT uAction, LPCWSTR lpBuf1, LPCWSTR lpBuf2, BOOL fModal);
  712. #ifdef UNICODE
  713. #define SHInvokePrinterCommand SHInvokePrinterCommandW
  714. #else
  715. #define SHInvokePrinterCommand SHInvokePrinterCommandA
  716. #endif // !UNICODE
  717. #endif /* WINVER >= 0x0400 */
  718. #if (_WIN32_WINNT >= 0x0500) || (_WIN32_WINDOWS >= 0x0500)
  719. //
  720. // The SHLoadNonloadedIconOverlayIdentifiers API causes the shell's
  721. // icon overlay manager to load any registered icon overlay
  722. // identifers that are not currently loaded. This is useful if an
  723. // overlay identifier did not load at shell startup but is needed
  724. // and can be loaded at a later time. Identifiers already loaded
  725. // are not affected. Overlay identifiers implement the
  726. // IShellIconOverlayIdentifier interface.
  727. //
  728. // Returns:
  729. // S_OK
  730. //
  731. SHSTDAPI SHLoadNonloadedIconOverlayIdentifiers(void);
  732. //
  733. // The SHIsFileAvailableOffline API determines whether a file
  734. // or folder is available for offline use.
  735. //
  736. // Parameters:
  737. // pwszPath file name to get info about
  738. // pdwStatus (optional) OFFLINE_STATUS_* flags returned here
  739. //
  740. // Returns:
  741. // S_OK File/directory is available offline, unless
  742. // OFFLINE_STATUS_INCOMPLETE is returned.
  743. // E_INVALIDARG Path is invalid, or not a net path
  744. // E_FAIL File/directory is not available offline
  745. //
  746. // Notes:
  747. // OFFLINE_STATUS_INCOMPLETE is never returned for directories.
  748. // Both OFFLINE_STATUS_LOCAL and OFFLINE_STATUS_REMOTE may be returned,
  749. // indicating "open in both places." This is common when the server is online.
  750. //
  751. SHSTDAPI SHIsFileAvailableOffline(LPCWSTR pwszPath, LPDWORD pdwStatus);
  752. #define OFFLINE_STATUS_LOCAL 0x0001 // If open, it's open locally
  753. #define OFFLINE_STATUS_REMOTE 0x0002 // If open, it's open remotely
  754. #define OFFLINE_STATUS_INCOMPLETE 0x0004 // The local copy is currently imcomplete.
  755. // The file will not be available offline
  756. // until it has been synchronized.
  757. #endif
  758. // sets the specified path to use the string resource
  759. // as the UI instead of the file system name
  760. SHSTDAPI SHSetLocalizedName(LPWSTR pszPath, LPCWSTR pszResModule, int idsRes);
  761. //====== ShellMessageBox ================================================
  762. // If lpcTitle is NULL, the title is taken from hWnd
  763. // If lpcText is NULL, this is assumed to be an Out Of Memory message
  764. // If the selector of lpcTitle or lpcText is NULL, the offset should be a
  765. // string resource ID
  766. // The variable arguments must all be 32-bit values (even if fewer bits
  767. // are actually used)
  768. // lpcText (or whatever string resource it causes to be loaded) should
  769. // be a formatting string similar to wsprintf except that only the
  770. // following formats are available:
  771. // %% formats to a single '%'
  772. // %nn%s the nn-th arg is a string which is inserted
  773. // %nn%ld the nn-th arg is a DWORD, and formatted decimal
  774. // %nn%lx the nn-th arg is a DWORD, and formatted hex
  775. // note that lengths are allowed on the %s, %ld, and %lx, just
  776. // like wsprintf
  777. //
  778. int _cdecl ShellMessageBoxA(
  779. HINSTANCE hAppInst,
  780. HWND hWnd,
  781. LPCSTR lpcText,
  782. LPCSTR lpcTitle,
  783. UINT fuStyle, ...);
  784. int _cdecl ShellMessageBoxW(
  785. HINSTANCE hAppInst,
  786. HWND hWnd,
  787. LPCWSTR lpcText,
  788. LPCWSTR lpcTitle,
  789. UINT fuStyle, ...);
  790. #ifdef UNICODE
  791. #define ShellMessageBox ShellMessageBoxW
  792. #else
  793. #define ShellMessageBox ShellMessageBoxA
  794. #endif // !UNICODE
  795. SHSTDAPI_(BOOL) IsLFNDriveA(LPCSTR pszPath);
  796. SHSTDAPI_(BOOL) IsLFNDriveW(LPCWSTR pszPath);
  797. #ifdef UNICODE
  798. #define IsLFNDrive IsLFNDriveW
  799. #else
  800. #define IsLFNDrive IsLFNDriveA
  801. #endif // !UNICODE
  802. #if _WIN32_IE >= 0x0600
  803. STDAPI SHEnumerateUnreadMailAccountsA(HKEY hKeyUser, DWORD dwIndex, LPSTR pszMailAddress, int cchMailAddress);
  804. STDAPI SHEnumerateUnreadMailAccountsW(HKEY hKeyUser, DWORD dwIndex, LPWSTR pszMailAddress, int cchMailAddress);
  805. #ifdef UNICODE
  806. #define SHEnumerateUnreadMailAccounts SHEnumerateUnreadMailAccountsW
  807. #else
  808. #define SHEnumerateUnreadMailAccounts SHEnumerateUnreadMailAccountsA
  809. #endif // !UNICODE
  810. STDAPI SHGetUnreadMailCountA(HKEY hKeyUser, LPCSTR pszMailAddress, DWORD *pdwCount, FILETIME *pFileTime, LPSTR pszShellExecuteCommand, int cchShellExecuteCommand);
  811. STDAPI SHGetUnreadMailCountW(HKEY hKeyUser, LPCWSTR pszMailAddress, DWORD *pdwCount, FILETIME *pFileTime, LPWSTR pszShellExecuteCommand, int cchShellExecuteCommand);
  812. #ifdef UNICODE
  813. #define SHGetUnreadMailCount SHGetUnreadMailCountW
  814. #else
  815. #define SHGetUnreadMailCount SHGetUnreadMailCountA
  816. #endif // !UNICODE
  817. STDAPI SHSetUnreadMailCountA(LPCSTR pszMailAddress, DWORD dwCount, LPCSTR pszShellExecuteCommand);
  818. STDAPI SHSetUnreadMailCountW(LPCWSTR pszMailAddress, DWORD dwCount, LPCWSTR pszShellExecuteCommand);
  819. #ifdef UNICODE
  820. #define SHSetUnreadMailCount SHSetUnreadMailCountW
  821. #else
  822. #define SHSetUnreadMailCount SHSetUnreadMailCountA
  823. #endif // !UNICODE
  824. #endif /* _WIN32_IE >= 0x0600 */
  825. STDAPI_(BOOL) SHTestTokenMembership(HANDLE hToken, ULONG ulRID);
  826. #if _WIN32_IE >= 0x0600
  827. HRESULT SHGetImageList(int iImageList, REFIID riid, void **ppvObj);
  828. #define SHIL_LARGE 0 // normally 32x32
  829. #define SHIL_SMALL 1 // normally 16x16
  830. #define SHIL_EXTRALARGE 2
  831. #define SHIL_SYSSMALL 3 // like SHIL_SMALL, but tracks system small icon metric correctly
  832. #define SHIL_LAST SHIL_SYSSMALL
  833. // Function call types for ntshrui folder sharing helpers
  834. typedef HRESULT (STDMETHODCALLTYPE *PFNCANSHAREFOLDERW)(IN LPCWSTR pszPath);
  835. typedef HRESULT (STDMETHODCALLTYPE *PFNSHOWSHAREFOLDERUIW)(IN HWND hwndParent, IN LPCWSTR pszPath);
  836. #endif /* _WIN32_IE >= 0x0600 */
  837. #ifdef __cplusplus
  838. }
  839. #endif /* __cplusplus */
  840. #if !defined(_WIN64)
  841. #include <poppack.h>
  842. #endif
  843. #endif /* _INC_SHELLAPI */