ShellAPI.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:30k
源码类别:

模拟服务器

开发平台:

C/C++

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