text: ///////////////////////////////////////////////////////////////////////////
  // Becky! API header file
  //
  // You can modify and redistribute this file without any permission.
  
  #ifndef _BECKY_API
  #define _BECKY_API
  
  #include <Windows.h>
  
  #define BKC_MENU_MAIN		0
  #define BKC_MENU_LISTVIEW	1
  #define BKC_MENU_TREEVIEW	2
  #define BKC_MENU_MSGVIEW	3
  #define BKC_MENU_MSGEDIT	4
  #define BKC_MENU_TASKTRAY	5
  #define BKC_MENU_COMPOSE	10
  #define BKC_MENU_COMPEDIT	11
  #define BKC_MENU_COMPREF	12
  
  #define BKC_BITMAP_ADDRESSBOOKICON	1
  #define BKC_BITMAP_ADDRESSPERSON	2
  #define BKC_BITMAP_ANIMATION		3
  #define BKC_BITMAP_FOLDERCOLOR		4
  #define BKC_BITMAP_FOLDERICON		5
  #define BKC_BITMAP_LISTICON			6
  #define BKC_BITMAP_PRIORITYSTAMP	7
  #define BKC_BITMAP_RULETREEICON		8
  #define BKC_BITMAP_TEMPLATEFOLDER	9
  #define BKC_BITMAP_WHATSNEWLIST		10
  #define BKC_BITMAP_LISTICON2		11
  #define BKC_BITMAP_AGENTS			12
  
  #define BKC_ICON_ADDRESSBOOK		101
  #define BKC_ICON_ANIMATION1_SMALL	102
  #define BKC_ICON_ANIMATION2_SMALL	103
  #define	BKC_ICON_COMPOSEFRAME		104
  #define BKC_ICON_MAINFRAME			105
  #define BKC_ICON_NEWARRIVAL1_SMALL	106		
  #define BKC_ICON_NEWARRIVAL2_SMALL	107
  
  #define BKC_TOOLBAR_ADDRESSBOOK		201
  #define BKC_TOOLBAR_COMPOSEFRAME	202
  #define BKC_TOOLBAR_HTMLEDITOR		203
  #define BKC_TOOLBAR_MAINFRAME		204
  
  #define BKC_ONSEND_ERROR	-1
  #define BKC_ONSEND_PROCESSED	-2
  
  #define BKC_FILTER_DEFAULT	0
  #define BKC_FILTER_PASS		1
  #define BKC_FILTER_DONE		2
  #define BKC_FILTER_NEXT		3
  
  #define ACTION_NOTHING		-1
  #define ACTION_MOVEFOLDER	0
  #define ACTION_COLORLABEL	1
  #define ACTION_SETFLAG		2
  #define ACTION_SOUND		3
  #define ACTION_RUNEXE		4
  #define ACTION_REPLY		5
  #define ACTION_FORWARD		6
  #define ACTION_LEAVESERVER	7
  #define ACTION_ADDHEADER	8
  
  #define MESSAGE_READ		 0x00000001
  #define MESSAGE_FORWARDED	 0x00000002
  #define MESSAGE_REPLIED		 0x00000004
  #define MESSAGE_ATTACHMENT	 0x00000008
  #define MESSAGE_PARTIAL		 0x00000100 
  #define MESSAGE_REDIRECT	 0x00000200
  
  #define COMPOSE_MODE_COMPOSE1	0
  #define COMPOSE_MODE_COMPOSE2	1
  #define COMPOSE_MODE_COMPOSE3	2
  #define COMPOSE_MODE_TEMPLATE	3
  #define COMPOSE_MODE_REPLY1		5
  #define COMPOSE_MODE_REPLY2		6
  #define COMPOSE_MODE_REPLY3		7
  #define COMPOSE_MODE_FORWARD1	10
  #define COMPOSE_MODE_FORWARD2	11
  #define COMPOSE_MODE_FORWARD3	12
  
  #define BKMENU_CMDUI_DISABLED		1
  #define BKMENU_CMDUI_CHECKED		2
  
  class CBeckyAPI
  {
  public:
      CBeckyAPI()
      {
          m_hInstBecky = NULL;
      }
      ~CBeckyAPI()
      {
          if (m_hInstBecky) {
              //::FreeLibrary(m_hInstBecky);
          }
      }
      BOOL InitAPI();
  
      LPCSTR(WINAPI* GetVersion)();
      void    (WINAPI* Command)(HWND hWnd, LPCSTR lpCmd);
      BOOL(WINAPI* GetWindowHandles)(HWND* lphMain, HWND* lphTree, HWND* lphList, HWND* lphView);
      UINT(WINAPI* RegisterCommand)(LPCSTR lpszComment, int nTarget, void (CALLBACK* lpCallback)(HWND, LPARAM));
      UINT(WINAPI* RegisterUICallback)(UINT nID, UINT(CALLBACK* lpCallback)(HWND, LPARAM));
      LPCSTR(WINAPI* GetDataFolder)();
      LPCSTR(WINAPI* GetTempFolder)();
      LPCSTR(WINAPI* GetTempFileName)(LPCSTR lpType);
      LPCSTR(WINAPI* GetCurrentMailBox)();
      void	(WINAPI* SetCurrentMailBox)(LPCSTR lpMailBox);
      LPCSTR(WINAPI* GetCurrentFolder)();
      void	(WINAPI* SetCurrentFolder)(LPCSTR lpFolderID);
      LPCSTR(WINAPI* GetFolderDisplayName)(LPCSTR lpFolderID);
      void	(WINAPI* SetMessageText)(HWND hWnd, LPCSTR lpszMsg);
      LPCSTR(WINAPI* GetCurrentMail)();
      void	(WINAPI* SetCurrentMail)(LPCSTR lpMailID);
      int		(WINAPI* GetNextMail)(int nStart, LPSTR lpszMailID, int nBuf, BOOL bSelected);
      void	(WINAPI* SetSel)(LPCSTR lpMailID, BOOL bSel);
      BOOL(WINAPI* AppendMessage)(LPCSTR lpFolderID, LPCSTR lpszData);
      int		(WINAPI* MoveMessages)(LPCSTR lpFolderID, LPCSTR lpMailIDSet, BOOL bCopy);
      BOOL(WINAPI* MoveSelectedMessages)(LPCSTR lpFolderID, BOOL bCopy);
      DWORD(WINAPI* GetStatus)(LPCSTR lpMailID);
      DWORD(WINAPI* SetStatus)(LPCSTR lpMailID, DWORD dwSet, DWORD dwReset);
      HWND(WINAPI* ComposeMail)(LPCSTR lpURL);
      int		(WINAPI* GetCharSet)(LPCSTR lpMailID, LPSTR lpszCharSet, int nBuf);
      LPSTR(WINAPI* GetSource)(LPCSTR lpMailID);
      void	(WINAPI* SetSource)(LPCSTR lpMailID, LPCSTR lpSource);
      DWORD(WINAPI* GetSize)(LPCSTR lpMailID);
      LPSTR(WINAPI* GetHeader)(LPCSTR lpMailID);
      LPSTR(WINAPI* GetText)(LPSTR lpszMimeType, int nBuf);
      void	(WINAPI* SetText)(int nMode, LPCSTR lpText);
      void	(WINAPI* GetSpecifiedHeader)(LPCSTR lpHeader, LPSTR lpszData, int nBuf);
      void	(WINAPI* SetSpecifiedHeader)(LPCSTR lpHeader, LPCSTR lpszData);
      int		(WINAPI* CompGetCharSet)(HWND hWnd, LPSTR lpszCharSet, int nBuf);
      LPSTR(WINAPI* CompGetSource)(HWND hWnd);
      void	(WINAPI* CompSetSource)(HWND hWnd, LPCSTR lpSource);
      LPSTR(WINAPI* CompGetHeader)(HWND hWnd);
      void	(WINAPI* CompGetSpecifiedHeader)(HWND hWnd, LPCSTR lpHeader, LPSTR lpszData, int nBuf);
      void	(WINAPI* CompSetSpecifiedHeader)(HWND hWnd, LPCSTR lpHeader, LPCSTR lpszData);
      LPSTR(WINAPI* CompGetText)(HWND hWnd, LPSTR lpszMimeType, int nBuf);
      void	(WINAPI* CompSetText)(HWND hWnd, int nMode, LPCSTR lpText);
      void	(WINAPI* CompAttachFile)(HWND hWnd, LPCSTR lpAttachFile, LPCSTR lpMimeType);
      LPVOID(WINAPI* Alloc)(DWORD dwSize);
      LPVOID(WINAPI* ReAlloc)(LPVOID lpVoid, DWORD dwSize);
      void	(WINAPI* Free)(LPVOID lpVoid);
      LPSTR(WINAPI* ISO_2022_JP)(LPCSTR lpSrc, BOOL bEncode);
      LPSTR(WINAPI* ISO_2022_KR)(LPCSTR lpSrc, BOOL bEncode);
      LPSTR(WINAPI* HZ_GB2312)(LPCSTR lpSrc, BOOL bEncode);
      LPSTR(WINAPI* ISO_8859_2)(LPCSTR lpSrc, BOOL bEncode);
      LPSTR(WINAPI* EUC_JP)(LPCSTR lpSrc, BOOL bEncode);
      LPSTR(WINAPI* UTF_7)(LPCSTR lpSrc, BOOL bEncode);
      LPSTR(WINAPI* UTF_8)(LPCSTR lpSrc, BOOL bEncode);
      BOOL(WINAPI* B64Convert)(LPCSTR lpszOutFile, LPCSTR lpszInFile, BOOL bEncode);
      BOOL(WINAPI* QPConvert)(LPCSTR lpszOutFile, LPCSTR lpszInFile, BOOL bEncode);
      LPSTR(WINAPI* MIMEHeader)(LPCSTR lpszIn, LPSTR lpszCharSet, int nBuf, BOOL bEncode);
      LPSTR(WINAPI* SerializeRcpts)(LPCSTR lpAddresses);
      BOOL(WINAPI* Connect)(BOOL bConnect);
      BOOL(WINAPI* NextUnread)(BOOL bBackScroll, BOOL bGoNext);
      void	(WINAPI* ProcessMail)(LPCSTR lpMailID, int nAction, LPCSTR lpParam);
  protected:
      HINSTANCE m_hInstBecky;
  };
  
  #endif