Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

177 lines
6.9 KiB

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