home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / shellapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  25.4 KB  |  794 lines

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