' ########################################################################################
' Microsoft Windows
' File: MAPIForm.inc
' Contents: Declarations of interfaces for clients and providers of MAPI forms and form registries.
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_MAPIForm_PBI)
#DEFINE PBX_MAPIForm_PBI
%EQUATE `MAPIFORM_INC = 1
#INCLUDE ONCE "Legacy/System/MAPIX.inc"
'/* HFRMREG is an enumeration which represents a registry container.
' * Microsoft reserves the values from 0 to 0x3FFF for its own use.
' */
'typedef ULONG HFRMREG;
%EQUATE `HFRMREG_DEFAULT = 0
%EQUATE `HFRMREG_LOCAL = 1
%EQUATE `HFRMREG_PERSONAL = 2
%EQUATE `HFRMREG_FOLDER = 3
'typedef const char *FAR * LPPCSTR;
'STDAPI MAPIOpenFormMgr(LPMAPISESSION pSession, LPMAPIFORMMGR * ppmgr);
DECLARE FUNCTION MAPIOpenFormMgr LIB "mapi32.dll" ALIAS "MAPIOpenFormMgr" ( BYVAL pSession AS IMAPISession , BYREF ppmgr AS IMAPIFormMgr ) AS LONG
'STDAPI MAPIOpenLocalFormContainer(LPMAPIFORMCONTAINER * ppfcnt);
DECLARE FUNCTION MAPIOpenLocalFormContainer LIB "mapi32.dll" ALIAS "MAPIOpenLocalFormContainer" ( BYREF ppfcnt AS IMAPIFormContainer ) AS LONG
'/*-- IPersistMessage -------------------------------------------------------*/
'/* This interface is implemented by forms and is used to save,
' * initialize and load forms to and from messages.
' */
' ========================================================================================
' IPersistMessage interface
' $IID_IPersistMessage = GUID$("{0002032A-0000-0000-C000-000000000046}")
' The IPersistMessage interface is used by form viewers to handle the storage of a form
' and to transition between the various states.
' ========================================================================================
INTERFACE IPersistMessage $IID_IPersistMessage
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetClassID ( ' VTable offset = 12
 BYREF lpClassID AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD IsDirty ( ' VTable offset = 16
 ) AS LONG
 ' =====================================================================================
 METHOD InitNew ( ' VTable offset = 20
 BYVAL pMessageSite AS IMAPIMessageSite
 , BYVAL pMessage AS IMessage
 ) AS LONG
 ' =====================================================================================
 METHOD Load ( ' VTable offset = 24
 BYVAL pMessageSite AS IMAPIMessageSite
 , BYVAL pMessage AS IMessage
 , BYVAL ulMessageStatus AS DWORD
 , BYVAL ulMessageFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Save ( ' VTable offset = 28
 BYVAL pMessage AS IMessage
 , BYVAL fSameAsLoad AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveCompleted ( ' VTable offset = 32
 BYVAL pMessage AS IMessage
 ) AS LONG
 ' =====================================================================================
 METHOD HandsOffMessage ( ' VTable offset = 36
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/*-- IMAPIMessageSite ------------------------------------------------------*/
' ========================================================================================
' IMAPIMessageSite interface
' $IID_IMAPIMessageSite = GUID$("{00020370-0000-0000-C000-000000000046}")
' The IMAPIMessageSite interface manipulates messages and is implemented by the form
' viewer code typically a client application that responds to such manipulation.
' ========================================================================================
INTERFACE IMAPIMessageSite $IID_IMAPIMessageSite
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetSession ( ' VTable offset = 12
 BYREF ppSession AS IMAPISession
 ) AS LONG
 ' =====================================================================================
 METHOD GetStore ( ' VTable offset = 16
 BYREF ppStore AS IMsgStore
 ) AS LONG
 ' =====================================================================================
 METHOD GetFolder ( ' VTable offset = 20
 BYREF ppFolder AS IMAPIFolder
 ) AS LONG
 ' =====================================================================================
 METHOD GetMessage ( ' VTable offset = 24
 BYREF ppmsg AS IMessage
 ) AS LONG
 ' =====================================================================================
 METHOD GetFormManager ( ' VTable offset = 28
 BYREF ppFormMgr AS IMAPIFormMgr
 ) AS LONG
 ' =====================================================================================
 METHOD NewMessage ( ' VTable offset = 32
 BYVAL fComposeInFolder AS DWORD
 , BYVAL pFolderFocus AS IMAPIFolder
 , BYVAL pPersistMessage AS IPersistMessage
 , BYREF ppMessage AS IMessage
 , BYREF ppMessageSite AS IMAPIMessageSite
 , BYREF ppViewContext AS IMAPIViewContext
 ) AS LONG
 ' =====================================================================================
 METHOD CopyMessage ( ' VTable offset = 36
 BYVAL pFolderDestination AS IMAPIFolder
 ) AS LONG
 ' =====================================================================================
 METHOD MoveMessage ( ' VTable offset = 40
 BYVAL pFolderDestination AS IMAPIFolder
 , BYVAL pViewContext AS IMAPIViewContext
 , BYREF prcPosRect AS RECT
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteMessage ( ' VTable offset = 44
 BYVAL pViewContext AS IMAPIViewContext
 , BYREF prcPosRect AS RECT
 ) AS LONG
 ' =====================================================================================
 METHOD SaveMessage ( ' VTable offset = 48
 ) AS LONG
 ' =====================================================================================
 METHOD SubmitMessage ( ' VTable offset = 52
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetSiteStatus ( ' VTable offset = 56
 BYREF lpulStatus AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/*-- IMAPIForm -------------------------------------------------------------*/
'/* This interface is implemented by forms for the benefit of viewers.
' * One method (ShutdownForm) is provided such that simple forms implementing
' * only IMAPIForm and IPersistMessage have reasonable embedding behavior.
' */
' ========================================================================================
' IMAPIForm interface
' $IID_IMAPIForm = GUID$("{00020327-0000-0000-C000-000000000046}")
' The IMAPIForm interface is used by form viewers to work with form view contexts and form
' notification, to perform form verbs, and to shut down forms.
' ========================================================================================
INTERFACE IMAPIForm $IID_IMAPIForm
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetViewContext ( ' VTable offset = 12
 BYVAL pViewContext AS IMAPIViewContext
 ) AS LONG
 ' =====================================================================================
 METHOD GetViewContext ( ' VTable offset = 16
 BYREF ppViewContext AS IMAPIViewContext
 ) AS LONG
 ' =====================================================================================
 METHOD ShutdownForm ( ' VTable offset = 20
 BYVAL ulSaveOptions AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DoVerb ( ' VTable offset = 24
 BYVAL iVerb AS LONG
 , BYVAL lpViewContext AS IMAPIViewContext
 , BYVAL hwndParent AS DWORD
 , BYREF lprcPosRect AS RECT
 ) AS LONG
 ' =====================================================================================
 METHOD Advise ( ' VTable offset = 28
 BYVAL pAdvise AS LONG
 , BYREF pdwStatus AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD Unadvise ( ' VTable offset = 32
 BYREF ulConnection AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' SAVEOPTS enum
%EQUATE `SAVEOPTS_SAVEIFDIRTY = 0
%EQUATE `SAVEOPTS_NOSAVE = 1
%EQUATE `SAVEOPTS_PROMPTSAVE = 2
'/*-- IMAPIViewContext ------------------------------------------------------*/
'/* Implemented by viewers to support next/previous in forms.
' */
'/* Structure passed in GetPrintSetup */
' // Size = 20 bytes
TYPE FORMPRINTSETUP DWORD
 ulFlags AS DWORD ' ULONG /* MAPI_UNICODE */
 hDevMode AS DWORD ' HDEVMODE
 hDevNames AS DWORD ' HDEVNAMES
 ulFirstPageNumber AS DWORD ' ULONG
 ulFPrintAttachments AS DWORD ' ULONG
END TYPE
'/* Values for pulFormat in GetSaveStream */
%EQUATE `SAVE_FORMAT_TEXT = 1
%EQUATE `SAVE_FORMAT_RICHTEXT = 2
'/* Values from 0 to 0x3fff are reserved for future definition by Microsoft */
' ========================================================================================
' IMAPIViewContext interface
' $IID_IMAPIViewContext = GUID$("{00020321-0000-0000-C000-000000000046}")
' The IMAPIViewContext interface manages a form in a client application's form viewer.
' ========================================================================================
INTERFACE IMAPIViewContext $IID_IMAPIViewContext
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetAdviseSink ( ' VTable offset = 12
 BYVAL pmvns AS IMAPIFormAdviseSink
 ) AS LONG
 ' =====================================================================================
 METHOD ActivateNext ( ' VTable offset = 16
 BYVAL ulDir AS DWORD
 , BYREF prcPosRect AS RECT
 ) AS LONG
 ' =====================================================================================
 METHOD GetPrintSetup ( ' VTable offset = 20
 BYVAL ulFlags AS DWORD
 , BYREF lppFormPrintSetup AS FORMPRINTSETUP
 ) AS LONG
 ' =====================================================================================
 METHOD GetSaveStream ( ' VTable offset = 24
 BYREF pulFlags AS DWORD
 , BYREF pulFormat AS DWORD
 , BYREF ppstm AS IStream
 ) AS LONG
 ' =====================================================================================
 METHOD GetViewStatus ( ' VTable offset = 28
 BYREF lpulStatus AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
%EQUATE `VCSTATUS_NEXT = &H00000001
%EQUATE `VCSTATUS_PREV = &H00000002
%EQUATE `VCSTATUS_MODAL = &H00000004
%EQUATE `VCSTATUS_INTERACTIVE = &H00000008
%EQUATE `VCSTATUS_READONLY = &H00000010
%EQUATE `VCSTATUS_DELETE = &H00010000
%EQUATE `VCSTATUS_COPY = &H00020000
%EQUATE `VCSTATUS_MOVE = &H00040000
%EQUATE `VCSTATUS_SUBMIT = &H00080000
%EQUATE `VCSTATUS_DELETE_IS_MOVE = &H00100000
%EQUATE `VCSTATUS_SAVE = &H00200000
%EQUATE `VCSTATUS_NEW_MESSAGE = &H00400000
%EQUATE `VCDIR_NEXT = %VCSTATUS_NEXT
%EQUATE `VCDIR_PREV = %VCSTATUS_PREV
%EQUATE `VCDIR_DELETE = %VCSTATUS_DELETE
%EQUATE `VCDIR_MOVE = %VCSTATUS_MOVE
'/*-- IMAPIFormAdviseSink ---------------------------------------------------*/
'/* Part of form server, held by view; receives notifications from the view.
' *
' * This part of the form server, but is not an interface on the form
' * object. This means that clients should not expect to QueryInterface
' * from an IMAPIForm* or IOleObject* to this interface, or vice versa.
' */
' ========================================================================================
' IMAPIFormAdviseSink interface
' $IID_IMAPIViewContext = GUID$("{0002032F-0000-0000-C000-000000000046}")
' Used by form viewers to receive notifications from forms.
' ========================================================================================
INTERFACE IMAPIFormAdviseSink $IID_IMAPIFormAdviseSink
 INHERIT IUnknown
 ' =====================================================================================
 METHOD OnChange ( ' VTable offset = 12
 BYVAL ulDir AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OnActivateNext ( ' VTable offset = 16
 BYREF lpszMessageClass AS ASCIIZ
 , BYVAL ulMessageStatus AS DWORD
 , BYVAL ulMessageFlags AS DWORD
 , BYREF ppPersistMessage AS IPersistMessage
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/*-- IMAPIViewAdviseSink ---------------------------------------------------*/
'/* Part of view context, held by form; receives notifications from the form.
' */
' ========================================================================================
' IMAPIViewAdviseSink interface
' $IID_IMAPIViewAdviseSink = GUID$("{0002032B-0000-0000-C000-000000000046}")
' Used by form viewers to receive notifications from forms.
' ========================================================================================
INTERFACE IMAPIViewAdviseSink $IID_IMAPIViewAdviseSink
 INHERIT IUnknown
 ' =====================================================================================
 METHOD OnShutdown ( ' VTable offset = 12
 ) AS LONG
 ' =====================================================================================
 METHOD OnNewMessage ( ' VTable offset = 16
 ) AS LONG
 ' =====================================================================================
 METHOD OnPrint ( ' VTable offset = 20
 BYVAL dwPageNumber AS DWORD
 , BYVAL hrStatus AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD OnSubmitted ( ' VTable offset = 24
 ) AS LONG
 ' =====================================================================================
 METHOD OnSaved ( ' VTable offset = 28
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/*-- IMAPIFormInfo ---------------------------------------------------------*/
'/* Is implemented by registries. Describes the form.
' */
'/* Single enum value */
' // Size = 8 bytes
TYPE SMAPIFormPropEnumVal DWORD ' /* fpev */
 pszDisplayName AS ASCIIZ PTR ' LPTSTR /* carries the display string */
 nVal AS DWORD ' ULONG /* the value for the above enumeration */
END TYPE
'/* MAPI Form property descriptor */
'/*
' * Values for the tag in the SMAPIFormProp structure
' *
' * Microsoft reserves the range from 0 to 0x3FFF for future use in its other
' * forms registry implementations.
' */
'typedef ULONG FORMPROPSPECIALTYPE;
%EQUATE `FPST_VANILLA = 0
%EQUATE `FPST_ENUM_PROP = 1
'typedef struct
'{
' ULONG ulFlags; /* Contains MAPI_UNICODE if strings are UNICODE */
' ULONG nPropType; /* type of the property, hiword is 0 */
' MAPINAMEID nmid; /* id of the property */
' LPTSTR pszDisplayName;
' FORMPROPSPECIALTYPE nSpecialType; /* tag for the following union */
' union
' {
' struct
' {
' MAPINAMEID nmidIdx;
' ULONG cfpevAvailable; /* # of enums */
' LPMAPIFORMPROPENUMVAL pfpevAvailable;
' } s1; /* Property String/Number association Enumeration */
' } u;
'} SMAPIFormProp, * LPMAPIFORMPROP;
' // Size = 20 bytes
TYPE SMAPIFormProp_s1 DWORD
 nmidIdx AS MAPINAMEID ' MAPINAMEID
 cfpevAvailable AS DWORD ' ULONG
 pfpevAvailable AS DWORD
END TYPE
' // Size = 48 bytes
TYPE SMAPIFormProp DWORD
 ulFlags AS DWORD ' ULONG
 nPropType AS DWORD ' ULONH
 nmid AS MAPINAMEID ' MAPINAMEID
 pszDisplayName AS ASCIIZ PTR
 nSpecialType AS DWORD ' FORMPROPSPECIALTYPE
 SMAPIFormProp_s1
END TYPE
'/* Array of form properties */
' // Size = 56 bytes
TYPE SMAPIFormPropArray DWORD
 cProps AS DWORD ' ULONG
 ulPad AS DWORD ' ULONG /* Pad to 8-byte alignment for insurance */
 aFormProp(%MAPI_DIM - 1) AS SMAPIFormProp ' SMAPIFormProp [variable-length array]
END TYPE
'/* Structure defining the layout of an mapi verb description */
' // Size = 20 bytes
TYPE SMAPIVerb DWORD
 lVerb AS DWORD ' ULONG
 szVerbname AS ASCIIZ PTR
 fuFlags AS DWORD
 grfAttribs AS DWORD
 ulFlags AS DWORD ' ULONG /* Either 0 or MAPI_UNICODE */
END TYPE
'/* Structure used for returning arrays of mapi verbs */
' // Size = 24 bytes
TYPE SMAPIVerbArray DWORD
 cMAPIVerb AS DWORD ' ULONG /* Number of verbs in the structure */
 aMAPIVerb(%MAPI_DIM - 1) AS SMAPIVerb ' SMAPIVerb [variable-length array]
END TYPE
' ========================================================================================
' IMAPIFormInfo interface (inherits from IMAPIProp)
' $IID_IMAPIFormInfo = GUID$("{00020324-0000-0000-C000-000000000046}")
' The IMAPIFormInfo interface gives client applications access to useful properties
' particular to form definition. By keeping form information in a separate object, the
' form library provider can describe a form to a client without activating the form.
' ========================================================================================
INTERFACE IMAPIFormInfo $IID_IMAPIFormInfo
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetLastError ( ' VTable offser = 12
 BYVAL hResult AS LONG
 , BYVAL ulFlags AS DWORD
 , BYREF lppMAPIError AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveChanges ( ' VTable offser = 16
 BYVAL ulFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetProps ( ' VTable offser = 20
 BYVAL lpPropTagArray AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lpcValues AS DWORD
 , BYREF lppPropArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetPropList ( ' VTable offser = 24
 BYVAL ulFlags AS DWORD
 , BYREF lppPropTagArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD OpenProperty ( ' VTable offser = 28
 BYVAL ulPropTag AS DWORD
 , BYREF lpiid AS GUID
 , BYVAL ulInterfaceOptions AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppUnk AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetProps ( ' VTable offser = 32
 BYVAL cValues AS DWORD
 , BYVAL lpPropArray AS SPropValue PTR
 , BYVAL LPSPropProblemArray AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD DeleteProps ( ' VTable offser = 36
 BYVAL lpPropTagArray AS SPropTagArray PTR
 , BYVAL LPSPropProblemArray AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD CopyTo ( ' VTable offser = 40
 BYVAL ciidExclude AS DWORD
 , BYREF rgiidExclude AS GUID
 , BYVAL lpExcludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CopyProps ( ' VTable offser = 44
 BYVAL lpIncludeProps AS SPropTagArray PTR
 , BYVAL ulUIParam AS DWORD
 , BYVAL lpProgress AS IMAPIProgress
 , BYREF lpInterface AS GUID
 , BYVAL lpDestObj AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL lppProblems AS SPropProblemArray PTR
 ) AS LONG
 ' =====================================================================================
 METHOD GetNamesFromIDs ( ' VTable offser = 48
 BYVAL lppPropTags AS SPropTagArray PTR
 , BYREF lpPropSetGuid AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lpcPropNames AS DWORD
 , BYREF lpppPropNames AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetIDsFromNames ( ' VTable offser = 52
 BYVAL cPropNames AS DWORD
 , BYVAL lppPropNames AS MAPINAMEID PTR
 , BYVAL ulFlags AS DWORD
 , BYREF lppPropTags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CalcFormPropSet ( ' VTable offser = 56
 BYVAL ulFlags AS DWORD
 , BYREF ppFormPropArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CalcVerbSet ( ' VTable offser = 60
 BYVAL ulFlags AS DWORD
 , BYREF ppMAPIVerbArray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD MakeIconFromBinary ( ' VTable offser = 64
 BYVAL nPropID AS DWORD
 , BYREF phicon AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SaveForm ( ' VTable offser = 68
 BYREF szFileName AS ASCIIZ
 ) AS LONG
 ' =====================================================================================
 METHOD OpenFormContainer ( ' VTable offser = 72
 BYREF ppformcontainer AS IMAPIFormContainer
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* Enumeration of permissible values for PR_FORM_MESSAGE_BEHAVIOR */
%EQUATE `MAPI_MESSAGE_BEHAVIOR_IPM = 0
%EQUATE `MAPI_MESSAGE_BEHAVIOR_FOLDER = 1
'/*-- IMAPIFormMgr ----------------------------------------------------------*/
'/* The client-visible interface for form resolution and dispatch.
' */
'/* Structure containing an array of message class strings */
' // Size = 8 bytes
TYPE SMessageClassArray DWORD
 cValues AS DWORD ' ULONG
 aMessageClass(%MAPI_DIM - 1) AS ASCIIZ PTR ' LPCSTR [variable-length array]
END TYPE
'/* Structure containing an array of IMAPIFormInfo interfaces */
' // Size = 8 bytes
TYPE SMAPIFormInfoArray DWORD
 cValues AS DWORD ' ULONG
 aFormInfo(%MAPI_DIM - 1) AS DWORD ' LPMAPIFORMINFO [variable-length array]
END TYPE
'/* Flags for IMAPIFormMgr::SelectFormContainer */
%EQUATE `MAPIFORM_SELECT_ALL_REGISTRIES = 0
%EQUATE `MAPIFORM_SELECT_FOLDER_REGISTRY_ONLY = 1
%EQUATE `MAPIFORM_SELECT_NON_FOLDER_REGISTRY_ONLY = 2
'/* Flags for IMAPIFormMgr::CalcFormPropSet */
%EQUATE `FORMPROPSET_UNION = 0
%EQUATE `FORMPROPSET_INTERSECTION = 1
'/* Flags for IMAPIFormMgr::ResolveMessageClass and
' IMAPIFormMgr::ResolveMultipleMessageClasses */
%EQUATE `MAPIFORM_EXACTMATCH = &H0020
' ========================================================================================
' IMAPIFormMgr interface
' $IID_IMAPIFormMgr = GUID$("{00020322-0000-0000-C000-000000000046}")
' The IMAPIFormMgr interface is used by form viewers to get information about and activate
' form servers.
' ========================================================================================
INTERFACE IMAPIFormMgr $IID_IMAPIFormMgr
 INHERIT IUnknown
 ' =====================================================================================
 METHOD LoadForm ( ' VTable offset = 12
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lpszMessageClass AS ASCIIZ
 , BYVAL ulMessageStatus AS DWORD
 , BYVAL ulMessageFlags AS DWORD
 , BYVAL pFolderFocus AS IMAPIFolder
 , BYVAL pMessageSite AS IMAPIMessageSite
 , BYVAL pmsg AS IMessage
 , BYVAL pViewContext AS IMAPIViewContext
 , BYREF riid AS GUID
 , BYREF ppvObj AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD ResolveMessageClass ( ' VTable offset = 16
 BYREF szMsgClass AS ASCIIZ
 , BYVAL ulFlags AS DWORD
 , BYVAL pFolderFocus AS IMAPIFolder
 , BYREF ppResult AS IMAPIFormInfo
 ) AS LONG
 ' =====================================================================================
 METHOD ResolveMultipleMessageClasses ( ' VTable offset = 20
 BYVAL pMsgClasses AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL pFolderFocus AS IMAPIFolder
 , BYREF pfrminfoarray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CalcFormPropSet ( ' VTable offset = 24
 BYVAL pfrminfoarray AS SMAPIFormInfoArray PTR
 , BYVAL ulFlags AS DWORD
 , BYREF ppResults AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CreateForm ( ' VTable offset = 28
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL pfrminfoToActivate AS IMAPIFormInfo
 , BYREF refiidToAsk AS GUID
 , BYREF ppvObj AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SelectForm ( ' VTable offset = 32
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF pszTitle AS ASCIIZ
 , BYVAL pfld AS IMAPIFolder
 , BYREF ppfrminfoReturned AS IMAPIFormInfo
 ) AS LONG
 ' =====================================================================================
 METHOD SelectMultipleForms ( ' VTable offset = 36
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF pszTitle AS ASCIIZ
 , BYVAL pfld AS IMAPIFolder
 , BYVAL pfrminfoarray AS SMAPIFormInfoArray PTR
 , BYREF ppfrminfoarray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SelectFormContainer ( ' VTable offset = 40
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF lppfcnt AS IMAPIFormContainer
 ) AS LONG
 ' =====================================================================================
 METHOD OpenFormContainer ( ' VTable offset = 44
 BYVAL hfrmreg AS DWORD
 , BYVAL lpunk AS IUnknown
 , BYREF lppfcnt AS IMAPIFormContainer
 ) AS LONG
 ' =====================================================================================
 METHOD PrepareForm ( ' VTable offset = 48
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYVAL pfrminfo AS IMAPIFormInfo
 ) AS LONG
 ' =====================================================================================
 METHOD IsInConflict ( ' VTable offset = 52
 BYVAL ulMessageFlags AS DWORD
 , BYVAL ulMessageStatus AS DWORD
 , BYREF szMessageClass AS ASCIIZ
 , BYVAL pFolderFocus AS IMAPIFolder
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/* Platform numbers (used in .CFG files for forms) */
%EQUATE `MAPIFORM_CPU_X86 = 1
%EQUATE `MAPIFORM_CPU_MIP = 2
%EQUATE `MAPIFORM_CPU_AXP = 3
%EQUATE `MAPIFORM_CPU_PPC = 4
%EQUATE `MAPIFORM_CPU_M68 = 5
%EQUATE `MAPIFORM_OS_WIN_31 = 1
%EQUATE `MAPIFORM_OS_WINNT_35 = 2
%EQUATE `MAPIFORM_OS_WIN_95 = 3
%EQUATE `MAPIFORM_OS_MAC_7x = 4
%EQUATE `MAPIFORM_OS_WINNT_40 = 5
'#define MAPIFORM_PLATFORM(CPU, OS) ((ULONG) ((((ULONG) CPU) << 16) | OS))
FUNCTION MAPIFORM_PLATFORM (BYVAL CPU AS DWORD, BYVAL OS AS DWORD) AS DWORD
 SHIFT LEFT CPU, 16
 FUNCTION = CPU OR OS
END FUNCTION
'/*-- IMAPIFormContainer -------------------------------------------------*/
'/* Flags for IMAPIFormMgr::CalcFormPropSet */
'/* #define FORMPROPSET_UNION 0 */
'/* #define FORMPROPSET_INTERSECTION 1 */
'/* Flags for IMAPIFormMgr::InstallForm */
%EQUATE `MAPIFORM_INSTALL_DIALOG = %MAPI_DIALOG
%EQUATE `MAPIFORM_INSTALL_OVERWRITEONCONFLICT = &H0010
'/* Flags for IMAPIFormContainer::ResolveMessageClass and
' IMAPIFormContainer::ResolveMultipleMessageClasses */
'/* #define MAPIFORM_EXACTIMATCH 0x0020 */
' ========================================================================================
' IMAPIFormContainer interface
' $IID_IMAPIFormContainer = GUID$("{0002032E-0000-0000-C000-000000000046}")
' The IMAPIFormContainer interface manages forms within form libraries. This interface is
' used to create application-specific form libraries.
' ========================================================================================
INTERFACE IMAPIFormContainer $IID_IMAPIFormContainer
 INHERIT IUnknown
 ' =====================================================================================
 METHOD InstallForm ( ' VTable offset = 12
 BYVAL ulUIParam AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF szCfgPathName AS ASCIIZ
 ) AS LONG
 ' =====================================================================================
 METHOD RemoveForm ( ' VTable offset = 16
 BYREF szMessageClass AS ASCIIZ
 ) AS LONG
 ' =====================================================================================
 METHOD ResolveMessageClass ( ' VTable offset = 20
 BYREF szMessageClass AS ASCIIZ
 , BYVAL ulFlags AS DWORD
 , BYREF pforminfo AS IMAPIFormInfo
 ) AS LONG
 ' =====================================================================================
 METHOD ResolveMultipleMessageClasses ( ' VTable offset = 24
 BYVAL pMsgClassArray AS DWORD
 , BYVAL ulFlags AS DWORD
 , BYREF ppfrminfoarray AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD CalcFormPropSet ( ' VTable offset = 28
 BYVAL ulFlags AS DWORD
 , BYREF ppResults AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetDisplay ( ' VTable offset = 32
 BYVAL ulFlags AS DWORD
 , BYREF pszDisplayName AS ASCIIZ
 ) AS LONG
 ' =====================================================================================
END INTERFACE
'/*-- IMAPIFormFactory ------------------------------------------------------*/
' ========================================================================================
' IMAPIFormFactory interface
' $IID_IMAPIFormFactory = GUID$("{00020350-0000-0000-C000-000000000046}")
' The IMAPIFormFactory interface supports the use of configurable run-time forms in
' distributed computing environments.
' ========================================================================================
INTERFACE IMAPIFormFactory $IID_IMAPIFormFactory
 INHERIT IUnknown
 ' =====================================================================================
 METHOD CreateClassFactory ( ' VTable offset = 12
 BYREF clsidForm AS GUID
 , BYVAL ulFlags AS DWORD
 , BYREF lppClassFactory AS IClassFactory
 ) AS LONG
 ' =====================================================================================
 METHOD LockServer ( ' VTable offset = 16
 BYVAL ulFlags AS DWORD
 , BYVAL fLockServer AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF
