Unified Email Client API for native languages represented by two lightweight dynamic link libraries LiveKit.dll and LiveKit64.dll, for 32 bit and 64 bit email clients appropriately. All type and interface information can be accessed via type library LiveKit.tlb. These libraries do not require COM registration.
To integrate the API to email clients LiveKit.dll requires activation from an external executable file. Every sample includes a source code of a plug-in loader project. Checkout ButtonsRunner project in the Buttons folder for a working example.
LiveKit.dll exposes two methods StartKit and StopKit. These methods should be called from a loader application to activate and deactivate the API.
StartKit(BSTR pluginPath)
StopKit()
The argument pluginPath is either a full or relative path to a plug-in dll with client logic.
The plug-in dll should export two methods: LoadPlugin and ReleasePlugin:
int __stdcall LoadPlugin(ILkMaster *pMaster)
int __stdcall ReleasePlugin()
LoadPlugin is a starting point. It is called from an email client process during startup. Currently it can be Windows Live Mail 2011, Windows Live Mail XP, Windows Mail or Outlook Express. ReleasePlugin invoked on exiting from an email client.
LoadPlugin passes a pointer to ILkMaster interface. This interface allows subscribing to frame windows creation events, accessing Windows Live Mail store and popup a new email window. It is important to hold this interface pointer during a lifetime of the plug-in.
Optionally a plug-in can export method StoreReady:
int __stdcall StoreReady(ILkStore *pStore)
This callback executes once message store is ready and plug-in can access accounts, folders and messages of an email client.
It is recommended to use one of the samples provided as a template for new plug-ins.
Unified Email Client API uses a concept of frame windows (ILkFrameWindow interface). Every view and window of email client exposes this base interface. This includes a main email client window, compose mail and news, calendar and contacts views. The pointer to this interface passed to a FrameWindowCreate event during window creation.
A frame window type can be identified by a WindowType property.
ILkFrameWindow interface allows adding new toolbars (AddToolbar) or insert buttons and groups to an existing toolbar (SubclassToolbar).
Call AddToolbar to create a new toolbar. Various button types supported, including text and image buttons, check boxes, separators, drop-down buttons, small and large buttons. A toolbar class has a Buttons collection. New buttons must be added to this collection. Drop-down buttons use a Buttons collection for a list of submenu items.
Buttons and toolbars provide event Click to notify a plug-in code about user clicks of toolbar buttons. The event Click of a toolbar includes a button identifier. This identifier should be previously assigned using a button property ButtonId. This identifier is optional if event Click of individual buttons used.
The ILkStore interface exposes functionality to operate with email client accounts, folders and messages. It also exposes events for new email notifications, email sending, folder and message selection changing, new account or folder creation. Review MessageDetails and Filter samples for additional details.
Recent versions of the Email Client API include a support of IMAP and Hotmail account types. These email account types are more complex than POP3 accounts. All operations on these accounts performed asynchronously, thus LkStore class exposes additional completion events, such as CompleteFolderCreate and MessageDownloaded. Please refer HttpImapFolders sample for additional details.
Please do not hesitate to use our community forums or contact us directly for possible questions and comments.