谁有MApi的使用说明?(50分)

  • 主题发起人 主题发起人 delphi fan2
  • 开始时间 开始时间
hi,evergao 能给我一份吗?我可以出50分!<br>my email:wuam@sina.com.
 
<br>{*******************************************************}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ &nbsp; &nbsp; &nbsp; Borland Delphi Runtime Library &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp; &nbsp; &nbsp; Simple MAPI Interface Unit &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ &nbsp; &nbsp; &nbsp; Copyright (C) 1996,99 Inprise Corporation &nbsp; &nbsp; &nbsp; }<br>{ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{*******************************************************}<br><br>unit Mapi;<br><br>{NOTE: Do not place the $NOPACKAGEUNIT directive in this file}<br><br>interface<br><br>uses Windows;<br><br>{<br>&nbsp; Messaging Applications Programming Interface.<br><br>&nbsp; Purpose:<br><br>&nbsp; &nbsp; This file defines the structures and constants used by that<br>&nbsp; &nbsp; subset of the Messaging Applications Programming Interface<br>&nbsp; &nbsp; which is supported under Windows by Microsoft Mail for PC<br>&nbsp; &nbsp; Networks version 3.x.<br>}<br><br>(*$HPPEMIT '#include &lt;mapi.h&gt;'*)<br><br>type<br>&nbsp; {$EXTERNALSYM FLAGS}<br>&nbsp; FLAGS = Cardinal;<br>&nbsp; {$EXTERNALSYM LHANDLE}<br>&nbsp; LHANDLE = Cardinal;<br>&nbsp; PLHANDLE = ^Cardinal;<br><br>const<br>&nbsp; {$EXTERNALSYM lhSessionNull}<br>&nbsp; lhSessionNull = (0);<br><br>type<br>&nbsp; PMapiFileDesc = ^TMapiFileDesc;<br>&nbsp; {$EXTERNALSYM MapiFileDesc}<br>&nbsp; MapiFileDesc = packed record<br>&nbsp; &nbsp; ulReserved: Cardinal; &nbsp; &nbsp; &nbsp; &nbsp;{ Reserved for future use (must be 0) &nbsp; &nbsp; }<br>&nbsp; &nbsp; flFlags: Cardinal; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Flags &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; nPosition: Cardinal; &nbsp; &nbsp; &nbsp; &nbsp; { character in text to be replaced by attachment }<br>&nbsp; &nbsp; lpszPathName: LPSTR; &nbsp; &nbsp; &nbsp; &nbsp; { Full path name of attachment file &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; lpszFileName: LPSTR; &nbsp; &nbsp; &nbsp; &nbsp; { Original file name (optional) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; lpFileType: Pointer; &nbsp; &nbsp; &nbsp; &nbsp; { Attachment file type (can be lpMapiFileTagExt) }<br>&nbsp; end;<br>&nbsp; TMapiFileDesc = MapiFileDesc;<br><br>const<br>&nbsp; {$EXTERNALSYM MAPI_OLE}<br>&nbsp; MAPI_OLE = $00000001;<br>&nbsp; {$EXTERNALSYM MAPI_OLE_STATIC}<br>&nbsp; MAPI_OLE_STATIC = $00000002;<br><br><br>type<br>&nbsp; PMapiFileTagExt = ^TMapiFileTagExt;<br>&nbsp; {$EXTERNALSYM MapiFileTagExt}<br>&nbsp; MapiFileTagExt = packed record<br>&nbsp; &nbsp; ulReserved: Cardinal; &nbsp; &nbsp; &nbsp; { Reserved, must be zero. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; cbTag: Cardinal; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Size (in bytes) of &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; lpTag: PByte; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { X.400 OID for this attachment type &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; cbEncoding: Cardinal; &nbsp; &nbsp; &nbsp; { Size (in bytes) of &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; lpEncoding: PByte; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ X.400 OID for this attachment's encoding }<br>&nbsp; end;<br>&nbsp; TMapiFileTagExt = MapiFileTagExt;<br><br><br>&nbsp; PMapiRecipDesc = ^TMapiRecipDesc;<br>&nbsp; {$EXTERNALSYM MapiRecipDesc}<br>&nbsp; MapiRecipDesc = packed record<br>&nbsp; &nbsp; ulReserved: Cardinal; &nbsp; &nbsp; &nbsp; { Reserved for future use &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; ulRecipClass: Cardinal; &nbsp; &nbsp; { Recipient class &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { MAPI_TO, MAPI_CC, MAPI_BCC, MAPI_ORIG &nbsp; &nbsp;}<br>&nbsp; &nbsp; lpszName: LPSTR; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Recipient name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; lpszAddress: LPSTR; &nbsp; &nbsp; &nbsp; &nbsp; { Recipient address (optional) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; ulEIDSize: Cardinal; &nbsp; &nbsp; &nbsp; &nbsp;{ Count in bytes of size of pEntryID &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; lpEntryID: Pointer; &nbsp; &nbsp; &nbsp; &nbsp; { System-specific recipient reference &nbsp; &nbsp; &nbsp;}<br>&nbsp; end;<br>&nbsp; TMapiRecipDesc = MapiRecipDesc;<br><br>const<br>&nbsp; {$EXTERNALSYM MAPI_ORIG}<br>&nbsp; MAPI_ORIG = 0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Recipient is message originator &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; {$EXTERNALSYM MAPI_TO}<br>&nbsp; MAPI_TO = 1; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Recipient is a primary recipient &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; {$EXTERNALSYM MAPI_CC}<br>&nbsp; MAPI_CC = 2; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Recipient is a copy recipient &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; {$EXTERNALSYM MAPI_BCC}<br>&nbsp; MAPI_BCC = 3; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Recipient is blind copy recipient &nbsp; &nbsp; &nbsp; &nbsp;}<br><br>type<br>&nbsp; PMapiMessage = ^TMapiMessage;<br>&nbsp; {$EXTERNALSYM MapiMessage}<br>&nbsp; MapiMessage = packed record<br>&nbsp; &nbsp; ulReserved: Cardinal; &nbsp; &nbsp; &nbsp; &nbsp; { Reserved for future use (M.B. 0) &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; lpszSubject: LPSTR; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Message Subject &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; lpszNoteText: LPSTR; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Message Text &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; lpszMessageType: LPSTR; &nbsp; &nbsp; &nbsp; { Message Class &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; lpszDateReceived: LPSTR; &nbsp; &nbsp; &nbsp;{ in YYYY/MM/DD HH:MM format &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; lpszConversationID: LPSTR; &nbsp; &nbsp;{ conversation thread ID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; flFlags: FLAGS; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { unread,return receipt &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; lpOriginator: PMapiRecipDesc; { Originator descriptor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; nRecipCount: Cardinal; &nbsp; &nbsp; &nbsp; &nbsp;{ Number of recipients &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; lpRecips: PMapiRecipDesc; &nbsp; &nbsp; { Recipient descriptors &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; nFileCount: Cardinal; &nbsp; &nbsp; &nbsp; &nbsp; { # of file attachments &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; lpFiles: PMapiFileDesc; &nbsp; &nbsp; &nbsp; { Attachment descriptors &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; end;<br>&nbsp; TMapiMessage = MapiMessage;<br><br>const<br>&nbsp; {$EXTERNALSYM MAPI_UNREAD}<br>&nbsp; MAPI_UNREAD = $00000001;<br>&nbsp; {$EXTERNALSYM MAPI_RECEIPT_REQUESTED}<br>&nbsp; MAPI_RECEIPT_REQUESTED = $00000002;<br>&nbsp; {$EXTERNALSYM MAPI_SENT}<br>&nbsp; MAPI_SENT = $00000004;<br><br><br>{ Entry points. }<br><br>{ flFlags values for Simple MAPI entry points. All documented flags are<br>&nbsp; shown for each call. Duplicates are commented out but remain present<br>&nbsp; for every call. }<br><br>{ MAPILogon() flags. }<br><br>&nbsp; {$EXTERNALSYM MAPI_LOGON_UI}<br>&nbsp; MAPI_LOGON_UI = $00000001; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Display logon UI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; {$EXTERNALSYM MAPI_PASSWORD_UI}<br>&nbsp; MAPI_PASSWORD_UI = $00020000; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { prompt for password only &nbsp; &nbsp; }<br>&nbsp; {$EXTERNALSYM MAPI_NEW_SESSION}<br>&nbsp; MAPI_NEW_SESSION = $00000002; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Don't use shared session &nbsp; &nbsp; }<br>&nbsp; {$EXTERNALSYM MAPI_FORCE_DOWNLOAD}<br>&nbsp; MAPI_FORCE_DOWNLOAD = $00001000; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Get new mail before return &nbsp; }<br>&nbsp; {$EXTERNALSYM MAPI_ALLOW_OTHERS}<br>&nbsp; MAPI_ALLOW_OTHERS = $00000008; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Make this a shared session &nbsp; (removed from 4.0 SDK) }<br>&nbsp; {$EXTERNALSYM MAPI_EXPLICIT_PROFILE}<br>&nbsp; MAPI_EXPLICIT_PROFILE = $00000010; &nbsp; &nbsp; &nbsp; &nbsp;{ Don't use default profile &nbsp; &nbsp;(removed from 4.0 SDK) }<br>&nbsp; {$EXTERNALSYM MAPI_EXTENDED}<br>&nbsp; MAPI_EXTENDED = $00000020; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Extended MAPI Logon &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&nbsp; {$EXTERNALSYM MAPI_USE_DEFAULT}<br>&nbsp; MAPI_USE_DEFAULT = $00000040; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Use default profile in logon (removed from 4.0 SDK) }<br><br>&nbsp; {$EXTERNALSYM MAPI_SIMPLE_DEFAULT}<br>&nbsp; MAPI_SIMPLE_DEFAULT = MAPI_LOGON_UI or MAPI_FORCE_DOWNLOAD or MAPI_ALLOW_OTHERS; { removed from 4.0 SDK }<br>&nbsp; {$EXTERNALSYM MAPI_SIMPLE_EXPLICIT}<br>&nbsp; MAPI_SIMPLE_EXPLICIT = MAPI_NEW_SESSION or MAPI_FORCE_DOWNLOAD or MAPI_EXPLICIT_PROFILE; { removed from 4.0 SDK }<br><br>{ MAPILogoff() flags. &nbsp; &nbsp; &nbsp;}<br><br>&nbsp; {$EXTERNALSYM MAPI_LOGOFF_SHARED}<br>&nbsp; MAPI_LOGOFF_SHARED = $00000001; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Close all shared sessions &nbsp;(removed from 4.0 SDK) &nbsp;}<br>&nbsp; {$EXTERNALSYM MAPI_LOGOFF_UI}<br>&nbsp; MAPI_LOGOFF_UI = $00000002; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { It's OK to present UI &nbsp; &nbsp; &nbsp;(removed from 4.0 SDK) &nbsp;}<br><br>{ MAPISendMail() flags. &nbsp; &nbsp;}<br><br>{ #define MAPI_LOGON_UI &nbsp; &nbsp; &nbsp; &nbsp;0x00000001 &nbsp; &nbsp; Display logon UI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ #define MAPI_NEW_SESSION &nbsp; &nbsp; 0x00000002 &nbsp; &nbsp; Don't use shared session &nbsp; &nbsp; }<br>&nbsp; {$EXTERNALSYM MAPI_DIALOG}<br>&nbsp; MAPI_DIALOG = $00000008; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Display a send note UI &nbsp; &nbsp; &nbsp; }<br>{ # define MAPI_USE_DEFAULT &nbsp; &nbsp; 0x00000040 &nbsp; &nbsp; Use default profile in logon }<br><br>{ MAPIFindNext() flags. &nbsp; &nbsp;}<br><br>&nbsp; {$EXTERNALSYM MAPI_UNREAD_ONLY}<br>&nbsp; MAPI_UNREAD_ONLY = $00000020; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Only unread messages &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; {$EXTERNALSYM MAPI_GUARANTEE_FIFO}<br>&nbsp; MAPI_GUARANTEE_FIFO = $00000100; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ use date order &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; {$EXTERNALSYM MAPI_LONG_MSGID}<br>&nbsp; MAPI_LONG_MSGID = $00004000; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ allow 512 char returned ID &nbsp; }<br><br>{ MAPIReadMail() flags. &nbsp; &nbsp;}<br><br>&nbsp; {$EXTERNALSYM MAPI_PEEK}<br>&nbsp; MAPI_PEEK = $00000080; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ Do not mark as read. &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; {$EXTERNALSYM MAPI_SUPPRESS_ATTACH}<br>&nbsp; MAPI_SUPPRESS_ATTACH = $00000800; &nbsp; &nbsp; &nbsp; &nbsp; { header + body, no files &nbsp; &nbsp; &nbsp;}<br>&nbsp; {$EXTERNALSYM MAPI_ENVELOPE_ONLY}<br>&nbsp; MAPI_ENVELOPE_ONLY = $00000040; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Only header information &nbsp; &nbsp; &nbsp;}<br>&nbsp; {$EXTERNALSYM MAPI_BODY_AS_FILE}<br>&nbsp; MAPI_BODY_AS_FILE = $00000200;<br><br>{ MAPISaveMail() flags. &nbsp; &nbsp;}<br><br>{ #define MAPI_LOGON_UI &nbsp; &nbsp; &nbsp; &nbsp;0x00000001 &nbsp; &nbsp; Display logon UI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ #define MAPI_NEW_SESSION &nbsp; &nbsp; 0x00000002 &nbsp; &nbsp; Don't use shared session &nbsp; &nbsp; }<br>{ #define MAPI_LONG_MSGID &nbsp; &nbsp; &nbsp;0x00004000 &nbsp;/* allow 512 char returned ID &nbsp; }<br><br>{ MAPIAddress() flags. &nbsp; &nbsp; }<br><br>{ #define MAPI_LOGON_UI &nbsp; &nbsp; &nbsp; &nbsp;0x00000001 &nbsp; &nbsp; Display logon UI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ #define MAPI_NEW_SESSION &nbsp; &nbsp; 0x00000002 &nbsp; &nbsp; Don't use shared session &nbsp; &nbsp; }<br><br>{ MAPIDetails() flags. &nbsp; &nbsp; }<br><br>{ #define MAPI_LOGON_UI &nbsp; &nbsp; &nbsp; &nbsp;0x00000001 &nbsp; &nbsp; Display logon UI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ #define MAPI_NEW_SESSION &nbsp; &nbsp; 0x00000002 &nbsp; &nbsp; Don't use shared session &nbsp; &nbsp; }<br>&nbsp; {$EXTERNALSYM MAPI_AB_NOMODIFY}<br>&nbsp; MAPI_AB_NOMODIFY = $00000400; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { Don't allow mods of AB entries }<br><br>{ MAPIResolveName() flags. }<br><br>{ #define MAPI_LOGON_UI &nbsp; &nbsp; &nbsp; &nbsp;0x00000001 &nbsp; &nbsp; Display logon UI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>{ #define MAPI_NEW_SESSION &nbsp; &nbsp; 0x00000002 &nbsp; &nbsp; Don't use shared session &nbsp; &nbsp; }<br>{ #define MAPI_DIALOG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x00000008 &nbsp; &nbsp; Prompt for choices if ambiguous }<br>{ #define MAPI_AB_NOMODIFY &nbsp; &nbsp; 0x00000400 &nbsp; &nbsp; Don't allow mods of AB entries }<br><br>type<br>&nbsp; PFNMapiLogon = ^TFNMapiLogOn;<br>&nbsp; TFNMapiLogOn = function(ulUIParam: Cardinal; lpszProfileName: LPSTR;<br>&nbsp; &nbsp; lpszPassword: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;<br>&nbsp; &nbsp; lplhSession: PLHANDLE): Cardinal stdcall;<br><br>&nbsp; PFNMapiLogOff = ^TFNMapiLogOff;<br>&nbsp; TFNMapiLogOff = function(lhSession: LHANDLE; ulUIParam: Cardinal; flFlags: FLAGS;<br>&nbsp; &nbsp; ulReserved: Cardinal): Cardinal stdcall;<br><br>&nbsp; PFNMapiSendMail = ^TFNMapiSendMail;<br>&nbsp; TFNMapiSendMail = function(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; &nbsp; var lpMessage: TMapiMessage; flFlags: FLAGS;<br>&nbsp; &nbsp; ulReserved: Cardinal): Cardinal stdcall;<br><br>&nbsp; PFNMapiSendDocuments = ^TFNMapiSendDocuments;<br>&nbsp; TFNMapiSendDocuments = function(ulUIParam: Cardinal; lpszDelimChar: LPSTR;<br>&nbsp; &nbsp; lpszFilePaths: LPSTR; lpszFileNames: LPSTR;<br>&nbsp; &nbsp; ulReserved: Cardinal): Cardinal stdcall;<br><br>&nbsp; PFNMapiFindNext = ^TFNMapiFindNext;<br>&nbsp; TFNMapiFindNext = function(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; &nbsp; lpszMessageType: LPSTR; lpszSeedMessageID: LPSTR; flFlags: FLAGS;<br>&nbsp; &nbsp; ulReserved: Cardinal; lpszMessageID: LPSTR): Cardinal stdcall;<br><br>&nbsp; PFNMapiReadMail = ^TFNMapiReadMail;<br>&nbsp; TFNMapiReadMail = function(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; &nbsp; lpszMessageID: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;<br>&nbsp; &nbsp; var lppMessage: PMapiMessage): Cardinal stdcall;<br><br>&nbsp; PFNMapiSaveMail = ^TFNMapiSaveMail;<br>&nbsp; TFNMapiSaveMail = function(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; &nbsp; var lpMessage: TMapiMessage; flFlags: FLAGS; ulReserved: Cardinal;<br>&nbsp; &nbsp; lpszMessageID: LPSTR): Cardinal stdcall;<br><br>&nbsp; PFNMapiDeleteMail = ^TFNMapiDeleteMail;<br>&nbsp; TFNMapiDeleteMail = function(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; &nbsp; lpszMessageID: LPSTR; flFlags: FLAGS;<br>&nbsp; &nbsp; ulReserved: Cardinal): Cardinal stdcall;<br><br>&nbsp; PFNMapiFreeBuffer = ^TFNMapiFreeBuffer;<br>&nbsp; TFNMapiFreeBuffer = function(pv: Pointer): Cardinal stdcall;<br><br>&nbsp; PFNMapiAddress = ^TFNMapiAddress;<br>&nbsp; TFNMapiAddress = function(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; &nbsp; lpszCaption: LPSTR; nEditFields: Cardinal; lpszLabels: LPSTR;<br>&nbsp; &nbsp; nRecips: Cardinal; var lpRecips: TMapiRecipDesc; flFlags: FLAGS;<br>&nbsp; &nbsp; ulReserved: Cardinal; lpnNewRecips: PULONG;<br>&nbsp; &nbsp; var lppNewRecips: PMapiRecipDesc): Cardinal stdcall;<br><br>&nbsp; PFNMapiDetails = ^TFNMapiDetails;<br>&nbsp; TFNMapiDetails = function(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; &nbsp; var lpRecip: TMapiRecipDesc; flFlags: FLAGS;<br>&nbsp; &nbsp; ulReserved: Cardinal): Cardinal stdcall;<br><br>&nbsp; PFNMapiResolveName = ^TFNMapiResolveName;<br>&nbsp; TFNMapiResolveName = function(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; &nbsp; lpszName: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;<br>&nbsp; &nbsp; var lppRecip: PMapiRecipDesc): Cardinal stdcall;<br><br>const<br>&nbsp; {$EXTERNALSYM SUCCESS_SUCCESS}<br>&nbsp; SUCCESS_SUCCESS = 0;<br>&nbsp; {$EXTERNALSYM MAPI_USER_ABORT}<br>&nbsp; MAPI_USER_ABORT = 1;<br>&nbsp; {$EXTERNALSYM MAPI_E_USER_ABORT}<br>&nbsp; MAPI_E_USER_ABORT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= MAPI_USER_ABORT;<br>&nbsp; {$EXTERNALSYM MAPI_E_FAILURE}<br>&nbsp; MAPI_E_FAILURE = 2;<br>&nbsp; {$EXTERNALSYM MAPI_E_LOGON_FAILURE}<br>&nbsp; MAPI_E_LOGON_FAILURE = 3;<br>&nbsp; {$EXTERNALSYM MAPI_E_LOGIN_FAILURE}<br>&nbsp; MAPI_E_LOGIN_FAILURE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = MAPI_E_LOGON_FAILURE;<br>&nbsp; {$EXTERNALSYM MAPI_E_DISK_FULL}<br>&nbsp; MAPI_E_DISK_FULL = 4;<br>&nbsp; {$EXTERNALSYM MAPI_E_INSUFFICIENT_MEMORY}<br>&nbsp; MAPI_E_INSUFFICIENT_MEMORY = 5;<br>&nbsp; {$EXTERNALSYM MAPI_E_ACCESS_DENIED}<br>&nbsp; MAPI_E_ACCESS_DENIED = 6;<br>&nbsp; {$EXTERNALSYM MAPI_E_TOO_MANY_SESSIONS}<br>&nbsp; MAPI_E_TOO_MANY_SESSIONS = 8;<br>&nbsp; {$EXTERNALSYM MAPI_E_TOO_MANY_FILES}<br>&nbsp; MAPI_E_TOO_MANY_FILES = 9;<br>&nbsp; {$EXTERNALSYM MAPI_E_TOO_MANY_RECIPIENTS}<br>&nbsp; MAPI_E_TOO_MANY_RECIPIENTS = 10;<br>&nbsp; {$EXTERNALSYM MAPI_E_ATTACHMENT_NOT_FOUND}<br>&nbsp; MAPI_E_ATTACHMENT_NOT_FOUND = 11;<br>&nbsp; {$EXTERNALSYM MAPI_E_ATTACHMENT_OPEN_FAILURE}<br>&nbsp; MAPI_E_ATTACHMENT_OPEN_FAILURE = 12;<br>&nbsp; {$EXTERNALSYM MAPI_E_ATTACHMENT_WRITE_FAILURE}<br>&nbsp; MAPI_E_ATTACHMENT_WRITE_FAILURE = 13;<br>&nbsp; {$EXTERNALSYM MAPI_E_UNKNOWN_RECIPIENT}<br>&nbsp; MAPI_E_UNKNOWN_RECIPIENT = 14;<br>&nbsp; {$EXTERNALSYM MAPI_E_BAD_RECIPTYPE}<br>&nbsp; MAPI_E_BAD_RECIPTYPE = 15;<br>&nbsp; {$EXTERNALSYM MAPI_E_NO_MESSAGES}<br>&nbsp; MAPI_E_NO_MESSAGES = 16;<br>&nbsp; {$EXTERNALSYM MAPI_E_INVALID_MESSAGE}<br>&nbsp; MAPI_E_INVALID_MESSAGE = 17;<br>&nbsp; {$EXTERNALSYM MAPI_E_TEXT_TOO_LARGE}<br>&nbsp; MAPI_E_TEXT_TOO_LARGE = 18;<br>&nbsp; {$EXTERNALSYM MAPI_E_INVALID_SESSION}<br>&nbsp; MAPI_E_INVALID_SESSION = 19;<br>&nbsp; {$EXTERNALSYM MAPI_E_TYPE_NOT_SUPPORTED}<br>&nbsp; MAPI_E_TYPE_NOT_SUPPORTED = 20;<br>&nbsp; {$EXTERNALSYM MAPI_E_AMBIGUOUS_RECIPIENT}<br>&nbsp; MAPI_E_AMBIGUOUS_RECIPIENT = 21;<br>&nbsp; {$EXTERNALSYM MAPI_E_AMBIG_RECIP}<br>&nbsp; MAPI_E_AMBIG_RECIP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = MAPI_E_AMBIGUOUS_RECIPIENT;<br>&nbsp; {$EXTERNALSYM MAPI_E_MESSAGE_IN_USE}<br>&nbsp; MAPI_E_MESSAGE_IN_USE = 22;<br>&nbsp; {$EXTERNALSYM MAPI_E_NETWORK_FAILURE}<br>&nbsp; MAPI_E_NETWORK_FAILURE = 23;<br>&nbsp; {$EXTERNALSYM MAPI_E_INVALID_EDITFIELDS}<br>&nbsp; MAPI_E_INVALID_EDITFIELDS = 24;<br>&nbsp; {$EXTERNALSYM MAPI_E_INVALID_RECIPS}<br>&nbsp; MAPI_E_INVALID_RECIPS = 25;<br>&nbsp; {$EXTERNALSYM MAPI_E_NOT_SUPPORTED}<br>&nbsp; MAPI_E_NOT_SUPPORTED = 26;<br><br><br>{ Delphi wrapper calls around Simple MAPI }<br><br>function MapiLogOn(ulUIParam: Cardinal; lpszProfileName: LPSTR;<br>&nbsp; lpszPassword: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;<br>&nbsp; lplhSession: PLHANDLE): Cardinal;<br><br>function MapiLogOff(lhSession: LHANDLE; ulUIParam: Cardinal; flFlags: FLAGS;<br>&nbsp; ulReserved: Cardinal): Cardinal;<br><br>function MapiSendMail(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; var lpMessage: TMapiMessage; flFlags: FLAGS; ulReserved: Cardinal): Cardinal;<br><br>function MapiSendDocuments(ulUIParam: Cardinal; lpszDelimChar: LPSTR;<br>&nbsp; lpszFilePaths: LPSTR; lpszFileNames: LPSTR; ulReserved: Cardinal): Cardinal;<br><br>function MapiFindNext(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; lpszMessageType: LPSTR; lpszSeedMessageID: LPSTR; flFlags: FLAGS;<br>&nbsp; ulReserved: Cardinal; lpszMessageID: LPSTR): Cardinal;<br><br>function MapiReadMail(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; lpszMessageID: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;<br>&nbsp; var lppMessage: PMapiMessage): Cardinal;<br><br>function MapiSaveMail(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; var lpMessage: TMapiMessage; flFlags: FLAGS; ulReserved: Cardinal;<br>&nbsp; lpszMessageID: LPSTR): Cardinal;<br><br>function MapiDeleteMail(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; lpszMessageID: LPSTR; flFlags: FLAGS;<br>&nbsp; ulReserved: Cardinal): Cardinal;<br><br>function MapiFreeBuffer(pv: Pointer): Cardinal;<br><br>function MapiAddress(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; lpszCaption: LPSTR; nEditFields: Cardinal; lpszLabels: LPSTR;<br>&nbsp; nRecips: Cardinal; var lpRecips: TMapiRecipDesc; flFlags: FLAGS;<br>&nbsp; ulReserved: Cardinal; lpnNewRecips: PULONG;<br>&nbsp; var lppNewRecips: PMapiRecipDesc): Cardinal;<br><br>function MapiDetails(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; var lpRecip: TMapiRecipDesc; flFlags: FLAGS;<br>&nbsp; ulReserved: Cardinal): Cardinal;<br><br>function MapiResolveName(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; lpszName: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;<br>&nbsp; var lppRecip: PMapiRecipDesc): Cardinal;<br><br>var<br>&nbsp; MAPIDLL: string = 'MAPI32.DLL';<br><br>implementation<br><br>var<br>&nbsp; MAPIModule: HModule = 0;<br>&nbsp; LogOn: TFNMapiLogOn = nil;<br>&nbsp; LogOff: TFNMapiLogOff = nil;<br>&nbsp; SendMail: TFNMapiSendMail = nil;<br>&nbsp; SendDocuments: TFNMapiSendDocuments = nil;<br>&nbsp; FindNext: TFNMapiFindNext = nil;<br>&nbsp; ReadMail: TFNMapiReadMail = nil;<br>&nbsp; SaveMail: TFNMapiSaveMail = nil;<br>&nbsp; DeleteMail: TFNMapiDeleteMail = nil;<br>&nbsp; FreeBuffer: TFNMapiFreeBuffer = nil;<br>&nbsp; Address: TFNMapiAddress = nil;<br>&nbsp; Details: TFNMapiDetails = nil;<br>&nbsp; ResolveName: TFNMapiResolveName = nil;<br><br>var<br>&nbsp; MAPIChecked: Boolean = False;<br><br>procedure InitMapi;<br>var<br>&nbsp; OSVersionInfo: TOSVersionInfo;<br>&nbsp; hkWMS: HKEY;<br>&nbsp; MAPIValueSize: Longint;<br>&nbsp; MAPIValueBuf: array[0..8] of char;<br>&nbsp; rType: Longint;<br>begin<br>&nbsp; if not MAPIChecked then<br>&nbsp; begin<br>&nbsp; &nbsp; MAPIChecked := True;<br>&nbsp; &nbsp; MAPIModule := 0;<br><br>&nbsp; &nbsp; OSVersionInfo.dwOSVersionInfoSize := SizeOf(OSVersionInfo);<br>&nbsp; &nbsp; GetVersionEx(OSVersionInfo);<br>&nbsp; &nbsp; if (OSVersionInfo.dwMajorVersion &gt; 3) or<br>&nbsp; &nbsp; &nbsp; ((OSVersionInfo.dwMajorVersion = 3) and<br>&nbsp; &nbsp; &nbsp; &nbsp;(OSVersionInfo.dwMinorVersion &gt; 51)) then<br>&nbsp; &nbsp; begin<br>&nbsp; &nbsp; &nbsp; MAPIValueSize := sizeof(MAPIValueBuf);<br>&nbsp; &nbsp; &nbsp; if RegOpenKeyEx(HKEY_LOCAL_MACHINE, 'SOFTWARE/Microsoft/Windows Messaging Subsystem',<br>&nbsp; &nbsp; &nbsp; &nbsp; 0, KEY_READ, hkWMS) &lt;&gt; ERROR_SUCCESS then Exit;<br>&nbsp; &nbsp; &nbsp; if RegQueryValueEx(hkWMS, 'MAPI', nil, @rType, @MAPIValueBuf,<br>&nbsp; &nbsp; &nbsp; &nbsp; @MAPIValueSize) &lt;&gt; ERROR_SUCCESS then Exit;<br>&nbsp; &nbsp; &nbsp; RegCloseKey(hkWMS);<br>&nbsp; &nbsp; &nbsp; if not ((MAPIValueBuf[0] = '1') and (MAPIValueBuf[1] = #0)) then Exit;<br>&nbsp; &nbsp; end<br>&nbsp; &nbsp; else if GetProfileInt('Mail', 'MAPI', 0) = 0 then Exit;<br><br>&nbsp; &nbsp; MAPIModule := LoadLibrary(PChar(MAPIDLL));<br>&nbsp; end;<br>end;<br><br>function MapiLogOn(ulUIParam: Cardinal; lpszProfileName: LPSTR;<br>&nbsp; lpszPassword: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;<br>&nbsp; lplhSession: PLHANDLE): Cardinal;<br>begin<br>&nbsp; InitMapi;<br>&nbsp; if @LogOn = nil then<br>&nbsp; &nbsp; @LogOn := GetProcAddress(MAPIModule, 'MAPILogon');<br>&nbsp; if @LogOn &lt;&gt; nil then<br>&nbsp; &nbsp; Result := LogOn(ulUIParam, lpszProfileName, lpszPassword, flFlags,<br>&nbsp; &nbsp; &nbsp; ulReserved, lplhSession)<br>&nbsp; else Result := 1;<br>end;<br><br>function MapiLogOff(lhSession: LHANDLE; ulUIParam: Cardinal; flFlags: FLAGS;<br>&nbsp; ulReserved: Cardinal): Cardinal;<br>begin<br>&nbsp; InitMapi;<br>&nbsp; if @LogOff = nil then<br>&nbsp; &nbsp; @LogOff := GetProcAddress(MAPIModule, 'MAPILogoff');<br>&nbsp; if @LogOff &lt;&gt; nil then<br>&nbsp; &nbsp; Result := LogOff(lhSession, ulUIParam, flFlags, ulReserved)<br>&nbsp; else Result := 1;<br>end;<br><br>function MapiSendMail(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; var lpMessage: TMapiMessage; flFlags: FLAGS; ulReserved: Cardinal): Cardinal;<br>begin<br>&nbsp; InitMapi;<br>&nbsp; if @SendMail = nil then<br>&nbsp; &nbsp; @SendMail := GetProcAddress(MAPIModule, 'MAPISendMail');<br>&nbsp; if @SendMail &lt;&gt; nil then<br>&nbsp; &nbsp; Result := SendMail(lhSession, ulUIParam, lpMessage, flFlags, ulReserved)<br>&nbsp; else Result := 1;<br>end;<br><br>function MapiSendDocuments(ulUIParam: Cardinal; lpszDelimChar: LPSTR;<br>&nbsp; lpszFilePaths: LPSTR; lpszFileNames: LPSTR;<br>&nbsp; ulReserved: Cardinal): Cardinal;<br>begin<br>&nbsp; InitMapi;<br>&nbsp; if @SendDocuments = nil then<br>&nbsp; &nbsp; @SendDocuments := GetProcAddress(MAPIModule, 'MAPISendDocuments');<br>&nbsp; if @SendDocuments &lt;&gt; nil then<br>&nbsp; &nbsp; Result := SendDocuments(ulUIParam, lpszDelimChar, lpszFilePaths,<br>&nbsp; &nbsp; &nbsp; lpszFileNames, ulReserved)<br>&nbsp; else Result := 1;<br>end;<br><br>function MapiFindNext(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; lpszMessageType: LPSTR; lpszSeedMessageID: LPSTR; flFlags: FLAGS;<br>&nbsp; ulReserved: Cardinal; lpszMessageID: LPSTR): Cardinal;<br>begin<br>&nbsp; InitMapi;<br>&nbsp; if @FindNext = nil then<br>&nbsp; &nbsp; @FindNext := GetProcAddress(MAPIModule, 'MAPIFindNext');<br>&nbsp; if @FindNext &lt;&gt; nil then<br>&nbsp; &nbsp; Result := FindNext(lhSession, ulUIParam, lpszMessageType,<br>&nbsp; &nbsp; &nbsp; lpszSeedMessageID, flFlags, ulReserved, lpszMessageID)<br>&nbsp; else Result := 1;<br>end;<br><br>function MapiReadMail(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; lpszMessageID: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;<br>&nbsp; var lppMessage: PMapiMessage): Cardinal;<br>begin<br>&nbsp; InitMapi;<br>&nbsp; if @ReadMail = nil then<br>&nbsp; &nbsp; @ReadMail := GetProcAddress(MAPIModule, 'MAPIReadMail');<br>&nbsp; if @ReadMail &lt;&gt; nil then<br>&nbsp; &nbsp; Result := ReadMail(lhSession, ulUIParam, lpszMessageID, flFlags,<br>&nbsp; &nbsp; &nbsp; ulReserved, lppMessage)<br>&nbsp; else Result := 1;<br>end;<br><br>function MapiSaveMail(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; var lpMessage: TMapiMessage; flFlags: FLAGS; ulReserved: Cardinal;<br>&nbsp; lpszMessageID: LPSTR): Cardinal;<br>begin<br>&nbsp; InitMapi;<br>&nbsp; if @SaveMail = nil then<br>&nbsp; &nbsp; @SaveMail := GetProcAddress(MAPIModule, 'MAPISaveMail');<br>&nbsp; if @SaveMail &lt;&gt; nil then<br>&nbsp; &nbsp; Result := SaveMail(lhSession, ulUIParam, lpMessage, flFlags, ulReserved,<br>&nbsp; &nbsp; &nbsp; lpszMessageID)<br>&nbsp; else Result := 1;<br>end;<br><br>function MapiDeleteMail(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; lpszMessageID: LPSTR; flFlags: FLAGS;<br>&nbsp; ulReserved: Cardinal): Cardinal;<br>begin<br>&nbsp; InitMapi;<br>&nbsp; if @DeleteMail = nil then<br>&nbsp; &nbsp; @DeleteMail := GetProcAddress(MAPIModule, 'MAPIDeleteMail');<br>&nbsp; if @DeleteMail &lt;&gt; nil then<br>&nbsp; &nbsp; Result := DeleteMail(lhSession, ulUIParam, lpszMessageID, flFlags,<br>&nbsp; &nbsp; &nbsp; ulReserved)<br>&nbsp; else Result := 1;<br>end;<br><br>function MapiFreeBuffer(pv: Pointer): Cardinal;<br>begin<br>&nbsp; InitMapi;<br>&nbsp; if @FreeBuffer = nil then<br>&nbsp; &nbsp; @FreeBuffer := GetProcAddress(MAPIModule, 'MAPIFreeBuffer');<br>&nbsp; if @FreeBuffer &lt;&gt; nil then<br>&nbsp; &nbsp; Result := FreeBuffer(pv)<br>&nbsp; else Result := 1;<br>end;<br><br>function MapiAddress(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; lpszCaption: LPSTR; nEditFields: Cardinal; lpszLabels: LPSTR;<br>&nbsp; nRecips: Cardinal; var lpRecips: TMapiRecipDesc; flFlags: FLAGS;<br>&nbsp; ulReserved: Cardinal; lpnNewRecips: PULONG;<br>&nbsp; var lppNewRecips: PMapiRecipDesc): Cardinal;<br>begin<br>&nbsp; InitMapi;<br>&nbsp; if @Address = nil then<br>&nbsp; &nbsp; @Address := GetProcAddress(MAPIModule, 'MAPIAddress');<br>&nbsp; if @Address &lt;&gt; nil then<br>&nbsp; &nbsp; Result := Address(lhSession, ulUIParam, lpszCaption, nEditFields,<br>&nbsp; &nbsp; &nbsp; lpszLabels, nRecips, lpRecips, flFlags, ulReserved, lpnNewRecips,<br>&nbsp; &nbsp; &nbsp; lppNewRecips)<br>&nbsp; else Result := 1;<br>end;<br><br>function MapiDetails(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; var lpRecip: TMapiRecipDesc; flFlags: FLAGS; ulReserved: Cardinal): Cardinal;<br>begin<br>&nbsp; InitMapi;<br>&nbsp; if @Details = nil then<br>&nbsp; &nbsp; @Details := GetProcAddress(MAPIModule, 'MAPIDetails');<br>&nbsp; if @Details &lt;&gt; nil then<br>&nbsp; &nbsp; Result := Details(lhSession, ulUIParam, lpRecip, flFlags, ulReserved)<br>&nbsp; else Result := 1;<br>end;<br><br>function MapiResolveName(lhSession: LHANDLE; ulUIParam: Cardinal;<br>&nbsp; lpszName: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;<br>&nbsp; var lppRecip: PMapiRecipDesc): Cardinal;<br>begin<br>&nbsp; InitMapi;<br>&nbsp; if @ResolveName = nil then<br>&nbsp; &nbsp; @ResolveName := GetProcAddress(MAPIModule, 'MAPIResolveName');<br>&nbsp; if @ResolveName &lt;&gt; nil then<br>&nbsp; &nbsp; Result := ResolveName(lhSession, ulUIParam, lpszName, flFlags,<br>&nbsp; &nbsp; &nbsp; ulReserved, lppRecip)<br>&nbsp; else Result := 1;<br>end;<br><br>initialization<br>finalization<br>&nbsp; if MAPIModule &lt;&gt; 0 then FreeLibrary(MAPIModule);<br>end.<br>
 
太多了,发部上去,请email给我devuser@sina.com
 
《Win95通信编程》:<br>&nbsp; &nbsp;http://my.szptt.net.cn/vcdynasty/download/codes/communi.zip
 
接受答案了.
 
后退
顶部