home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / shellapi.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  23KB  |  672 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * shellapi.h -  SHELL.DLL functions, types, and definitions                   *
  4. *                                                                             *
  5. * Copyright 1992 - 1998 Microsoft Corp.  All rights reserved               *
  6. *                                                                             *
  7. \*****************************************************************************/
  8.  
  9. #ifndef _INC_SHELLAPI
  10. #define _INC_SHELLAPI
  11.  
  12.  
  13. //
  14. // Define API decoration for direct importing of DLL references.
  15. //
  16. #ifndef WINSHELLAPI
  17. #if !defined(_SHELL32_)
  18. #define WINSHELLAPI       DECLSPEC_IMPORT
  19. #else
  20. #define WINSHELLAPI
  21. #endif
  22. #endif // WINSHELLAPI
  23.  
  24. #ifndef SHSTDAPI
  25. #if !defined(_SHELL32_)
  26. #define SHSTDAPI          EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  27. #define SHSTDAPI_(type)   EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  28. #else
  29. #define SHSTDAPI          STDAPI
  30. #define SHSTDAPI_(type)   STDAPI_(type)
  31. #endif
  32. #endif // SHSTDAPI
  33.  
  34. #ifndef SHDOCAPI
  35. #if !defined(_SHDOCVW_)
  36. #define SHDOCAPI          EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
  37. #define SHDOCAPI_(type)   EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
  38. #else
  39. #define SHDOCAPI          STDAPI
  40. #define SHDOCAPI_(type)   STDAPI_(type)
  41. #endif
  42. #endif // SHDOCAPI
  43.  
  44.  
  45. #include <pshpack1.h>
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {            /* Assume C declarations for C++ */
  49. #endif  /* __cplusplus */
  50.  
  51.  
  52.  
  53. DECLARE_HANDLE(HDROP);
  54.  
  55. WINSHELLAPI UINT APIENTRY DragQueryFileA(HDROP,UINT,LPSTR,UINT);
  56. WINSHELLAPI UINT APIENTRY DragQueryFileW(HDROP,UINT,LPWSTR,UINT);
  57. #ifdef UNICODE
  58. #define DragQueryFile  DragQueryFileW
  59. #else
  60. #define DragQueryFile  DragQueryFileA
  61. #endif // !UNICODE
  62. WINSHELLAPI BOOL APIENTRY DragQueryPoint(HDROP,LPPOINT);
  63. WINSHELLAPI VOID APIENTRY DragFinish(HDROP);
  64. WINSHELLAPI VOID APIENTRY DragAcceptFiles(HWND,BOOL);
  65.  
  66. WINSHELLAPI HINSTANCE APIENTRY ShellExecuteA(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd);
  67. WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd);
  68. #ifdef UNICODE
  69. #define ShellExecute  ShellExecuteW
  70. #else
  71. #define ShellExecute  ShellExecuteA
  72. #endif // !UNICODE
  73. WINSHELLAPI HINSTANCE APIENTRY FindExecutableA(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult);
  74. WINSHELLAPI HINSTANCE APIENTRY FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult);
  75. #ifdef UNICODE
  76. #define FindExecutable  FindExecutableW
  77. #else
  78. #define FindExecutable  FindExecutableA
  79. #endif // !UNICODE
  80. WINSHELLAPI LPWSTR *  APIENTRY CommandLineToArgvW(LPCWSTR lpCmdLine, int*pNumArgs);
  81.  
  82. WINSHELLAPI INT       APIENTRY ShellAboutA(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon);
  83. WINSHELLAPI INT       APIENTRY ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon);
  84. #ifdef UNICODE
  85. #define ShellAbout  ShellAboutW
  86. #else
  87. #define ShellAbout  ShellAboutA
  88. #endif // !UNICODE
  89. WINSHELLAPI HICON     APIENTRY DuplicateIcon(HINSTANCE hInst, HICON hIcon);
  90. WINSHELLAPI HICON     APIENTRY ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon);
  91. WINSHELLAPI HICON     APIENTRY ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIcon);
  92. #ifdef UNICODE
  93. #define ExtractAssociatedIcon  ExtractAssociatedIconW
  94. #else
  95. #define ExtractAssociatedIcon  ExtractAssociatedIconA
  96. #endif // !UNICODE
  97.  
  98. WINSHELLAPI HICON     APIENTRY ExtractIconA(HINSTANCE hInst, LPCSTR lpszExeFileName, UINT nIconIndex);
  99. WINSHELLAPI HICON     APIENTRY 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, FAR* 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, FAR* 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. WINSHELLAPI UINT APIENTRY SHAppBarMessage(DWORD dwMessage, PAPPBARDATA pData);
  173.  
  174. ////
  175. ////  EndAppBar
  176. ////
  177.  
  178.  
  179. WINSHELLAPI DWORD   APIENTRY DoEnvironmentSubstA(LPSTR szString, UINT cbString);
  180. WINSHELLAPI DWORD   APIENTRY DoEnvironmentSubstW(LPWSTR szString, UINT cbString);
  181. #ifdef UNICODE
  182. #define DoEnvironmentSubst  DoEnvironmentSubstW
  183. #else
  184. #define DoEnvironmentSubst  DoEnvironmentSubstA
  185. #endif // !UNICODE
  186. WINSHELLAPI LPSTR APIENTRY FindEnvironmentStringA(LPSTR szEnvVar);
  187. WINSHELLAPI LPWSTR APIENTRY FindEnvironmentStringW(LPWSTR szEnvVar);
  188. #ifdef UNICODE
  189. #define FindEnvironmentString  FindEnvironmentStringW
  190. #else
  191. #define FindEnvironmentString  FindEnvironmentStringA
  192. #endif // !UNICODE
  193.  
  194. #define EIRESID(x) (-1 * (int)(x))
  195. WINSHELLAPI UINT WINAPI ExtractIconExA(LPCSTR lpszFile, int nIconIndex, HICON FAR *phiconLarge, HICON FAR *phiconSmall, UINT nIcons);
  196. WINSHELLAPI UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, int nIconIndex, HICON FAR *phiconLarge, HICON FAR *phiconSmall, UINT nIcons);
  197. #ifdef UNICODE
  198. #define ExtractIconEx  ExtractIconExW
  199. #else
  200. #define ExtractIconEx  ExtractIconExA
  201. #endif // !UNICODE
  202.  
  203.  
  204.  
  205. ////
  206. //// Shell File Operations
  207. ////
  208.  
  209. #ifndef FO_MOVE //these need to be kept in sync with the ones in shlobj.h
  210.  
  211. #define FO_MOVE           0x0001
  212. #define FO_COPY           0x0002
  213. #define FO_DELETE         0x0003
  214. #define FO_RENAME         0x0004
  215.  
  216. #define FOF_MULTIDESTFILES         0x0001
  217. #define FOF_CONFIRMMOUSE           0x0002
  218. #define FOF_SILENT                 0x0004  // don't create progress/report
  219. #define FOF_RENAMEONCOLLISION      0x0008
  220. #define FOF_NOCONFIRMATION         0x0010  // Don't prompt the user.
  221. #define FOF_WANTMAPPINGHANDLE      0x0020  // Fill in SHFILEOPSTRUCT.hNameMappings
  222.                                       // Must be freed using SHFreeNameMappings
  223. #define FOF_ALLOWUNDO              0x0040
  224. #define FOF_FILESONLY              0x0080  // on *.*, do only files
  225. #define FOF_SIMPLEPROGRESS         0x0100  // means don't show names of files
  226. #define FOF_NOCONFIRMMKDIR         0x0200  // don't confirm making any needed dirs
  227. #define FOF_NOERRORUI              0x0400  // don't put up error UI
  228. #define FOF_NOCOPYSECURITYATTRIBS  0x0800  // dont copy NT file Security Attributes
  229.  
  230. typedef WORD FILEOP_FLAGS;
  231.  
  232. #define PO_DELETE       0x0013  // printer is being deleted
  233. #define PO_RENAME       0x0014  // printer is being renamed
  234. #define PO_PORTCHANGE   0x0020  // port this printer connected to is being changed
  235.                                 // if this id is set, the strings received by
  236.                                 // the copyhook are a doubly-null terminated
  237.                                 // list of strings.  The first is the printer
  238.                                 // name and the second is the printer port.
  239. #define PO_REN_PORT     0x0034  // PO_RENAME and PO_PORTCHANGE at same time.
  240.  
  241. // no POF_ flags currently defined
  242.  
  243. typedef WORD PRINTEROP_FLAGS;
  244.  
  245. #endif // FO_MOVE
  246.  
  247. // implicit parameters are:
  248. //      if pFrom or pTo are unqualified names the current directories are
  249. //      taken from the global current drive/directory settings managed
  250. //      by Get/SetCurrentDrive/Directory
  251. //
  252. //      the global confirmation settings
  253.  
  254. typedef struct _SHFILEOPSTRUCTA
  255. {
  256.         HWND            hwnd;
  257.         UINT            wFunc;
  258.         LPCSTR          pFrom;
  259.         LPCSTR          pTo;
  260.         FILEOP_FLAGS    fFlags;
  261.         BOOL            fAnyOperationsAborted;
  262.         LPVOID          hNameMappings;
  263.         LPCSTR           lpszProgressTitle; // only used if FOF_SIMPLEPROGRESS
  264. } SHFILEOPSTRUCTA, FAR *LPSHFILEOPSTRUCTA;
  265. typedef struct _SHFILEOPSTRUCTW
  266. {
  267.         HWND            hwnd;
  268.         UINT            wFunc;
  269.         LPCWSTR         pFrom;
  270.         LPCWSTR         pTo;
  271.         FILEOP_FLAGS    fFlags;
  272.         BOOL            fAnyOperationsAborted;
  273.         LPVOID          hNameMappings;
  274.         LPCWSTR          lpszProgressTitle; // only used if FOF_SIMPLEPROGRESS
  275. } SHFILEOPSTRUCTW, FAR *LPSHFILEOPSTRUCTW;
  276. #ifdef UNICODE
  277. typedef SHFILEOPSTRUCTW SHFILEOPSTRUCT;
  278. typedef LPSHFILEOPSTRUCTW LPSHFILEOPSTRUCT;
  279. #else
  280. typedef SHFILEOPSTRUCTA SHFILEOPSTRUCT;
  281. typedef LPSHFILEOPSTRUCTA LPSHFILEOPSTRUCT;
  282. #endif // UNICODE
  283.  
  284. WINSHELLAPI int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp);
  285. WINSHELLAPI int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp);
  286. #ifdef UNICODE
  287. #define SHFileOperation  SHFileOperationW
  288. #else
  289. #define SHFileOperation  SHFileOperationA
  290. #endif // !UNICODE
  291.  
  292. WINSHELLAPI void WINAPI SHFreeNameMappings(HANDLE hNameMappings);
  293.  
  294. typedef struct _SHNAMEMAPPINGA
  295. {
  296.     LPSTR   pszOldPath;
  297.     LPSTR   pszNewPath;
  298.     int   cchOldPath;
  299.     int   cchNewPath;
  300. } SHNAMEMAPPINGA, FAR *LPSHNAMEMAPPINGA;
  301. typedef struct _SHNAMEMAPPINGW
  302. {
  303.     LPWSTR  pszOldPath;
  304.     LPWSTR  pszNewPath;
  305.     int   cchOldPath;
  306.     int   cchNewPath;
  307. } SHNAMEMAPPINGW, FAR *LPSHNAMEMAPPINGW;
  308. #ifdef UNICODE
  309. typedef SHNAMEMAPPINGW SHNAMEMAPPING;
  310. typedef LPSHNAMEMAPPINGW LPSHNAMEMAPPING;
  311. #else
  312. typedef SHNAMEMAPPINGA SHNAMEMAPPING;
  313. typedef LPSHNAMEMAPPINGA LPSHNAMEMAPPING;
  314. #endif // UNICODE
  315.  
  316.  
  317. ////
  318. //// End Shell File Operations
  319. ////
  320.  
  321. ////
  322. ////  Begin ShellExecuteEx and family
  323. ////
  324.  
  325.  
  326. /* ShellExecute() and ShellExecuteEx() error codes */
  327.  
  328. /* regular WinExec() codes */
  329. #define SE_ERR_FNF              2       // file not found
  330. #define SE_ERR_PNF              3       // path not found
  331. #define SE_ERR_ACCESSDENIED     5       // access denied
  332. #define SE_ERR_OOM              8       // out of memory
  333. #define SE_ERR_DLLNOTFOUND              32
  334.  
  335. #endif /* WINVER >= 0x0400 */
  336.  
  337. /* error values for ShellExecute() beyond the regular WinExec() codes */
  338. #define SE_ERR_SHARE                    26
  339. #define SE_ERR_ASSOCINCOMPLETE          27
  340. #define SE_ERR_DDETIMEOUT               28
  341. #define SE_ERR_DDEFAIL                  29
  342. #define SE_ERR_DDEBUSY                  30
  343. #define SE_ERR_NOASSOC                  31
  344.  
  345. #if(WINVER >= 0x0400)
  346.  
  347. // Note CLASSKEY overrides CLASSNAME
  348. #define SEE_MASK_CLASSNAME        0x00000001
  349. #define SEE_MASK_CLASSKEY         0x00000003
  350. // Note INVOKEIDLIST overrides IDLIST
  351. #define SEE_MASK_IDLIST           0x00000004
  352. #define SEE_MASK_INVOKEIDLIST     0x0000000c
  353. #define SEE_MASK_ICON             0x00000010
  354. #define SEE_MASK_HOTKEY           0x00000020
  355. #define SEE_MASK_NOCLOSEPROCESS   0x00000040
  356. #define SEE_MASK_CONNECTNETDRV    0x00000080
  357. #define SEE_MASK_FLAG_DDEWAIT     0x00000100
  358. #define SEE_MASK_DOENVSUBST       0x00000200
  359. #define SEE_MASK_FLAG_NO_UI       0x00000400
  360. #define SEE_MASK_UNICODE          0x00004000
  361. #define SEE_MASK_NO_CONSOLE       0x00008000
  362. #define SEE_MASK_ASYNCOK          0x00100000
  363. #define SEE_MASK_HMONITOR         0x00200000
  364. typedef struct _SHELLEXECUTEINFOA
  365. {
  366.         DWORD cbSize;
  367.         ULONG fMask;
  368.         HWND hwnd;
  369.         LPCSTR   lpVerb;
  370.         LPCSTR   lpFile;
  371.         LPCSTR   lpParameters;
  372.         LPCSTR   lpDirectory;
  373.         int nShow;
  374.         HINSTANCE hInstApp;
  375.         // Optional fields
  376.         LPVOID lpIDList;
  377.         LPCSTR   lpClass;
  378.         HKEY hkeyClass;
  379.         DWORD dwHotKey;
  380.         union {
  381.         HANDLE hIcon;
  382.         HANDLE hMonitor;
  383.         };
  384.         HANDLE hProcess;
  385. } SHELLEXECUTEINFOA, FAR *LPSHELLEXECUTEINFOA;
  386. // Note CLASSKEY overrides CLASSNAME
  387. #define SEE_MASK_CLASSNAME        0x00000001
  388. #define SEE_MASK_CLASSKEY         0x00000003
  389. // Note INVOKEIDLIST overrides IDLIST
  390. #define SEE_MASK_IDLIST           0x00000004
  391. #define SEE_MASK_INVOKEIDLIST     0x0000000c
  392. #define SEE_MASK_ICON             0x00000010
  393. #define SEE_MASK_HOTKEY           0x00000020
  394. #define SEE_MASK_NOCLOSEPROCESS   0x00000040
  395. #define SEE_MASK_CONNECTNETDRV    0x00000080
  396. #define SEE_MASK_FLAG_DDEWAIT     0x00000100
  397. #define SEE_MASK_DOENVSUBST       0x00000200
  398. #define SEE_MASK_FLAG_NO_UI       0x00000400
  399. #define SEE_MASK_UNICODE          0x00004000
  400. #define SEE_MASK_NO_CONSOLE       0x00008000
  401. #define SEE_MASK_ASYNCOK          0x00100000
  402. #define SEE_MASK_HMONITOR         0x00200000
  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.         };
  423.         HANDLE hProcess;
  424. } SHELLEXECUTEINFOW, FAR *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. WINSHELLAPI BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA lpExecInfo);
  434. WINSHELLAPI BOOL WINAPI ShellExecuteExW(LPSHELLEXECUTEINFOW lpExecInfo);
  435. #ifdef UNICODE
  436. #define ShellExecuteEx  ShellExecuteExW
  437. #else
  438. #define ShellExecuteEx  ShellExecuteExA
  439. #endif // !UNICODE
  440. WINSHELLAPI void WINAPI WinExecErrorA(HWND hwnd, int error, LPCSTR lpstrFileName, LPCSTR lpstrTitle);
  441. WINSHELLAPI void WINAPI 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. ////  End ShellExecuteEx and family
  450. ////
  451.  
  452. //
  453. // RecycleBin
  454. //
  455.  
  456.  
  457. // struct for query recycle bin info
  458. typedef struct _SHQUERYRBINFO {
  459.     DWORD   cbSize;
  460. #if !defined(_MAC) || defined(_MAC_INT_64)
  461.     __int64 i64Size;
  462.     __int64 i64NumItems;
  463. #else
  464.     DWORDLONG i64Size;
  465.     DWORDLONG i64NumItems;
  466. #endif
  467. } SHQUERYRBINFO, FAR *LPSHQUERYRBINFO;
  468.  
  469.  
  470. // flags for SHEmptyRecycleBin
  471. //
  472. #define SHERB_NOCONFIRMATION    0x00000001
  473. #define SHERB_NOPROGRESSUI      0x00000002
  474. #define SHERB_NOSOUND           0x00000004
  475.  
  476.  
  477. SHSTDAPI SHQueryRecycleBinA(LPCSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo );
  478. SHSTDAPI SHQueryRecycleBinW(LPCWSTR pszRootPath, LPSHQUERYRBINFO pSHQueryRBInfo );
  479. #ifdef UNICODE
  480. #define SHQueryRecycleBin  SHQueryRecycleBinW
  481. #else
  482. #define SHQueryRecycleBin  SHQueryRecycleBinA
  483. #endif // !UNICODE
  484. SHSTDAPI SHEmptyRecycleBinA(HWND hwnd, LPCSTR pszRootPath, DWORD dwFlags );
  485. SHSTDAPI SHEmptyRecycleBinW(HWND hwnd, LPCWSTR pszRootPath, DWORD dwFlags );
  486. #ifdef UNICODE
  487. #define SHEmptyRecycleBin  SHEmptyRecycleBinW
  488. #else
  489. #define SHEmptyRecycleBin  SHEmptyRecycleBinA
  490. #endif // !UNICODE
  491.  
  492. ////
  493. //// end of RecycleBin
  494.  
  495.  
  496. ////
  497. //// Tray notification definitions
  498. ////
  499.  
  500. typedef struct _NOTIFYICONDATAA {
  501.         DWORD cbSize;
  502.         HWND hWnd;
  503.         UINT uID;
  504.         UINT uFlags;
  505.         UINT uCallbackMessage;
  506.         HICON hIcon;
  507.         CHAR   szTip[64];
  508. } NOTIFYICONDATAA, *PNOTIFYICONDATAA;
  509. typedef struct _NOTIFYICONDATAW {
  510.         DWORD cbSize;
  511.         HWND hWnd;
  512.         UINT uID;
  513.         UINT uFlags;
  514.         UINT uCallbackMessage;
  515.         HICON hIcon;
  516.         WCHAR  szTip[64];
  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.  
  526.  
  527. #define NIM_ADD         0x00000000
  528. #define NIM_MODIFY      0x00000001
  529. #define NIM_DELETE      0x00000002
  530.  
  531. #define NIF_MESSAGE     0x00000001
  532. #define NIF_ICON        0x00000002
  533. #define NIF_TIP         0x00000004
  534.  
  535. WINSHELLAPI BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA lpData);
  536. WINSHELLAPI BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW lpData);
  537. #ifdef UNICODE
  538. #define Shell_NotifyIcon  Shell_NotifyIconW
  539. #else
  540. #define Shell_NotifyIcon  Shell_NotifyIconA
  541. #endif // !UNICODE
  542.  
  543. ////
  544. //// End Tray Notification Icons
  545. ////
  546.  
  547.  
  548.  
  549. ////
  550. //// Begin SHGetFileInfo
  551. ////
  552.  
  553. /*
  554.  * The SHGetFileInfo API provides an easy way to get attributes
  555.  * for a file given a pathname.
  556.  *
  557.  *   PARAMETERS
  558.  *
  559.  *     pszPath              file name to get info about
  560.  *     dwFileAttributes     file attribs, only used with SHGFI_USEFILEATTRIBUTES
  561.  *     psfi                 place to return file info
  562.  *     cbFileInfo           size of structure
  563.  *     uFlags               flags
  564.  *
  565.  *   RETURN
  566.  *     TRUE if things worked
  567.  */
  568.  
  569. typedef struct _SHFILEINFOA
  570. {
  571.         HICON       hIcon;                      // out: icon
  572.         int         iIcon;                      // out: icon index
  573.         DWORD       dwAttributes;               // out: SFGAO_ flags
  574.         CHAR        szDisplayName[MAX_PATH];    // out: display name (or path)
  575.         CHAR        szTypeName[80];             // out: type name
  576. } SHFILEINFOA;
  577. typedef struct _SHFILEINFOW
  578. {
  579.         HICON       hIcon;                      // out: icon
  580.         int         iIcon;                      // out: icon index
  581.         DWORD       dwAttributes;               // out: SFGAO_ flags
  582.         WCHAR       szDisplayName[MAX_PATH];    // out: display name (or path)
  583.         WCHAR       szTypeName[80];             // out: type name
  584. } SHFILEINFOW;
  585. #ifdef UNICODE
  586. typedef SHFILEINFOW SHFILEINFO;
  587. #else
  588. typedef SHFILEINFOA SHFILEINFO;
  589. #endif // UNICODE
  590.  
  591. #define SHGFI_ICON              0x000000100     // get icon
  592. #define SHGFI_DISPLAYNAME       0x000000200     // get display name
  593. #define SHGFI_TYPENAME          0x000000400     // get type name
  594. #define SHGFI_ATTRIBUTES        0x000000800     // get attributes
  595. #define SHGFI_ICONLOCATION      0x000001000     // get icon location
  596. #define SHGFI_EXETYPE           0x000002000     // return exe type
  597. #define SHGFI_SYSICONINDEX      0x000004000     // get system icon index
  598. #define SHGFI_LINKOVERLAY       0x000008000     // put a link overlay on icon
  599. #define SHGFI_SELECTED          0x000010000     // show icon in selected state
  600. #define SHGFI_ATTR_SPECIFIED    0x000020000     // get only specified attributes
  601. #define SHGFI_LARGEICON         0x000000000     // get large icon
  602. #define SHGFI_SMALLICON         0x000000001     // get small icon
  603. #define SHGFI_OPENICON          0x000000002     // get open icon
  604. #define SHGFI_SHELLICONSIZE     0x000000004     // get shell size icon
  605. #define SHGFI_PIDL              0x000000008     // pszPath is a pidl
  606. #define SHGFI_USEFILEATTRIBUTES 0x000000010     // use passed dwFileAttribute
  607.  
  608. SHSTDAPI_(DWORD) SHGetFileInfoA(LPCSTR pszPath, DWORD dwFileAttributes, SHFILEINFOA FAR *psfi, UINT cbFileInfo, UINT uFlags);
  609. SHSTDAPI_(DWORD) SHGetFileInfoW(LPCWSTR pszPath, DWORD dwFileAttributes, SHFILEINFOW FAR *psfi, UINT cbFileInfo, UINT uFlags);
  610. #ifdef UNICODE
  611. #define SHGetFileInfo  SHGetFileInfoW
  612. #else
  613. #define SHGetFileInfo  SHGetFileInfoA
  614. #endif // !UNICODE
  615. SHSTDAPI_(BOOL)  SHGetDiskFreeSpaceA(LPCSTR pszVolume, ULARGE_INTEGER *pqwFreeCaller, ULARGE_INTEGER *pqwTot, ULARGE_INTEGER *pqwFree);
  616. SHSTDAPI_(BOOL)  SHGetDiskFreeSpaceW(LPCWSTR pszVolume, ULARGE_INTEGER *pqwFreeCaller, ULARGE_INTEGER *pqwTot, ULARGE_INTEGER *pqwFree);
  617. #ifdef UNICODE
  618. #define SHGetDiskFreeSpace  SHGetDiskFreeSpaceW
  619. #else
  620. #define SHGetDiskFreeSpace  SHGetDiskFreeSpaceA
  621. #endif // !UNICODE
  622. SHSTDAPI_(BOOL)  SHGetNewLinkInfoA(LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName, BOOL *pfMustCopy, UINT uFlags);
  623. SHSTDAPI_(BOOL)  SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName, BOOL *pfMustCopy, UINT uFlags);
  624. #ifdef UNICODE
  625. #define SHGetNewLinkInfo  SHGetNewLinkInfoW
  626. #else
  627. #define SHGetNewLinkInfo  SHGetNewLinkInfoA
  628. #endif // !UNICODE
  629.  
  630. #define SHGNLI_PIDL             0x000000001     // pszLinkTo is a pidl
  631. #define SHGNLI_PREFIXNAME       0x000000002     // Make name "Shortcut to xxx"
  632. #define SHGNLI_NOUNIQUE         0x000000004     // don't do the unique name generation
  633.  
  634.  
  635. ////
  636. //// End SHGetFileInfo
  637. ////
  638.  
  639. // Printer stuff
  640. #define PRINTACTION_OPEN           0
  641. #define PRINTACTION_PROPERTIES     1
  642. #define PRINTACTION_NETINSTALL     2
  643. #define PRINTACTION_NETINSTALLLINK 3
  644. #define PRINTACTION_TESTPAGE       4
  645. #define PRINTACTION_OPENNETPRN     5
  646. #ifdef WINNT
  647. #define PRINTACTION_DOCUMENTDEFAULTS 6
  648. #define PRINTACTION_SERVERPROPERTIES 7
  649. #endif
  650.  
  651. SHSTDAPI_(BOOL)  SHInvokePrinterCommandA(HWND hwnd, UINT uAction, LPCSTR lpBuf1, LPCSTR lpBuf2, BOOL fModal);
  652. SHSTDAPI_(BOOL)  SHInvokePrinterCommandW(HWND hwnd, UINT uAction, LPCWSTR lpBuf1, LPCWSTR lpBuf2, BOOL fModal);
  653. #ifdef UNICODE
  654. #define SHInvokePrinterCommand  SHInvokePrinterCommandW
  655. #else
  656. #define SHInvokePrinterCommand  SHInvokePrinterCommandA
  657. #endif // !UNICODE
  658.  
  659.  
  660.  
  661. #endif /* WINVER >= 0x0400 */
  662.  
  663.  
  664. #ifdef __cplusplus
  665. }
  666. #endif  /* __cplusplus */
  667.  
  668. #include <poppack.h>
  669.  
  670. #endif  /* _INC_SHELLAPI */
  671.  
  672.