home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / Emulation_Include_Files / shellapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  10.6 KB  |  340 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. // values for the fMask field
  163. #define SEE_MASK_NOCLOSEPROCESS 0x00000040
  164. #define SEE_MASK_FLAG_NO_UI     0x00000400
  165.  
  166. typedef struct _SHELLEXECUTEINFO
  167. {
  168.         DWORD cbSize;
  169.         ULONG fMask;
  170.         HWND hwnd;
  171.         LPCTSTR lpVerb;
  172.         LPCTSTR lpFile;
  173.         LPCTSTR lpParameters;
  174.         LPCTSTR lpDirectory;
  175.         int nShow;
  176.         HINSTANCE hInstApp;
  177.         // Optional fields
  178.         LPVOID lpIDList;
  179.         LPCTSTR lpClass;
  180.         HKEY hkeyClass;
  181.         DWORD dwHotKey;
  182.         HANDLE hIcon;
  183.         HANDLE hProcess;
  184. } SHELLEXECUTEINFO, FAR *LPSHELLEXECUTEINFO;
  185.  
  186. WINSHELLAPI BOOL WINAPI ShellExecuteEx(LPSHELLEXECUTEINFO lpExecInfo);
  187.  
  188. ////
  189. ////  End ShellExecuteEx and family
  190. ////
  191.  
  192.  
  193. ////
  194. //// Tray notification definitions
  195. ////
  196.  
  197. typedef struct _NOTIFYICONDATAA {
  198.         DWORD cbSize;
  199.         HWND hWnd;
  200.         UINT uID;
  201.         UINT uFlags;
  202.         UINT uCallbackMessage;
  203.         HICON hIcon;
  204.         CHAR  szTip[64];
  205. } NOTIFYICONDATAA, *PNOTIFYICONDATAA;
  206.  
  207. typedef struct _NOTIFYICONDATAW {
  208.         DWORD cbSize;
  209.         HWND hWnd;
  210.         UINT uID;
  211.         UINT uFlags;
  212.         UINT uCallbackMessage;
  213.         HICON hIcon;
  214.         WCHAR  szTip[64];
  215. } NOTIFYICONDATAW, *PNOTIFYICONDATAW;
  216. #ifdef UNICODE
  217. typedef NOTIFYICONDATAW NOTIFYICONDATA;
  218. typedef PNOTIFYICONDATAW PNOTIFYICONDATA;
  219. #else
  220. typedef NOTIFYICONDATAA NOTIFYICONDATA;
  221. typedef PNOTIFYICONDATAA PNOTIFYICONDATA;
  222. #endif // UNICODE
  223.  
  224.  
  225. #define NIM_ADD         0x00000000
  226. #define NIM_MODIFY      0x00000001
  227. #define NIM_DELETE      0x00000002
  228.  
  229. #define NIF_MESSAGE     0x00000001
  230. #define NIF_ICON        0x00000002
  231. #define NIF_TIP         0x00000004
  232.  
  233. BOOL WINAPI Shell_NotifyIcon(DWORD dwMessage, PNOTIFYICONDATA lpData);
  234.  
  235. ////
  236. //// End Tray Notification Icons
  237. ////
  238.  
  239.  
  240. ////
  241. //// Begin SHGetFileInfo
  242. ////
  243.  
  244. /*
  245.  * The SHGetFileInfo API provides an easy way to get attributes
  246.  * for a file given a pathname.
  247.  *
  248.  *   PARAMETERS
  249.  *
  250.  *     pszPath              file name to get info about
  251.  *     dwFileAttributes     file attribs, only used with SHGFI_USEFILEATTRIBUTES
  252.  *     psfi                 place to return file info
  253.  *     cbFileInfo           size of structure
  254.  *     uFlags               flags
  255.  *
  256.  *   RETURN
  257.  *     TRUE if things worked
  258.  */
  259.  
  260. #ifndef UNICODE_ONLY
  261. typedef struct _SHFILEINFOA
  262. {
  263.         HICON       hIcon;                      // out: icon
  264.         int         iIcon;                      // out: icon index
  265.         DWORD       dwAttributes;               // out: SFGAO_ flags
  266.         CHAR        szDisplayName[MAX_PATH];    // out: display name (or path)
  267.         CHAR        szTypeName[80];             // out: type name
  268. } SHFILEINFOA;
  269. #endif //!UNICODE_ONLY
  270. #ifndef ANSI_ONLY
  271. typedef struct _SHFILEINFOW
  272. {
  273.         HICON       hIcon;                      // out: icon
  274.         int         iIcon;                      // out: icon index
  275.         DWORD       dwAttributes;               // out: SFGAO_ flags
  276.         WCHAR       szDisplayName[MAX_PATH];    // out: display name (or path)
  277.         WCHAR       szTypeName[80];             // out: type name
  278. } SHFILEINFOW;
  279. #endif //!ANSI_ONLY
  280. #ifdef UNICODE
  281. typedef SHFILEINFOW SHFILEINFO;
  282. #else
  283. typedef SHFILEINFOA SHFILEINFO;
  284. #endif // UNICODE
  285.  
  286. #define SHGFI_ICON              0x000000100     // get icon
  287. #define SHGFI_DISPLAYNAME       0x000000200     // get display name
  288. #define SHGFI_TYPENAME          0x000000400     // get type name
  289. #define SHGFI_ATTRIBUTES        0x000000800     // get attributes
  290. #define SHGFI_ICONLOCATION      0x000001000     // get icon location
  291. #define SHGFI_EXETYPE           0x000002000     // return exe type
  292. #define SHGFI_SYSICONINDEX      0x000004000     // get system icon index
  293. #define SHGFI_LINKOVERLAY       0x000008000     // put a link overlay on icon
  294. #define SHGFI_SELECTED          0x000010000     // show icon in selected state
  295. #define SHGFI_LARGEICON         0x000000000     // get large icon
  296. #define SHGFI_SMALLICON         0x000000001     // get small icon
  297. #define SHGFI_OPENICON          0x000000002     // get open icon
  298. #define SHGFI_SHELLICONSIZE     0x000000004     // get shell size icon
  299. #define SHGFI_PIDL              0x000000008     // pszPath is a pidl
  300. #define SHGFI_USEFILEATTRIBUTES 0x000000010     // use passed dwFileAttribute
  301.  
  302. DWORD WINAPI SHGetFileInfo(LPCTSTR pszPath, DWORD dwFileAttributes,
  303.                            SHFILEINFO *psfi, UINT cbFileInfo, UINT uFlags);
  304.  
  305. ////
  306. //// End SHGetFileInfo
  307. ////
  308.  
  309.  
  310. //
  311. // SHAddToRecentDocs
  312. //
  313. #define SHARD_PIDL    0x00000001L
  314. #define SHARD_PATH      0x00000002L
  315.  
  316. void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv);
  317. #define SHORTCUT_OVERWRITE                0x00000001
  318. DWORD WINAPI SHCreateShortcut(LPTSTR szShortcut, LPTSTR szTarget);
  319. BOOL WINAPI SHGetShortcutTarget(LPCTSTR szShortcut, LPTSTR szTarget, int cb);
  320. int WINAPI SHShowOutOfMemory(HWND hwndOwner, UINT grfFlags);
  321. HBITMAP WINAPI SHLoadDIBitmap(LPCTSTR szFileName);
  322. BOOL WINAPI SHRemoveFontResource(LPCTSTR szFileName);
  323.  
  324. #ifndef UNDER_NT
  325. #ifdef WINCEOEM
  326. #ifdef WINCEMACRO
  327. #include <mshellap.h>
  328. #endif
  329. #endif
  330. #endif
  331.  
  332.  
  333. #ifdef __cplusplus
  334. }
  335. #endif  /* __cplusplus */
  336.  
  337. #include <poppack.h>
  338.  
  339. #endif  /* _INC_SHELLAPI */
  340.