home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / w / wa0729.zip / MAPI.H < prev    next >
Text File  |  1992-11-20  |  7KB  |  178 lines

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