home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / msinc.pak / SHELLAPI.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  22KB  |  655 lines

  1. /*
  2.  *      C/C++ Run Time Library - Version 6.5
  3.  *
  4.  *      Copyright (c) 1994 by Borland International
  5.  *      All Rights Reserved.
  6.  *
  7.  */
  8.  
  9. #if !defined(__FLAT__)
  10. /*****************************************************************************\
  11. *                                                                             *
  12. * shellapi.h -  SHELL.DLL functions, types, and definitions                   *
  13. *                                                                             *
  14. \*****************************************************************************/
  15.  
  16. #ifndef __SHELLAPI_H    /* prevent multiple includes */
  17. #define __SHELLAPI_H
  18.  
  19. #ifndef __WINDOWS_H
  20. #include <windows.h>    /* <windows.h> must be included */
  21. #endif  /* __WINDOWS_H */
  22.  
  23. #ifndef RC_INVOKED
  24. #pragma option -a-      /* Assume byte packing throughout */
  25. #endif  /* RC_INVOKED */
  26.  
  27. #ifdef __cplusplus
  28. extern "C" {            /* Assume C declarations for C++ */
  29. #endif  /* __cplusplus */
  30.  
  31. /* If included with the 3.0 windows.h, define compatible aliases */
  32. #if !defined(WINVER) || (WINVER < 0x030a)
  33. #define HDROP       HANDLE
  34. #define HINSTANCE   HANDLE
  35. #define WINAPI      FAR PASCAL
  36. #define LPCSTR      LPSTR
  37. #define UINT        WORD
  38. #else
  39. DECLARE_HANDLE(HDROP);
  40. #endif  /* WIN3.0 */
  41.  
  42. /* return codes from Registration functions */
  43. #define ERROR_SUCCESS           0L
  44. #define ERROR_BADDB             1L
  45. #define ERROR_BADKEY            2L
  46. #define ERROR_CANTOPEN          3L
  47. #define ERROR_CANTREAD          4L
  48. #define ERROR_CANTWRITE         5L
  49. #define ERROR_OUTOFMEMORY       6L
  50. #define ERROR_INVALID_PARAMETER 7L
  51. #define ERROR_ACCESS_DENIED     8L
  52.  
  53. #define REG_SZ                  1           /* string type */
  54. #define HKEY_CLASSES_ROOT       1
  55.  
  56. typedef DWORD HKEY;
  57. typedef HKEY FAR* PHKEY;
  58.  
  59. LONG WINAPI RegOpenKey(HKEY, LPCSTR, HKEY FAR*);
  60. LONG WINAPI RegCreateKey(HKEY, LPCSTR, HKEY FAR*);
  61. LONG WINAPI RegCloseKey(HKEY);
  62. LONG WINAPI RegDeleteKey(HKEY, LPCSTR);
  63. LONG WINAPI RegSetValue(HKEY, LPCSTR, DWORD, LPCSTR, DWORD);
  64. LONG WINAPI RegQueryValue(HKEY, LPCSTR, LPSTR, LONG FAR*);
  65. LONG WINAPI RegEnumKey(HKEY, DWORD, LPSTR, DWORD);
  66.  
  67. UINT WINAPI DragQueryFile(HDROP, UINT, LPSTR, UINT);
  68. BOOL WINAPI DragQueryPoint(HDROP, POINT FAR*);
  69. void WINAPI DragFinish(HDROP);
  70. void WINAPI DragAcceptFiles(HWND, BOOL);
  71.  
  72. HICON WINAPI ExtractIcon(HINSTANCE hInst, LPCSTR lpszExeFileName, UINT nIconIndex);
  73.  
  74. /* error values for ShellExecute() beyond the regular WinExec() codes */
  75. #define SE_ERR_SHARE            26
  76. #define SE_ERR_ASSOCINCOMPLETE  27
  77. #define SE_ERR_DDETIMEOUT       28
  78. #define SE_ERR_DDEFAIL          29
  79. #define SE_ERR_DDEBUSY          30
  80. #define SE_ERR_NOASSOC          31
  81.  
  82. HINSTANCE WINAPI ShellExecute(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, int iShowCmd);
  83. HINSTANCE WINAPI FindExecutable(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult);
  84.  
  85. #ifdef __cplusplus
  86. }
  87. #endif
  88.  
  89. #ifndef RC_INVOKED
  90. #pragma option -a.      /* Revert to default packing */
  91. #endif  /* RC_INVOKED */
  92.  
  93. #endif  /* __SHELLAPI_H */
  94. #else   /* !__FLAT__ */
  95. /*****************************************************************************\
  96. *                                                                             *
  97. * shellapi.h -  SHELL.DLL functions, types, and definitions                   *
  98. *                                                                             *
  99. * Copyright (c) 1992-1995, Microsoft Corp.  All rights reserved               *
  100. *                                                                             *
  101. \*****************************************************************************/
  102.  
  103. #ifndef _INC_SHELLAPI
  104. #define _INC_SHELLAPI
  105.  
  106.  
  107.  
  108. //
  109. // Define API decoration for direct importing of DLL references.
  110. //
  111. #ifndef WINSHELLAPI
  112. #if !defined(_SHELL32_)
  113. #define WINSHELLAPI DECLSPEC_IMPORT
  114. #else
  115. #define WINSHELLAPI
  116. #endif
  117. #endif // WINSHELLAPI
  118.  
  119. #include <pshpack1.h>
  120.  
  121. #ifdef __cplusplus
  122. extern "C" {            /* Assume C declarations for C++ */
  123. #endif  /* __cplusplus */
  124.  
  125.  
  126.  
  127. DECLARE_HANDLE(HDROP);
  128.  
  129. WINSHELLAPI UINT APIENTRY DragQueryFileA(HDROP,UINT,LPSTR,UINT);
  130. WINSHELLAPI UINT APIENTRY DragQueryFileW(HDROP,UINT,LPWSTR,UINT);
  131. #ifdef UNICODE
  132. #define DragQueryFile  DragQueryFileW
  133. #else
  134. #define DragQueryFile  DragQueryFileA
  135. #endif // !UNICODE
  136. WINSHELLAPI BOOL APIENTRY DragQueryPoint(HDROP,LPPOINT);
  137. WINSHELLAPI VOID APIENTRY DragFinish(HDROP);
  138. WINSHELLAPI VOID APIENTRY DragAcceptFiles(HWND,BOOL);
  139.  
  140. WINSHELLAPI HINSTANCE APIENTRY ShellExecuteA(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd);
  141. WINSHELLAPI HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd);
  142. #ifdef UNICODE
  143. #define ShellExecute  ShellExecuteW
  144. #else
  145. #define ShellExecute  ShellExecuteA
  146. #endif // !UNICODE
  147. WINSHELLAPI HINSTANCE APIENTRY FindExecutableA(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult);
  148. WINSHELLAPI HINSTANCE APIENTRY FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult);
  149. #ifdef UNICODE
  150. #define FindExecutable  FindExecutableW
  151. #else
  152. #define FindExecutable  FindExecutableA
  153. #endif // !UNICODE
  154. WINSHELLAPI LPWSTR *  APIENTRY CommandLineToArgvW(LPCWSTR lpCmdLine, int*pNumArgs);
  155.  
  156. WINSHELLAPI INT       APIENTRY ShellAboutA(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon);
  157. WINSHELLAPI INT       APIENTRY ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon);
  158. #ifdef UNICODE
  159. #define ShellAbout  ShellAboutW
  160. #else
  161. #define ShellAbout  ShellAboutA
  162. #endif // !UNICODE
  163. WINSHELLAPI HICON     APIENTRY DuplicateIcon(HINSTANCE hInst, HICON hIcon);
  164. WINSHELLAPI HICON     APIENTRY ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon);
  165. WINSHELLAPI HICON     APIENTRY ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIcon);
  166. #ifdef UNICODE
  167. #define ExtractAssociatedIcon  ExtractAssociatedIconW
  168. #else
  169. #define ExtractAssociatedIcon  ExtractAssociatedIconA
  170. #endif // !UNICODE
  171. WINSHELLAPI HICON     APIENTRY ExtractIconA(HINSTANCE hInst, LPCSTR lpszExeFileName, UINT nIconIndex);
  172. WINSHELLAPI HICON     APIENTRY ExtractIconW(HINSTANCE hInst, LPCWSTR lpszExeFileName, UINT nIconIndex);
  173. #ifdef UNICODE
  174. #define ExtractIcon  ExtractIconW
  175. #else
  176. #define ExtractIcon  ExtractIconA
  177. #endif // !UNICODE
  178.  
  179. #if(WINVER >= 0x0400)
  180. typedef struct _DRAGINFOA {
  181.     UINT uSize;                 /* init with sizeof(DRAGINFO) */
  182.     POINT pt;
  183.     BOOL fNC;
  184.     LPSTR   lpFileList;
  185.     DWORD grfKeyState;
  186. } DRAGINFOA, FAR* LPDRAGINFOA;
  187. typedef struct _DRAGINFOW {
  188.     UINT uSize;                 /* init with sizeof(DRAGINFO) */
  189.     POINT pt;
  190.     BOOL fNC;
  191.     LPWSTR  lpFileList;
  192.     DWORD grfKeyState;
  193. } DRAGINFOW, FAR* LPDRAGINFOW;
  194. #ifdef UNICODE
  195. typedef DRAGINFOW DRAGINFO;
  196. typedef LPDRAGINFOW LPDRAGINFO;
  197. #else
  198. typedef DRAGINFOA DRAGINFO;
  199. typedef LPDRAGINFOA LPDRAGINFO;
  200. #endif // UNICODE
  201.  
  202.  
  203. ////
  204. //// AppBar stuff
  205. ////
  206. #define ABM_NEW           0x00000000
  207. #define ABM_REMOVE        0x00000001
  208. #define ABM_QUERYPOS      0x00000002
  209. #define ABM_SETPOS        0x00000003
  210. #define ABM_GETSTATE      0x00000004
  211. #define ABM_GETTASKBARPOS 0x00000005
  212. #define ABM_ACTIVATE      0x00000006  // lParam == TRUE/FALSE means activate/deactivate
  213. #define ABM_GETAUTOHIDEBAR 0x00000007
  214. #define ABM_SETAUTOHIDEBAR 0x00000008  // this can fail at any time.  MUST check the result
  215.                                         // lParam = TRUE/FALSE  Set/Unset
  216.                                         // uEdge = what edge
  217. #define ABM_WINDOWPOSCHANGED 0x0000009
  218.  
  219.  
  220. // these are put in the wparam of callback messages
  221. #define ABN_STATECHANGE    0x0000000
  222. #define ABN_POSCHANGED     0x0000001
  223. #define ABN_FULLSCREENAPP  0x0000002
  224. #define ABN_WINDOWARRANGE  0x0000003 // lParam == TRUE means hide
  225.  
  226. // flags for get state
  227. #define ABS_AUTOHIDE    0x0000001
  228. #define ABS_ALWAYSONTOP 0x0000002
  229.  
  230. #define ABE_LEFT        0
  231. #define ABE_TOP         1
  232. #define ABE_RIGHT       2
  233. #define ABE_BOTTOM      3
  234.  
  235. typedef struct _AppBarData
  236. {
  237.     DWORD cbSize;
  238.     HWND hWnd;
  239.     UINT uCallbackMessage;
  240.     UINT uEdge;
  241.     RECT rc;
  242.     LPARAM lParam; // message specific
  243. } APPBARDATA, *PAPPBARDATA;
  244.  
  245. WINSHELLAPI UINT APIENTRY SHAppBarMessage(DWORD dwMessage, PAPPBARDATA pData);
  246.  
  247. ////
  248. ////  EndAppBar
  249. ////
  250.  
  251.  
  252.  
  253. WINSHELLAPI DWORD   APIENTRY DoEnvironmentSubstA(LPSTR szString, UINT cbString);
  254. WINSHELLAPI DWORD   APIENTRY DoEnvironmentSubstW(LPWSTR szString, UINT cbString);
  255. #ifdef UNICODE
  256. #define DoEnvironmentSubst  DoEnvironmentSubstW
  257. #else
  258. #define DoEnvironmentSubst  DoEnvironmentSubstA
  259. #endif // !UNICODE
  260. WINSHELLAPI LPSTR APIENTRY FindEnvironmentStringA(LPSTR szEnvVar);
  261. WINSHELLAPI LPWSTR APIENTRY FindEnvironmentStringW(LPWSTR szEnvVar);
  262. #ifdef UNICODE
  263. #define FindEnvironmentString  FindEnvironmentStringW
  264. #else
  265. #define FindEnvironmentString  FindEnvironmentStringA
  266. #endif // !UNICODE
  267.  
  268. #define EIRESID(x) (-1 * (int)(x))
  269. WINSHELLAPI UINT WINAPI ExtractIconExA(LPCSTR lpszFile, int nIconIndex, HICON FAR *phiconLarge, HICON FAR *phiconSmall, UINT nIcons);
  270. WINSHELLAPI UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, int nIconIndex, HICON FAR *phiconLarge, HICON FAR *phiconSmall, UINT nIcons);
  271. #ifdef UNICODE
  272. #define ExtractIconEx  ExtractIconExW
  273. #else
  274. #define ExtractIconEx  ExtractIconExA
  275. #endif // !UNICODE
  276.  
  277.  
  278.  
  279. ////
  280. //// Shell File Operations
  281. ////
  282.  
  283. #ifndef FO_MOVE //these need to be kept in sync with the ones in shlobj.h
  284.  
  285. #define FO_MOVE           0x0001
  286. #define FO_COPY           0x0002
  287. #define FO_DELETE         0x0003
  288. #define FO_RENAME         0x0004
  289.  
  290. #define FOF_MULTIDESTFILES         0x0001
  291. #define FOF_CONFIRMMOUSE           0x0002
  292. #define FOF_SILENT                 0x0004  // don't create progress/report
  293. #define FOF_RENAMEONCOLLISION      0x0008
  294. #define FOF_NOCONFIRMATION         0x0010  // Don't prompt the user.
  295. #define FOF_WANTMAPPINGHANDLE      0x0020  // Fill in SHFILEOPSTRUCT.hNameMappings
  296.                                       // Must be freed using SHFreeNameMappings
  297. #define FOF_ALLOWUNDO              0x0040
  298. #define FOF_FILESONLY              0x0080  // on *.*, do only files
  299. #define FOF_SIMPLEPROGRESS         0x0100  // means don't show names of files
  300. #define FOF_NOCONFIRMMKDIR         0x0200  // don't confirm making any needed dirs
  301.  
  302. typedef WORD FILEOP_FLAGS;
  303.  
  304. #define PO_DELETE       0x0013  // printer is being deleted
  305. #define PO_RENAME       0x0014  // printer is being renamed
  306. #define PO_PORTCHANGE   0x0020  // port this printer connected to is being changed
  307.                                 // if this id is set, the strings received by
  308.                                 // the copyhook are a doubly-null terminated
  309.                                 // list of strings.  The first is the printer
  310.                                 // name and the second is the printer port.
  311. #define PO_REN_PORT     0x0034  // PO_RENAME and PO_PORTCHANGE at same time.
  312.  
  313. // no POF_ flags currently defined
  314.  
  315. typedef WORD PRINTEROP_FLAGS;
  316.  
  317. #endif // FO_MOVE
  318.  
  319. // implicit parameters are:
  320. //      if pFrom or pTo are unqualified names the current directories are
  321. //      taken from the global current drive/directory settings managed
  322. //      by Get/SetCurrentDrive/Directory
  323. //
  324. //      the global confirmation settings
  325.  
  326. typedef struct _SHFILEOPSTRUCTA
  327. {
  328.         HWND            hwnd;
  329.         UINT            wFunc;
  330.         LPCSTR          pFrom;
  331.         LPCSTR          pTo;
  332.         FILEOP_FLAGS    fFlags;
  333.         BOOL            fAnyOperationsAborted;
  334.         LPVOID          hNameMappings;
  335.         LPCSTR           lpszProgressTitle; // only used if FOF_SIMPLEPROGRESS
  336. } SHFILEOPSTRUCTA, FAR *LPSHFILEOPSTRUCTA;
  337. typedef struct _SHFILEOPSTRUCTW
  338. {
  339.         HWND            hwnd;
  340.         UINT            wFunc;
  341.         LPCWSTR         pFrom;
  342.         LPCWSTR         pTo;
  343.         FILEOP_FLAGS    fFlags;
  344.         BOOL            fAnyOperationsAborted;
  345.         LPVOID          hNameMappings;
  346.         LPCWSTR          lpszProgressTitle; // only used if FOF_SIMPLEPROGRESS
  347. } SHFILEOPSTRUCTW, FAR *LPSHFILEOPSTRUCTW;
  348. #ifdef UNICODE
  349. typedef SHFILEOPSTRUCTW SHFILEOPSTRUCT;
  350. typedef LPSHFILEOPSTRUCTW LPSHFILEOPSTRUCT;
  351. #else
  352. typedef SHFILEOPSTRUCTA SHFILEOPSTRUCT;
  353. typedef LPSHFILEOPSTRUCTA LPSHFILEOPSTRUCT;
  354. #endif // UNICODE
  355.  
  356. WINSHELLAPI int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp);
  357. WINSHELLAPI int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp);
  358. #ifdef UNICODE
  359. #define SHFileOperation  SHFileOperationW
  360. #else
  361. #define SHFileOperation  SHFileOperationA
  362. #endif // !UNICODE
  363.  
  364. WINSHELLAPI void WINAPI SHFreeNameMappings(HANDLE hNameMappings);
  365.  
  366. typedef struct _SHNAMEMAPPINGA
  367. {
  368.     LPSTR   pszOldPath;
  369.     LPSTR   pszNewPath;
  370.     int   cchOldPath;
  371.     int   cchNewPath;
  372. } SHNAMEMAPPINGA, FAR *LPSHNAMEMAPPINGA;
  373. typedef struct _SHNAMEMAPPINGW
  374. {
  375.     LPWSTR  pszOldPath;
  376.     LPWSTR  pszNewPath;
  377.     int   cchOldPath;
  378.     int   cchNewPath;
  379. } SHNAMEMAPPINGW, FAR *LPSHNAMEMAPPINGW;
  380. #ifdef UNICODE
  381. typedef SHNAMEMAPPINGW SHNAMEMAPPING;
  382. typedef LPSHNAMEMAPPINGW LPSHNAMEMAPPING;
  383. #else
  384. typedef SHNAMEMAPPINGA SHNAMEMAPPING;
  385. typedef LPSHNAMEMAPPINGA LPSHNAMEMAPPING;
  386. #endif // UNICODE
  387.  
  388. #define SHGetNameMappingCount(_hnm) \
  389.         DSA_GetItemCount(_hnm)
  390. #define SHGetNameMappingPtr(_hnm, _iItem) \
  391.         (LPSHNAMEMAPPING)DSA_GetItemPtr(_hnm, _iItem)
  392.  
  393. ////
  394. //// End Shell File Operations
  395. ////
  396.  
  397. ////
  398. ////  Begin ShellExecuteEx and family
  399. ////
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409. /* ShellExecute() and ShellExecuteEx() error codes */
  410.  
  411. /* regular WinExec() codes */
  412. #define SE_ERR_FNF              2       // file not found
  413. #define SE_ERR_PNF              3       // path not found
  414. #define SE_ERR_ACCESSDENIED     5       // access denied
  415. #define SE_ERR_OOM              8       // out of memory
  416. #define SE_ERR_DLLNOTFOUND              32
  417.  
  418. #endif /* WINVER >= 0x0400 */
  419.  
  420. /* error values for ShellExecute() beyond the regular WinExec() codes */
  421. #define SE_ERR_SHARE                    26
  422. #define SE_ERR_ASSOCINCOMPLETE          27
  423. #define SE_ERR_DDETIMEOUT               28
  424. #define SE_ERR_DDEFAIL                  29
  425. #define SE_ERR_DDEBUSY                  30
  426. #define SE_ERR_NOASSOC                  31
  427.  
  428. #if(WINVER >= 0x0400)
  429.  
  430. // Note CLASSKEY overrides CLASSNAME
  431. #define SEE_MASK_CLASSNAME      0x00000001
  432. #define SEE_MASK_CLASSKEY       0x00000003
  433. // Note INVOKEIDLIST overrides IDLIST
  434. #define SEE_MASK_IDLIST         0x00000004
  435. #define SEE_MASK_INVOKEIDLIST   0x0000000c
  436. #define SEE_MASK_ICON           0x00000010
  437. #define SEE_MASK_HOTKEY         0x00000020
  438. #define SEE_MASK_NOCLOSEPROCESS 0x00000040
  439. #define SEE_MASK_CONNECTNETDRV  0x00000080
  440. #define SEE_MASK_FLAG_DDEWAIT   0x00000100
  441. #define SEE_MASK_DOENVSUBST     0x00000200
  442. #define SEE_MASK_FLAG_NO_UI     0x00000400
  443. #define SEE_MASK_UNICODE        0x00010000
  444.  
  445. typedef struct _SHELLEXECUTEINFOA
  446. {
  447.         DWORD cbSize;
  448.         ULONG fMask;
  449.         HWND hwnd;
  450.         LPCSTR   lpVerb;
  451.         LPCSTR   lpFile;
  452.         LPCSTR   lpParameters;
  453.         LPCSTR   lpDirectory;
  454.         int nShow;
  455.         HINSTANCE hInstApp;
  456.         // Optional fields
  457.         LPVOID lpIDList;
  458.         LPCSTR   lpClass;
  459.         HKEY hkeyClass;
  460.         DWORD dwHotKey;
  461.         HANDLE hIcon;
  462.         HANDLE hProcess;
  463. } SHELLEXECUTEINFOA, FAR *LPSHELLEXECUTEINFOA;
  464. typedef struct _SHELLEXECUTEINFOW
  465. {
  466.         DWORD cbSize;
  467.         ULONG fMask;
  468.         HWND hwnd;
  469.         LPCWSTR  lpVerb;
  470.         LPCWSTR  lpFile;
  471.         LPCWSTR  lpParameters;
  472.         LPCWSTR  lpDirectory;
  473.         int nShow;
  474.         HINSTANCE hInstApp;
  475.         // Optional fields
  476.         LPVOID lpIDList;
  477.         LPCWSTR  lpClass;
  478.         HKEY hkeyClass;
  479.         DWORD dwHotKey;
  480.         HANDLE hIcon;
  481.         HANDLE hProcess;
  482. } SHELLEXECUTEINFOW, FAR *LPSHELLEXECUTEINFOW;
  483. #ifdef UNICODE
  484. typedef SHELLEXECUTEINFOW SHELLEXECUTEINFO;
  485. typedef LPSHELLEXECUTEINFOW LPSHELLEXECUTEINFO;
  486. #else
  487. typedef SHELLEXECUTEINFOA SHELLEXECUTEINFO;
  488. typedef LPSHELLEXECUTEINFOA LPSHELLEXECUTEINFO;
  489. #endif // UNICODE
  490.  
  491. WINSHELLAPI BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA lpExecInfo);
  492. WINSHELLAPI BOOL WINAPI ShellExecuteExW(LPSHELLEXECUTEINFOW lpExecInfo);
  493. #ifdef UNICODE
  494. #define ShellExecuteEx  ShellExecuteExW
  495. #else
  496. #define ShellExecuteEx  ShellExecuteExA
  497. #endif // !UNICODE
  498. WINSHELLAPI void WINAPI WinExecErrorA(HWND hwnd, int error, LPCSTR lpstrFileName, LPCSTR lpstrTitle);
  499. WINSHELLAPI void WINAPI WinExecErrorW(HWND hwnd, int error, LPCWSTR lpstrFileName, LPCWSTR lpstrTitle);
  500. #ifdef UNICODE
  501. #define WinExecError  WinExecErrorW
  502. #else
  503. #define WinExecError  WinExecErrorA
  504. #endif // !UNICODE
  505.  
  506. ////
  507. ////  End ShellExecuteEx and family
  508. ////
  509.  
  510.  
  511. ////
  512. //// Tray notification definitions
  513. ////
  514.  
  515. typedef struct _NOTIFYICONDATAA {
  516.         DWORD cbSize;
  517.         HWND hWnd;
  518.         UINT uID;
  519.         UINT uFlags;
  520.         UINT uCallbackMessage;
  521.         HICON hIcon;
  522.         CHAR   szTip[64];
  523. } NOTIFYICONDATAA, *PNOTIFYICONDATAA;
  524. typedef struct _NOTIFYICONDATAW {
  525.         DWORD cbSize;
  526.         HWND hWnd;
  527.         UINT uID;
  528.         UINT uFlags;
  529.         UINT uCallbackMessage;
  530.         HICON hIcon;
  531.         WCHAR  szTip[64];
  532. } NOTIFYICONDATAW, *PNOTIFYICONDATAW;
  533. #ifdef UNICODE
  534. typedef NOTIFYICONDATAW NOTIFYICONDATA;
  535. typedef PNOTIFYICONDATAW PNOTIFYICONDATA;
  536. #else
  537. typedef NOTIFYICONDATAA NOTIFYICONDATA;
  538. typedef PNOTIFYICONDATAA PNOTIFYICONDATA;
  539. #endif // UNICODE
  540.  
  541.  
  542. #define NIM_ADD         0x00000000
  543. #define NIM_MODIFY      0x00000001
  544. #define NIM_DELETE      0x00000002
  545.  
  546. #define NIF_MESSAGE     0x00000001
  547. #define NIF_ICON        0x00000002
  548. #define NIF_TIP         0x00000004
  549.  
  550. WINSHELLAPI BOOL WINAPI Shell_NotifyIconA(DWORD dwMessage, PNOTIFYICONDATAA lpData);
  551. WINSHELLAPI BOOL WINAPI Shell_NotifyIconW(DWORD dwMessage, PNOTIFYICONDATAW lpData);
  552. #ifdef UNICODE
  553. #define Shell_NotifyIcon  Shell_NotifyIconW
  554. #else
  555. #define Shell_NotifyIcon  Shell_NotifyIconA
  556. #endif // !UNICODE
  557.  
  558. ////
  559. //// End Tray Notification Icons
  560. ////
  561.  
  562.  
  563.  
  564. ////
  565. //// Begin SHGetFileInfo
  566. ////
  567.  
  568. /*
  569.  * The SHGetFileInfo API provides an easy way to get attributes
  570.  * for a file given a pathname.
  571.  *
  572.  *   PARAMETERS
  573.  *
  574.  *     pszPath              file name to get info about
  575.  *     dwFileAttributes     file attribs, only used with SHGFI_USEFILEATTRIBUTES
  576.  *     psfi                 place to return file info
  577.  *     cbFileInfo           size of structure
  578.  *     uFlags               flags
  579.  *
  580.  *   RETURN
  581.  *     TRUE if things worked
  582.  */
  583.  
  584. typedef struct _SHFILEINFOA
  585. {
  586.         HICON       hIcon;                      // out: icon
  587.         int         iIcon;                      // out: icon index
  588.         DWORD       dwAttributes;               // out: SFGAO_ flags
  589.         CHAR        szDisplayName[MAX_PATH];    // out: display name (or path)
  590.         CHAR        szTypeName[80];             // out: type name
  591. } SHFILEINFOA;
  592. typedef struct _SHFILEINFOW
  593. {
  594.         HICON       hIcon;                      // out: icon
  595.         int         iIcon;                      // out: icon index
  596.         DWORD       dwAttributes;               // out: SFGAO_ flags
  597.         WCHAR       szDisplayName[MAX_PATH];    // out: display name (or path)
  598.         WCHAR       szTypeName[80];             // out: type name
  599. } SHFILEINFOW;
  600. #ifdef UNICODE
  601. typedef SHFILEINFOW SHFILEINFO;
  602. #else
  603. typedef SHFILEINFOA SHFILEINFO;
  604. #endif // UNICODE
  605.  
  606. #define SHGFI_ICON              0x000000100     // get icon
  607. #define SHGFI_DISPLAYNAME       0x000000200     // get display name
  608. #define SHGFI_TYPENAME          0x000000400     // get type name
  609. #define SHGFI_ATTRIBUTES        0x000000800     // get attributes
  610. #define SHGFI_ICONLOCATION      0x000001000     // get icon location
  611. #define SHGFI_EXETYPE           0x000002000     // return exe type
  612. #define SHGFI_SYSICONINDEX      0x000004000     // get system icon index
  613. #define SHGFI_LINKOVERLAY       0x000008000     // put a link overlay on icon
  614. #define SHGFI_SELECTED          0x000010000     // show icon in selected state
  615. #define SHGFI_LARGEICON         0x000000000     // get large icon
  616. #define SHGFI_SMALLICON         0x000000001     // get small icon
  617. #define SHGFI_OPENICON          0x000000002     // get open icon
  618. #define SHGFI_SHELLICONSIZE     0x000000004     // get shell size icon
  619. #define SHGFI_PIDL              0x000000008     // pszPath is a pidl
  620. #define SHGFI_USEFILEATTRIBUTES 0x000000010     // use passed dwFileAttribute
  621.  
  622. WINSHELLAPI DWORD WINAPI SHGetFileInfoA(LPCSTR pszPath, DWORD dwFileAttributes, SHFILEINFOA FAR *psfi, UINT cbFileInfo, UINT uFlags);
  623. WINSHELLAPI DWORD WINAPI SHGetFileInfoW(LPCWSTR pszPath, DWORD dwFileAttributes, SHFILEINFOW FAR *psfi, UINT cbFileInfo, UINT uFlags);
  624. #ifdef UNICODE
  625. #define SHGetFileInfo  SHGetFileInfoW
  626. #else
  627. #define SHGetFileInfo  SHGetFileInfoA
  628. #endif // !UNICODE
  629.  
  630.  
  631. WINSHELLAPI BOOL WINAPI SHGetNewLinkInfoA(LPCSTR pszLinkTo, LPCSTR pszDir, LPSTR pszName,
  632.                              BOOL FAR * pfMustCopy, UINT uFlags);
  633. WINSHELLAPI BOOL WINAPI SHGetNewLinkInfoW(LPCWSTR pszLinkTo, LPCWSTR pszDir, LPWSTR pszName,
  634.                              BOOL FAR * pfMustCopy, UINT uFlags);
  635. #ifdef UNICODE
  636. #define SHGetNewLinkInfo  SHGetNewLinkInfoW
  637. #else
  638. #define SHGetNewLinkInfo  SHGetNewLinkInfoA
  639. #endif // !UNICODE
  640.  
  641. #define SHGNLI_PIDL             0x000000001     // pszLinkTo is a pidl
  642. #define SHGNLI_PREFIXNAME       0x000000002     // Make name "Shortcut to xxx"
  643.  
  644. ////
  645. //// End SHGetFileInfo
  646. ////
  647.  
  648. #endif /* WINVER >= 0x0400 */
  649.  
  650. #ifdef __cplusplus
  651. }
  652. #endif  /* __cplusplus */
  653. #include <poppack.h>
  654. #endif  /* _INC_SHELLAPI */
  655. #endif  /* !__FLAT__ */