home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / mapi / win16 / dev / smpcli / client.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-11  |  5.2 KB  |  193 lines

  1. /*
  2.  -  C L I E N T . H
  3.  -
  4.  *  Purpose:
  5.  *      Header file for the sample mail client based on Simple MAPI.
  6.  *
  7.  *  Copyright 1993-1995 Microsoft Corporation. All Rights Reserved.
  8.  */
  9.  
  10.  
  11. #include "smapi.h"
  12.  
  13. /* Menu Item IDs */
  14.  
  15. #define IDM_LOGON       100
  16. #define IDM_LOGOFF      101
  17. #define IDM_EXIT        102
  18. #define IDM_COMPOSE     103
  19. #define IDM_READ        104
  20. #define IDM_SEND        105
  21. #define IDM_ADDRBOOK    106
  22. #define IDM_DETAILS     107
  23. #define IDM_ABOUT       108
  24.  
  25. /* Resource IDs */
  26.  
  27. #define ICON_NOMAIL     200
  28. #define ICON_MAIL       201
  29. #define IDB_ENVELOPE    300
  30.  
  31.  
  32. /* Address Book Control IDs */
  33.  
  34. #define IDT_ADDRESS     101
  35. #define IDC_ADDRESS     102
  36. #define IDT_LIST        103
  37. #define IDC_LIST        104
  38. #define IDC_ADD         105
  39. #define IDC_REMOVE      106
  40.  
  41.  
  42. /* Compose Note Control IDs */
  43.  
  44. #define IDC_SEND        101
  45. #define IDC_RESOLVE     102
  46. #define IDC_ATTACH      103
  47. #define IDC_OPTIONS     104
  48. #define IDC_ADDRBOOK    105
  49. #define IDT_TO          106
  50. #define IDC_TO          107
  51. #define IDT_CC          108
  52. #define IDC_CC          109
  53. #define IDT_SUBJECT     110
  54. #define IDC_SUBJECT     111
  55. #define IDC_NOTE        112
  56. #define IDC_LINE1       -1
  57. #define IDC_LINE2       -1
  58.  
  59.  
  60. /* InBox Control IDs */
  61.  
  62. #define IDT_MSG         101
  63. #define IDC_MSG         102
  64. #define IDC_NEW         103
  65. #define IDC_READ        104
  66. #define IDC_DELETE      105
  67. #define IDC_CLOSE       106
  68.  
  69.  
  70. /* ReadNote Control IDs */
  71.  
  72. #define IDC_SAVECHANGES 101
  73. #define IDC_SAVEATTACH  102
  74. #define IDC_REPLY       103
  75. #define IDC_REPLYALL    104
  76. #define IDC_FORWARD     105
  77. #define IDT_RFROM       106
  78. #define IDT_RDATE       107
  79. #define IDT_RTO         108
  80. #define IDT_RCC         109
  81. #define IDT_RSUBJECT    110
  82. #define IDC_RFROM       111
  83. #define IDC_RDATE       112
  84. #define IDC_RTO         113
  85. #define IDC_RCC         114
  86. #define IDC_RSUBJECT    115
  87. #define IDC_READNOTE    116
  88. #define IDT_ATTACHMENT  117
  89. #define IDC_ATTACHMENT  118
  90.  
  91.  
  92. /* Options Control IDs */
  93.  
  94. #define IDC_RETURN      101
  95.  
  96.  
  97. /* Details Control IDs */
  98.  
  99. #define IDT_NAME        100
  100. #define IDC_NAME        101
  101. #define IDT_TYPE        102
  102. #define IDC_TYPE        103
  103. #define IDT_ADDR        104
  104. #define IDC_ADDR        105
  105.  
  106. /* About Box Control IDs */
  107.  
  108. #define IDC_VERSION     101
  109.  
  110.  
  111. /* String Table IDs */
  112.  
  113. #define MAPI_ERROR_MAX          30
  114.  
  115. #define IDS_LOGONFAIL           (MAPI_ERROR_MAX + 1)
  116. #define IDS_ADDRBOOKFAIL        (MAPI_ERROR_MAX + 2)
  117. #define IDS_RESOLVEFAIL         (MAPI_ERROR_MAX + 3)
  118. #define IDS_UNRESOLVEDNAMES     (MAPI_ERROR_MAX + 4)
  119. #define IDS_SENDERROR           (MAPI_ERROR_MAX + 5)
  120. #define IDS_DETAILS_TOO_MANY    (MAPI_ERROR_MAX + 6)
  121. #define IDS_DETAILSFAIL         (MAPI_ERROR_MAX + 7)
  122. #define IDS_NORECIPS            (MAPI_ERROR_MAX + 8)
  123. #define IDS_SAVEATTACHERROR     (MAPI_ERROR_MAX + 9)
  124. #define IDS_READFAIL            (MAPI_ERROR_MAX + 10)
  125. #define IDS_DIALOGACTIVE        (MAPI_ERROR_MAX + 11)
  126.  
  127. #define IDS_FILTER              (MAPI_ERROR_MAX + 50)
  128.  
  129. /* Manifest Constants */
  130.  
  131. #define ADDR_MAX            128
  132. #define MAXUSERS            10
  133. #define TO_EDIT_MAX         512
  134. #define CC_EDIT_MAX         512
  135. #define SUBJECT_EDIT_MAX    128
  136. #define NOTE_LINE_MAX       1024
  137. #define FILE_ATTACH_MAX     32
  138.  
  139. /* Message Box styles */
  140.  
  141. #define MBS_ERROR           (MB_ICONSTOP | MB_OK)
  142. #define MBS_INFO            (MB_ICONINFORMATION | MB_OK)
  143. #define MBS_OOPS            (MB_ICONEXCLAMATION | MB_OK)
  144.  
  145. /* Structure Definitions */
  146.  
  147. typedef struct _msgid *LPMSGID;
  148.  
  149. typedef struct _msgid
  150. {
  151.     LPSTR       lpszMsgID;
  152.     BOOL        fHasAttach;
  153.     BOOL        fUnRead;
  154.     LPSTR       lpszFrom;
  155.     LPSTR       lpszSubject;
  156.     LPSTR       lpszDateRec;
  157.     LPMSGID     lpPrev;
  158.     LPMSGID     lpNext;
  159. } MSGID;
  160.  
  161.  
  162.  
  163. /* Function Prototypes */
  164.  
  165. int  PASCAL WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
  166. BOOL InitApplication(HANDLE);
  167. BOOL InitInstance(HANDLE, int);
  168. void DeinitApplication(void);
  169. long FAR PASCAL MainWndProc(HWND, UINT, UINT, LPARAM);
  170. BOOL FAR PASCAL AboutDlgProc(HWND, UINT, UINT, LONG);
  171. BOOL FAR PASCAL ComposeDlgProc(HWND, UINT, UINT, LONG);
  172. BOOL FAR PASCAL InBoxDlgProc(HWND, UINT, UINT, LONG);
  173. BOOL FAR PASCAL ReadMailDlgProc(HWND, UINT, UINT, LONG);
  174. BOOL FAR PASCAL OptionsDlgProc(HWND, UINT, UINT, LONG);
  175. BOOL FAR PASCAL DetailsDlgProc(HWND, UINT, UINT, LONG);
  176. void    MakeMessageBox(HWND, ULONG, UINT, UINT);
  177. ULONG   ResolveFriendlyNames(HWND, LPSTR, ULONG, ULONG *, lpMapiRecipDesc *);
  178. ULONG   CopyRecipient(lpMapiRecipDesc, lpMapiRecipDesc, lpMapiRecipDesc);
  179. ULONG   GetNextFile(HWND, ULONG, ULONG *, lpMapiFileDesc *);
  180. ULONG   CopyAttachment(lpMapiFileDesc, lpMapiFileDesc, lpMapiFileDesc);
  181. BOOL    FNameInList(LPSTR, ULONG, lpMapiRecipDesc);
  182. LPMSGID MakeMsgNode(lpMapiMessage, LPSTR);
  183. LPMSGID FindNode(LPMSGID, LPSTR);
  184. void    InsertMsgNode(LPMSGID, LPMSGID *);
  185. void    DeleteMsgNode(LPMSGID, LPMSGID *);
  186. void    FreeMsgList(LPMSGID);
  187. void    MakeDisplayNameStr(LPSTR, ULONG, ULONG, lpMapiRecipDesc);
  188. ULONG   SaveMsgChanges(HWND, lpMapiMessage, LPSTR);
  189. ULONG   MakeNewMessage(lpMapiMessage, UINT);
  190. void    LogSendMail(ULONG);
  191. void    SaveFileAttachments(HWND, lpMapiFileDesc);
  192. void    ToggleMenuState(HWND, BOOL);   
  193.