home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Emulation_Include_Files / shellapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  10.4 KB  |  335 lines

  1. /*****************************************************************************\
  2. *                                                                             *
  3. * shellapi.h -  SHELL.DLL functions, types, and definitions                   *
  4. *                                                                             *
  5. * Copyright (c) 1992-1995, 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.  
  25. #include <pshpack1.h>
  26.  
  27. #ifdef __cplusplus
  28. extern "C" {            /* Assume C declarations for C++ */
  29. #endif  /* __cplusplus */
  30.  
  31.  
  32. #define EIRESID(x) (-1 * (int)(x))
  33.  
  34. #ifndef ExtractIconExA
  35. UINT WINAPI ExtractIconExA(LPCSTR lpszFile, int nIconIndex, HICON FAR *phiconLarge, HICON FAR *phiconSmall, UINT nIcons);
  36. #endif
  37.  
  38. #ifndef ExtractIconExW
  39. UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, int nIconIndex, HICON FAR *phiconLarge, HICON FAR *phiconSmall, UINT nIcons);
  40. #endif
  41.  
  42. #ifdef UNICODE
  43. #define ExtractIconEx  ExtractIconExW
  44. #else
  45. #define ExtractIconEx  ExtractIconExA
  46. #endif // !UNICODE
  47.  
  48.  
  49. ////
  50. //// Shell File Operations
  51. ////
  52.  
  53. #ifndef FO_MOVE //these need to be kept in sync with the ones in shlobj.h
  54.  
  55. #define FO_MOVE           0x0001
  56. #define FO_COPY           0x0002
  57. #define FO_DELETE         0x0003
  58. #define FO_RENAME         0x0004
  59.  
  60. #define FOF_MULTIDESTFILES         0x0001
  61. #define FOF_CONFIRMMOUSE           0x0002
  62. #define FOF_SILENT                 0x0004  // don't create progress/report
  63. #define FOF_RENAMEONCOLLISION      0x0008
  64. #define FOF_NOCONFIRMATION         0x0010  // Don't prompt the user.
  65. #define FOF_WANTMAPPINGHANDLE      0x0020  // Fill in SHFILEOPSTRUCT.hNameMappings
  66.                                       // Must be freed using SHFreeNameMappings
  67. #define FOF_ALLOWUNDO              0x0040
  68. #define FOF_FILESONLY              0x0080  // on *.*, do only files
  69. #define FOF_SIMPLEPROGRESS         0x0100  // means don't show names of files
  70. #define FOF_NOCONFIRMMKDIR         0x0200  // don't confirm making any needed dirs
  71.  
  72. typedef WORD FILEOP_FLAGS;
  73.  
  74. #define PO_DELETE       0x0013  // printer is being deleted
  75. #define PO_RENAME       0x0014  // printer is being renamed
  76. #define PO_PORTCHANGE   0x0020  // port this printer connected to is being changed
  77.                                 // if this id is set, the strings received by
  78.                                 // the copyhook are a doubly-null terminated
  79.                                 // list of strings.  The first is the printer
  80.                                 // name and the second is the printer port.
  81. #define PO_REN_PORT     0x0034  // PO_RENAME and PO_PORTCHANGE at same time.
  82.  
  83. // no POF_ flags currently defined
  84.  
  85. typedef WORD PRINTEROP_FLAGS;
  86.  
  87. #endif // FO_MOVE
  88.  
  89. // implicit parameters are:
  90. //      if pFrom or pTo are unqualified names the current directories are
  91. //      taken from the global current drive/directory settings managed
  92. //      by Get/SetCurrentDrive/Directory
  93. //
  94. //      the global confirmation settings
  95.  
  96. #ifndef UNICODE_ONLY
  97. typedef struct _SHFILEOPSTRUCTA
  98. {
  99.         HWND            hwnd;
  100.         UINT            wFunc;
  101.         LPCSTR          pFrom;
  102.         LPCSTR          pTo;
  103.         FILEOP_FLAGS    fFlags;
  104.         BOOL            fAnyOperationsAborted;
  105.         LPVOID          hNameMappings;
  106.         LPCSTR           lpszProgressTitle; // only used if FOF_SIMPLEPROGRESS
  107. } SHFILEOPSTRUCTA, FAR *LPSHFILEOPSTRUCTA;
  108. #endif //!UNICODE_ONLY
  109. #ifndef ANSI_ONLY
  110. typedef struct _SHFILEOPSTRUCTW
  111. {
  112.         HWND            hwnd;
  113.         UINT            wFunc;
  114.         LPCWSTR         pFrom;
  115.         LPCWSTR         pTo;
  116.         FILEOP_FLAGS    fFlags;
  117.         BOOL            fAnyOperationsAborted;
  118.         LPVOID          hNameMappings;
  119.         LPCWSTR          lpszProgressTitle; // only used if FOF_SIMPLEPROGRESS
  120. } SHFILEOPSTRUCTW, FAR *LPSHFILEOPSTRUCTW;
  121. #endif //!ANSI_ONLY
  122. #ifdef UNICODE
  123. typedef SHFILEOPSTRUCTW SHFILEOPSTRUCT;
  124. typedef LPSHFILEOPSTRUCTW LPSHFILEOPSTRUCT;
  125. #else
  126. typedef SHFILEOPSTRUCTA SHFILEOPSTRUCT;
  127. typedef LPSHFILEOPSTRUCTA LPSHFILEOPSTRUCT;
  128. #endif // UNICODE
  129.  
  130. #ifndef UNICODE_ONLY
  131. WINSHELLAPI int WINAPI SHFileOperationA(LPSHFILEOPSTRUCTA lpFileOp);
  132. #endif //!UNICODE_ONLY
  133. #ifndef ANSI_ONLY
  134. WINSHELLAPI int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp);
  135. #endif //!ANSI_ONLY
  136. #ifdef UNICODE
  137. #define SHFileOperation  SHFileOperationW
  138. #else
  139. #define SHFileOperation  SHFileOperationA
  140. #endif // !UNICODE
  141.  
  142.  
  143. ////
  144. ////  Begin ShellExecuteEx and family
  145. ////
  146.  
  147. /* regular WinExec() codes */
  148. #define SE_ERR_FNF              2       // file not found
  149. #define SE_ERR_PNF              3       // path not found
  150. #define SE_ERR_ACCESSDENIED     5       // access denied
  151. #define SE_ERR_OOM              8       // out of memory
  152. #define SE_ERR_DLLNOTFOUND              32
  153.  
  154. /* error values for ShellExecute() beyond the regular WinExec() codes */
  155. #define SE_ERR_SHARE                    26
  156. #define SE_ERR_ASSOCINCOMPLETE          27
  157. #define SE_ERR_DDETIMEOUT               28
  158. #define SE_ERR_DDEFAIL                  29
  159. #define SE_ERR_DDEBUSY                  30
  160. #define SE_ERR_NOASSOC                  31
  161.  
  162. typedef struct _SHELLEXECUTEINFO
  163. {
  164.         DWORD cbSize;
  165.         ULONG fMask;
  166.         HWND hwnd;
  167.         LPCTSTR lpVerb;
  168.         LPCTSTR lpFile;
  169.         LPCTSTR lpParameters;
  170.         LPCTSTR lpDirectory;
  171.         int nShow;
  172.         HINSTANCE hInstApp;
  173.         // Optional fields
  174.         LPVOID lpIDList;
  175.         LPCTSTR lpClass;
  176.         HKEY hkeyClass;
  177.         DWORD dwHotKey;
  178.         HANDLE hIcon;
  179.         HANDLE hProcess;
  180. } SHELLEXECUTEINFO, FAR *LPSHELLEXECUTEINFO;
  181.  
  182. WINSHELLAPI BOOL WINAPI ShellExecuteEx(LPSHELLEXECUTEINFO lpExecInfo);
  183.  
  184. ////
  185. ////  End ShellExecuteEx and family
  186. ////
  187.  
  188.  
  189. ////
  190. //// Tray notification definitions
  191. ////
  192.  
  193. typedef struct _NOTIFYICONDATAA {
  194.         DWORD cbSize;
  195.         HWND hWnd;
  196.         UINT uID;
  197.         UINT uFlags;
  198.         UINT uCallbackMessage;
  199.         HICON hIcon;
  200.         CHAR  szTip[64];
  201. } NOTIFYICONDATAA, *PNOTIFYICONDATAA;
  202.  
  203. typedef struct _NOTIFYICONDATAW {
  204.         DWORD cbSize;
  205.         HWND hWnd;
  206.         UINT uID;
  207.         UINT uFlags;
  208.         UINT uCallbackMessage;
  209.         HICON hIcon;
  210.         WCHAR  szTip[64];
  211. } NOTIFYICONDATAW, *PNOTIFYICONDATAW;
  212. #ifdef UNICODE
  213. typedef NOTIFYICONDATAW NOTIFYICONDATA;
  214. typedef PNOTIFYICONDATAW PNOTIFYICONDATA;
  215. #else
  216. typedef NOTIFYICONDATAA NOTIFYICONDATA;
  217. typedef PNOTIFYICONDATAA PNOTIFYICONDATA;
  218. #endif // UNICODE
  219.  
  220.  
  221. #define NIM_ADD         0x00000000
  222. #define NIM_MODIFY      0x00000001
  223. #define NIM_DELETE      0x00000002
  224.  
  225. #define NIF_MESSAGE     0x00000001
  226. #define NIF_ICON        0x00000002
  227. #define NIF_TIP         0x00000004
  228.  
  229. BOOL WINAPI Shell_NotifyIcon(DWORD dwMessage, PNOTIFYICONDATA lpData);
  230.  
  231. ////
  232. //// End Tray Notification Icons
  233. ////
  234.  
  235.  
  236. ////
  237. //// Begin SHGetFileInfo
  238. ////
  239.  
  240. /*
  241.  * The SHGetFileInfo API provides an easy way to get attributes
  242.  * for a file given a pathname.
  243.  *
  244.  *   PARAMETERS
  245.  *
  246.  *     pszPath              file name to get info about
  247.  *     dwFileAttributes     file attribs, only used with SHGFI_USEFILEATTRIBUTES
  248.  *     psfi                 place to return file info
  249.  *     cbFileInfo           size of structure
  250.  *     uFlags               flags
  251.  *
  252.  *   RETURN
  253.  *     TRUE if things worked
  254.  */
  255.  
  256. #ifndef UNICODE_ONLY
  257. typedef struct _SHFILEINFOA
  258. {
  259.         HICON       hIcon;                      // out: icon
  260.         int         iIcon;                      // out: icon index
  261.         DWORD       dwAttributes;               // out: SFGAO_ flags
  262.         CHAR        szDisplayName[MAX_PATH];    // out: display name (or path)
  263.         CHAR        szTypeName[80];             // out: type name
  264. } SHFILEINFOA;
  265. #endif //!UNICODE_ONLY
  266. #ifndef ANSI_ONLY
  267. typedef struct _SHFILEINFOW
  268. {
  269.         HICON       hIcon;                      // out: icon
  270.         int         iIcon;                      // out: icon index
  271.         DWORD       dwAttributes;               // out: SFGAO_ flags
  272.         WCHAR       szDisplayName[MAX_PATH];    // out: display name (or path)
  273.         WCHAR       szTypeName[80];             // out: type name
  274. } SHFILEINFOW;
  275. #endif //!ANSI_ONLY
  276. #ifdef UNICODE
  277. typedef SHFILEINFOW SHFILEINFO;
  278. #else
  279. typedef SHFILEINFOA SHFILEINFO;
  280. #endif // UNICODE
  281.  
  282. #define SHGFI_ICON              0x000000100     // get icon
  283. #define SHGFI_DISPLAYNAME       0x000000200     // get display name
  284. #define SHGFI_TYPENAME          0x000000400     // get type name
  285. #define SHGFI_ATTRIBUTES        0x000000800     // get attributes
  286. #define SHGFI_ICONLOCATION      0x000001000     // get icon location
  287. #define SHGFI_EXETYPE           0x000002000     // return exe type
  288. #define SHGFI_SYSICONINDEX      0x000004000     // get system icon index
  289. #define SHGFI_LINKOVERLAY       0x000008000     // put a link overlay on icon
  290. #define SHGFI_SELECTED          0x000010000     // show icon in selected state
  291. #define SHGFI_LARGEICON         0x000000000     // get large icon
  292. #define SHGFI_SMALLICON         0x000000001     // get small icon
  293. #define SHGFI_OPENICON          0x000000002     // get open icon
  294. #define SHGFI_SHELLICONSIZE     0x000000004     // get shell size icon
  295. #define SHGFI_PIDL              0x000000008     // pszPath is a pidl
  296. #define SHGFI_USEFILEATTRIBUTES 0x000000010     // use passed dwFileAttribute
  297.  
  298. DWORD WINAPI SHGetFileInfo(LPCTSTR pszPath, DWORD dwFileAttributes,
  299.                            SHFILEINFO *psfi, UINT cbFileInfo, UINT uFlags);
  300.  
  301. ////
  302. //// End SHGetFileInfo
  303. ////
  304.  
  305.  
  306. //
  307. // SHAddToRecentDocs
  308. //
  309. #define SHARD_PIDL    0x00000001L
  310. #define SHARD_PATH      0x00000002L
  311.  
  312. void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv);
  313. #define SHORTCUT_OVERWRITE                0x00000001
  314. DWORD WINAPI SHCreateShortcut(LPTSTR szShortcut, LPTSTR szTarget);
  315. BOOL WINAPI SHGetShortcutTarget(LPCTSTR szShortcut, LPTSTR szTarget, int cb);
  316. int WINAPI SHShowOutOfMemory(HWND hwndOwner, UINT grfFlags);
  317. HBITMAP WINAPI SHLoadDIBitmap(LPCTSTR szFileName);
  318.  
  319. #ifndef UNDER_NT
  320. #ifdef WINCEOEM
  321. #ifdef WINCEMACRO
  322. #include <mshellap.h>
  323. #endif
  324. #endif
  325. #endif
  326.  
  327.  
  328. #ifdef __cplusplus
  329. }
  330. #endif  /* __cplusplus */
  331.  
  332. #include <poppack.h>
  333.  
  334. #endif  /* _INC_SHELLAPI */
  335.