MAPI.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:7k
源码类别:

Windows编程

开发平台:

Visual C++

  1. /*
  2.  *  m a p i . h
  3.  *    
  4.  *  Messaging Applications Programming Interface.
  5.  *    
  6.  *  Copyright (c) 1992-1997 Microsoft Corporation.  All rights reserved.
  7.  *    
  8.  *  Purpose:
  9.  *    This file defines the structures and constants used by
  10.  *    that subset of the messaging applications programming
  11.  *    interface which will be supported under Windows by
  12.  *    Microsoft Mail for PC Networks vesion 3.0.
  13.  */
  14. /*
  15.  *  Types.
  16.  */
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. typedef unsigned long       ULONG;
  21. typedef unsigned long FAR * LPULONG;
  22. typedef unsigned long       FLAGS;
  23. typedef unsigned long LHANDLE, FAR *LPLHANDLE;
  24. #define lhSessionNull   ((LHANDLE)0)
  25. #define MAPI_MESSAGEID_LENGTH   64
  26. typedef struct
  27.   {
  28.     ULONG ulReserved;    // Reserved for future use (must be 0)
  29. ULONG flFlags;  // Flags
  30.     ULONG nPosition;     // character in text to be replaced by attachment
  31.     LPSTR lpszPathName;  // Full path name of attachment file
  32.     LPSTR lpszFileName;  // Original file name (optional)
  33.     LPVOID  UNALIGNED lpFileType;   // Attachment file type (optional)
  34.   } UNALIGNED MapiFileDesc, UNALIGNED FAR * lpMapiFileDesc;
  35. #define MAPI_OLE 0x00000001
  36. #define MAPI_OLE_STATIC 0x00000002
  37. typedef struct
  38.   {
  39.     ULONG ulReserved;           // Reserved for future use
  40.     ULONG ulRecipClass;         // Recipient class
  41.                                 // MAPI_TO, MAPI_CC, MAPI_BCC, MAPI_ORIG
  42.     LPSTR lpszName;             // Recipient name
  43.     LPSTR lpszAddress;          // Recipient address (optional)
  44.     ULONG ulEIDSize;         // Count in bytes of size of pEntryID
  45.     LPVOID lpEntryID;           // System-specific recipient reference
  46.   } UNALIGNED MapiRecipDesc, UNALIGNED FAR * lpMapiRecipDesc;
  47. #define MAPI_ORIG   0           // Recipient is message originator
  48. #define MAPI_TO     1           // Recipient is a primary recipient
  49. #define MAPI_CC     2           // Recipient is a copy recipient
  50. #define MAPI_BCC    3           // Recipient is blind copy recipient
  51. typedef struct
  52.   {
  53.     ULONG ulReserved;                   // Reserved for future use (M.B. 0)
  54.     LPSTR lpszSubject;                  // Message Subject
  55.     LPSTR lpszNoteText;                 // Message Text
  56.     LPSTR lpszMessageType;              // Message Class
  57.     LPSTR lpszDateReceived;             // in YYYY/MM/DD HH:MM format   
  58. LPSTR lpszConversationID; // conversation thread ID
  59.     FLAGS flFlags;                      // unread,return receipt
  60.     lpMapiRecipDesc lpOriginator;       // Originator descriptor
  61.     ULONG nRecipCount;                  // Number of recipients
  62.     lpMapiRecipDesc lpRecips;           // Recipient descriptors
  63.     ULONG nFileCount;                   // # of file attachments
  64.     lpMapiFileDesc lpFiles;             // Attachment descriptors
  65.   } UNALIGNED MapiMessage, UNALIGNED FAR * lpMapiMessage;
  66. #define MAPI_UNREAD             0x00000001
  67. #define MAPI_RECEIPT_REQUESTED  0x00000002
  68. #define MAPI_SENT               0x00000004
  69. /*
  70.  *  Entry points.
  71.  */
  72. #define MAPI_LOGON_UI                   0x00000001  // Display logon UI
  73. #define MAPI_NEW_SESSION                0x00000002  // Do not use default.
  74. #define MAPI_DIALOG                     0x00000008  // Display a send note UI
  75. #define MAPI_UNREAD_ONLY                0x00000020  // Only unread messages
  76. #define MAPI_ENVELOPE_ONLY              0x00000040  // Only header information
  77. #define MAPI_PEEK                       0x00000080  // Do not mark as read.
  78. #define MAPI_GUARANTEE_FIFO 0x00000100 // use date order
  79. #define MAPI_BODY_AS_FILE 0x00000200
  80. #define MAPI_AB_NOMODIFY 0x00000400 // Don't allow mods of AB entries
  81. #define MAPI_SUPPRESS_ATTACH 0x00000800 // header + body, no files
  82. #define MAPI_FORCE_DOWNLOAD 0x00001000 // force download of new mail during MAPILogon
  83. ULONG FAR PASCAL MAPILogon(ULONG ulUIParam, LPSTR lpszName, LPSTR lpszPassword,
  84.                            FLAGS flFlags, ULONG ulReserved,
  85.                            LPLHANDLE lplhSession);
  86. ULONG FAR PASCAL MAPILogoff(LHANDLE lhSession, ULONG ulUIParam, FLAGS flFlags,
  87.                             ULONG ulReserved);
  88. ULONG FAR PASCAL MAPISendMail(LHANDLE lhSession, ULONG ulUIParam,
  89.                               lpMapiMessage lpMessage, FLAGS flFlags,
  90.                               ULONG ulReserved);
  91. ULONG FAR PASCAL MAPISendDocuments(ULONG ulUIParam, LPSTR lpszDelimChar,
  92.                                    LPSTR lpszFilePaths, LPSTR lpszFileNames,
  93.                                    ULONG ulReserved);
  94. ULONG FAR PASCAL MAPIFindNext(LHANDLE lhSession, ULONG ulUIParam,
  95.                               LPSTR lpszMessageType, LPSTR lpszSeedMessageID,
  96.                               FLAGS flFlags, ULONG ulReserved,
  97.                               LPSTR lpszMessageID);
  98. ULONG FAR PASCAL MAPIReadMail(LHANDLE lhSession, ULONG ulUIParam,
  99.                               LPSTR lpszMessageID, FLAGS flFlags,
  100.                               ULONG ulReserved, lpMapiMessage FAR *lppMessageOut);
  101. ULONG FAR PASCAL MAPISaveMail(LHANDLE lhSession, ULONG ulUIParam,
  102.                               lpMapiMessage pMessage, FLAGS flFlags,
  103.                               ULONG ulReserved, LPSTR lpszMessageID);
  104. ULONG FAR PASCAL MAPIDeleteMail(LHANDLE lhSession, ULONG ulUIParam,
  105.                                 LPSTR lpszMessageID, FLAGS flFlags,
  106.                                 ULONG ulReserved);
  107. ULONG FAR PASCAL MAPIFreeBuffer( LPVOID pv );
  108. ULONG FAR PASCAL MAPIAddress(LHANDLE lhSession, ULONG ulUIParam,
  109. LPSTR plszCaption, ULONG nEditFields,
  110. LPSTR lpszLabels, ULONG nRecips,
  111. lpMapiRecipDesc lpRecips, FLAGS flFlags, ULONG ulReserved, 
  112. LPULONG lpnNewRecips, lpMapiRecipDesc FAR *lppNewRecips);
  113. ULONG FAR PASCAL MAPIDetails(LHANDLE lhSession, ULONG ulUIParam,
  114. lpMapiRecipDesc lpRecip, FLAGS flFlags, ULONG ulReserved);
  115. ULONG FAR PASCAL MAPIResolveName(LHANDLE lhSession, ULONG ulUIParam,
  116. LPSTR lpszName, FLAGS flFlags,
  117. ULONG ulReserved, lpMapiRecipDesc FAR *lppRecip);
  118. #define SUCCESS_SUCCESS                     0
  119. #define MAPI_USER_ABORT                     1
  120. #define MAPI_E_FAILURE                      2
  121. #define MAPI_E_LOGIN_FAILURE                3
  122. #define MAPI_E_DISK_FULL                    4
  123. #define MAPI_E_INSUFFICIENT_MEMORY          5
  124. #define MAPI_E_ACCESS_DENIED 6
  125. #define MAPI_E_TOO_MANY_SESSIONS            8
  126. #define MAPI_E_TOO_MANY_FILES               9
  127. #define MAPI_E_TOO_MANY_RECIPIENTS          10
  128. #define MAPI_E_ATTACHMENT_NOT_FOUND         11
  129. #define MAPI_E_ATTACHMENT_OPEN_FAILURE      12
  130. #define MAPI_E_ATTACHMENT_WRITE_FAILURE     13
  131. #define MAPI_E_UNKNOWN_RECIPIENT            14
  132. #define MAPI_E_BAD_RECIPTYPE                15
  133. #define MAPI_E_NO_MESSAGES                  16
  134. #define MAPI_E_INVALID_MESSAGE              17
  135. #define MAPI_E_TEXT_TOO_LARGE               18
  136. #define MAPI_E_INVALID_SESSION 19
  137. #define MAPI_E_TYPE_NOT_SUPPORTED 20
  138. #define MAPI_E_AMBIGUOUS_RECIPIENT 21
  139. #define MAPI_E_MESSAGE_IN_USE 22
  140. #define MAPI_E_NETWORK_FAILURE 23
  141. #define MAPI_E_INVALID_EDITFIELDS 24
  142. #define MAPI_E_INVALID_RECIPS 25
  143. #define MAPI_E_NOT_SUPPORTED 26
  144. #ifdef __cplusplus
  145. }
  146. #endif