mapidefs.pas

来自「Drag files and Drop to delphi forms 0402」· PAS 代码 · 共 2,456 行 · 第 1/5 页

PAS
2,456
字号
{++

  m a p i d e f s . p a s

  Abstract:

    Automatic conversion of mapidefs.h.

  Comments:

    This source file automatically converted by
    htrans 0.91 beta 1 Copyright (c) 1997 Alexander Staubo

  Revision history:

    18-06-1997 20:53 alex  [Autogenerated]
    18-06-1997 20:53 alex  Retouched for release

--}

unit MapiDefs;

{$A+}
{$MINENUMSIZE 4}

interface

uses
  Windows, SysUtils, ActiveX,
  MapiGuid;

(*
 *  M A P I D E F S . H
 *
 *  Definitions used by MAPI clients and service providers.
 *
 *  Copyright 1986-1996 Microsoft Corporation. All Rights Reserved.
 *)

{ Array dimension for structures with variable-sized arrays at the end. }

const
  MAPI_DIM = 1;

const
  MAPI_NT_SERVICE = ULONG($00010000)   { Provider is being loaded in an NT service }
  ;

{ Simple data types }

type
  TWCHAR = Word;
  
{$IFDEF UNICODE}

type
  TTCHAR = TWCHAR;
  
{$ELSE}

type
  TTCHAR = Char;
  
{$ENDIF}

type
  PWSTR = ^TWCHAR;
  
  PCWSTR = ^TWCHAR;

  PTSTR = ^TTCHAR;
  
  PCTSTR = ^TTCHAR;
  
  PBYTE = ^Byte;
  
                                       { defined MIDL_PASS }

type
  PULONG = ^ULONG;

type
  TLHANDLE = Longint;

  PLHANDLE = ^TLHANDLE;

type
  TFILETIME =     
    record
      dwLowDateTime : DWORD;
      dwHighDateTime : DWORD;
    end;
    
  PFILETIME = ^TFILETIME;

(*
 *  This flag is used in many different MAPI calls to signify that
 *  the object opened by the call should be modifiable (MAPI_MODIFY).
 *  If the flag MAPI_MAX_ACCESS is set, the object returned should be
 *  returned at the maximum access level allowed.  An additional
 *  property available on the object (PR_ACCESS_LEVEL) uses the same
 *  MAPI_MODIFY flag to say just what this new access level is.
 *)

const
  MAPI_MODIFY = ULONG($00000001);

(*
 *  The following flags are used to indicate to the client what access
 *  level is permissible in the object. They appear in PR_ACCESS in
 *  message and folder objects as well as in contents and associated
 *  contents tables
 *)

const
  MAPI_ACCESS_MODIFY = ULONG($00000001);
  MAPI_ACCESS_READ = ULONG($00000002);
  MAPI_ACCESS_DELETE = ULONG($00000004);
  MAPI_ACCESS_CREATE_HIERARCHY = ULONG($00000008);
  MAPI_ACCESS_CREATE_CONTENTS = ULONG($00000010);
  MAPI_ACCESS_CREATE_ASSOCIATED = ULONG($00000020);

(*
 *  The MAPI_UNICODE flag is used in many different MAPI calls to signify
 *  that strings passed through the interface are in Unicode (a 16-bit
 *  character set). The default is an 8-bit character set.
 *
 *  The value fMapiUnicode can be used as the 'normal' value for
 *  that bit, given the application's default character set.
 *)

const
  MAPI_UNICODE = ULONG($80000000);

{$IFDEF UNICODE}

const
  fMapiUnicode = MAPI_UNICODE;

{$ELSE}

const
  fMapiUnicode = 0;

{$ENDIF}

{ successful HRESULT }

const
  hrSuccess = 0;

{ Recipient types }

const
  MAPI_ORIG = 0                        { Recipient is message originator          }
  ;
  MAPI_TO = 1                          { Recipient is a primary recipient         }
  ;
  MAPI_CC = 2                          { Recipient is a copy recipient            }
  ;
  MAPI_BCC = 3                         { Recipient is blind copy recipient        }
  ;
  MAPI_P1 = $10000000                  { Recipient is a P1 resend recipient       }
  ;
  MAPI_SUBMITTED = $80000000           { Recipient is already processed         }
  ;

{ #define MAPI_AUTHORIZE 4        recipient is a CMC authorizing user      }

{#define MAPI_DISCRETE 0x10000000 Recipient is a P1 resend recipient       }

{ Bit definitions for abFlags[0] of ENTRYID }

const
  MAPI_SHORTTERM = $80;
  MAPI_NOTRECIP = $40;
  MAPI_THISSESSION = $20;
  MAPI_NOW = $10;
  MAPI_NOTRESERVED = $08;

{ Bit definitions for abFlags[1] of ENTRYID }

const
  MAPI_COMPOUND = $80;

{ ENTRYID }

type
  TENTRYID =     
    record
      abFlags : array[0..4 - 1] of Byte;
      ab : array[0..MAPI_DIM - 1] of Byte;
    end;
    
  PENTRYID = ^TENTRYID;
  
{ Byte-order-independent version of GUID (world-unique identifier) }

type
  TMAPIUID =     
    record
      ab : array[0..16 - 1] of Byte;
    end;
    
  PMAPIUID = ^TMAPIUID;
  
{ Note:  need to include C run-times (memory.h) to use this macro }

(*
 * Constants for one-off entry ID:
 * The MAPIUID that identifies the one-off provider;
 * the flag that defines whether the embedded strings are Unicode;
 * the flag that specifies whether the recipient gets TNEF or not.
 *)

const
  MAPI_ONE_OFF_UID : array[0..15] of Integer =
    (
      $81, $2b, $1f, $a4, $be, $a3, $10, $19, $9d, $6e, $00, $dd, $01, 
      $0f, $54, $02
    );
  MAPI_ONE_OFF_UNICODE = $8000;
  MAPI_ONE_OFF_NO_RICH_INFO = $0001;

{ Object type }

const
  MAPI_STORE = ULONG($00000001)        { Message Store }
  ;
  MAPI_ADDRBOOK = ULONG($00000002)     { Address Book }
  ;
  MAPI_FOLDER = ULONG($00000003)       { Folder }
  ;
  MAPI_ABCONT = ULONG($00000004)       { Address Book Container }
  ;
  MAPI_MESSAGE = ULONG($00000005)      { Message }
  ;
  MAPI_MAILUSER = ULONG($00000006)     { Individual Recipient }
  ;
  MAPI_ATTACH = ULONG($00000007)       { Attachment }
  ;
  MAPI_DISTLIST = ULONG($00000008)     { Distribution List Recipient }
  ;
  MAPI_PROFSECT = ULONG($00000009)     { Profile Section }
  ;
  MAPI_STATUS = ULONG($0000000A)       { Status Object }
  ;
  MAPI_SESSION = ULONG($0000000)       { Session }
  ;
  MAPI_FORMINFO = ULONG($0000000C)     { Form Information }
  ;

(*
 *  Maximum length of profile names and passwords, not including
 *  the null termination character.
 *)

const
  cchProfileNameMax = 64;
  cchProfilePassMax = 64;

{ Property Types }

const
  MV_FLAG = $1000                      { Multi-value flag }
  ;
  PT_UNSPECIFIED = ULONG(0)            { (Reserved for interface use) type doesn't matter to caller }
  ;
  PT_NULL = ULONG(1)                   { NULL property value }
  ;
  PT_I2 = ULONG(2)                     { Signed 16-bit value }
  ;
  PT_LONG = ULONG(3)                   { Signed 32-bit value }
  ;
  PT_R4 = ULONG(4)                     { 4-byte floating point }
  ;
  PT_DOUBLE = ULONG(5)                 { Floating point double }
  ;
  PT_CURRENCY = ULONG(6)               { Signed 64-bit int (decimal w/    4 digits right of decimal pt) }
  ;
  PT_APPTIME = ULONG(7)                { Application time }
  ;
  PT_ERROR = ULONG(10)                 { 32-bit error value }
  ;
  PT_BOOLEAN = ULONG(11)               { 16-bit boolean (non-zero true) }
  ;
  PT_OBJECT = ULONG(13)                { Embedded object in a property }
  ;
  PT_I8 = ULONG(20)                    { 8-byte signed integer }
  ;
  PT_STRING8 = ULONG(30)               { Null terminated 8-bit character string }
  ;
  PT_UNICODE = ULONG(31)               { Null terminated Unicode string }
  ;
  PT_SYSTIME = ULONG(64)               { FILETIME 64-bit int w/ number of 100ns periods since Jan 1,1601 }
  ;
  PT_CLSID = ULONG(72)                 { OLE GUID }
  ;
  PT_BINARY = ULONG(258)               { Uninterpreted (counted byte array) }
  ;

{ Changes are likely to these numbers, and to their structures. }

{ Alternate property type names for ease of use }

const
  PT_SHORT = PT_I2;
  PT_I4 = PT_LONG;
  PT_FLOAT = PT_R4;
  PT_R8 = PT_DOUBLE;
  PT_LONGLONG = PT_I8;

(*
 *  The type of a MAPI-defined string property is indirected, so
 *  that it defaults to Unicode string on a Unicode platform and to
 *  String8 on an ANSI or DBCS platform.
 *
 *  Macros are defined here both for the property type, and for the
 *  field of the property value structure which should be
 *  dereferenced to obtain the string pointer.
 *)

{$IFDEF UNICODE}

const
  PT_TSTRING = PT_UNICODE;
  PT_MV_TSTRING = MV_FLAG or PT_UNICODE;

{$ELSE}

const
  PT_TSTRING = PT_STRING8;
  PT_MV_TSTRING = MV_FLAG or PT_STRING8;

{$ENDIF}

{ Property Tags
 *
 * By convention, MAPI never uses 0 or FFFF as a property ID.
 * Use as null values, initializers, sentinels, or what have you.
 }

const
  PROP_TYPE_MASK = ULONG($0000FFFF)    { Mask for Property type }
  ;

const
  PROP_ID_NULL = 0;
  PROP_ID_INVALID = $FFFF;
  PR_NULL = (PT_NULL) or ((PROP_ID_NULL) shl 16);

{ Multi-valued Property Types }

const
  PT_MV_I2 = MV_FLAG or PT_I2;
  PT_MV_LONG = MV_FLAG or PT_LONG;
  PT_MV_R4 = MV_FLAG or PT_R4;
  PT_MV_DOUBLE = MV_FLAG or PT_DOUBLE;
  PT_MV_CURRENCY = MV_FLAG or PT_CURRENCY;
  PT_MV_APPTIME = MV_FLAG or PT_APPTIME;
  PT_MV_SYSTIME = MV_FLAG or PT_SYSTIME;
  PT_MV_STRING8 = MV_FLAG or PT_STRING8;
  PT_MV_BINARY = MV_FLAG or PT_BINARY;
  PT_MV_UNICODE = MV_FLAG or PT_UNICODE;
  PT_MV_CLSID = MV_FLAG or PT_CLSID;
  PT_MV_I8 = MV_FLAG or PT_I8;

{ Alternate property type names for ease of use }

const
  PT_MV_SHORT = PT_MV_I2;
  PT_MV_I4 = PT_MV_LONG;
  PT_MV_FLOAT = PT_MV_R4;
  PT_MV_R8 = PT_MV_DOUBLE;
  PT_MV_LONGLONG = PT_MV_I8;

(*
 *  Property type reserved bits
 *
 *  MV_INSTANCE is used as a flag in table operations to request
 *  that a multi-valued property be presented as a single-valued
 *  property appearing in multiple rows.
 *)

const
  MV_INSTANCE = $2000;
  MVI_FLAG = MV_FLAG or MV_INSTANCE;

{ --------------- }

{ Data Structures }

{ --------------- }

{ Property Tag Array }

type
  TSPropTagArray =     
    record
      cValues : ULONG;
      aulPropTag : array[0..MAPI_DIM - 1] of ULONG;
    end;
    
  PSPropTagArray = ^TSPropTagArray;
  
{  SPropTagArray }

{ -------------- }

{ Property Value }

{ -------------- }

{ 32-bit CURRENCY definition stolen from oaidl.h }

{ real definition that makes the C++ compiler happy }

type
  TCY =
    record
      case Integer of
        1 :
          (
            _noname1 :               
              record

                {$IFDEF _MAC}
                Hi : Longint;
                Lo : Longint;
                {$ELSE}
                Lo : Longint;
                Hi : Longint;
                {$ENDIF}
                
              end;
            );
        2 : 
          (
            int64 : LONGLONG;
          );
    end;
  
                                       { size is 8 }

type
  TCURRENCY = TCY;
  
  TSBinary =     
    record
      cb : ULONG;
      lpb : PBYTE;
    end;
    
  PSBinary = ^TSBinary;
  
  TSShortArray =     
    record
      cValues : ULONG;
      lpi : ^Smallint;
    end;
    
  TSGuidArray =     
    record
      cValues : ULONG;
      lpguid : ^TGUID;
    end;
    
  TSRealArray =     
    record
      cValues : ULONG;
      lpflt : ^Single;
    end;
    
  TSLongArray =     
    record
      cValues : ULONG;
      lpl : ^Longint;
    end;
    
  TSLargeIntegerArray =     
    record
      cValues : ULONG;
      lpli : ^TLargeInteger;
    end;
    
  TSDateTimeArray =     
    record
      cValues : ULONG;
      lpft : ^TFILETIME;
    end;
    
  TSAppTimeArray =     

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?