From: Suzan Fine
To: Richard Segal; Tim McCaffrey
Subject: FW: Custom Attachment Handlers
Date: Friday, October 30, 1992 11:21AM



 ----------
From: Peter Durham
To: Suzan Fine
Subject: Custom Attachment Handlers
Date: Wednesday, June 24, 1992 4:28PM

Suzan,

Here's a brain dump on custom attachment handlers (viewer hooks)...  Maybe 
it's time for me to write a document...
This is the custom attachment handler header file: <<File Attachment: CAH.H>>
It uses some definitions from the MAPI header file: <<File
Attachment: MAPI.H>>

Custom attachment handlers are called after Bullet writes out a temporary 
file but before Bullet takes any action to launch an associated application. 
 They are specified in the MSMAIL.INI file with the following syntax:
     [Microsoft Mail]
     CustomAttachmentHandler=FOO.DLL,5
The arguments specified are 1) the path to the DLL, and 2) the ordinal of 
the entry point to be called when an attachment is to be opened.

The structure passed to this entry point is a CustomAttachHandlerDesc, which 
contains a reserved ULONG, a UI ULONG (this is the hwnd of Bullet's main 
window), and a MapiFileDesc which specifies information about the 
attachment.  The entry point can return CAH_PROCEED_WITH_DEFAULT, which 
tells Bullet to go ahead and open the attachment as it usually does, or 
CAH_ACTION_TAKEN, which tells Bullet that the attachment handler has done 
what it wants to and Bullet doesn't need to do anything.

I think this covers most of this; if there are any questions I'm happy to 
answer them.

 - Peter

