home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / dbmsg / mapi / simple.cli / client.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-11  |  5.3 KB  |  197 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_CATTACHMENT 113
  57. #define IDT_CATTACHMENT 114
  58. #define IDC_LINE1       -1
  59. #define IDC_LINE2       -1
  60.  
  61.  
  62. /* InBox Control IDs */
  63.  
  64. #define IDT_MSG         101
  65. #define IDC_MSG         102
  66. #define IDC_NEW         103
  67. #define IDC_READ        104
  68. #define IDC_DELETE      105
  69. #define IDC_CLOSE       106
  70.  
  71.  
  72. /* ReadNote Control IDs */
  73.  
  74. #define IDC_SAVECHANGES 101
  75. #define IDC_SAVEATTACH  102
  76. #define IDC_REPLY       103
  77. #define IDC_REPLYALL    104
  78. #define IDC_FORWARD     105
  79. #define IDT_RFROM       106
  80. #define IDT_RDATE       107
  81. #define IDT_RTO         108
  82. #define IDT_RCC         109
  83. #define IDT_RSUBJECT    110
  84. #define IDC_RFROM       111
  85. #define IDC_RDATE       112
  86. #define IDC_RTO         113
  87. #define IDC_RCC         114
  88. #define IDC_RSUBJECT    115
  89. #define IDC_READNOTE    116
  90. #define IDT_ATTACHMENT  117
  91. #define IDC_ATTACHMENT  118
  92.  
  93.  
  94. /* Options Control IDs */
  95.  
  96. #define IDC_RETURN      101
  97.  
  98.  
  99. /* Details Control IDs */
  100.  
  101. #define IDT_NAME        100
  102. #define IDC_NAME        101
  103. #define IDT_TYPE        102
  104. #define IDC_TYPE        103
  105. #define IDT_ADDR        104
  106. #define IDC_ADDR        105
  107.  
  108. /* About Box Control IDs */
  109.  
  110. #define IDC_VERSION     101
  111.  
  112.  
  113. /* String Table IDs */
  114.  
  115. #define MAPI_ERROR_MAX          30
  116.  
  117. #define IDS_LOGONFAIL           (MAPI_ERROR_MAX + 1)
  118. #define IDS_ADDRBOOKFAIL        (MAPI_ERROR_MAX + 2)
  119. #define IDS_RESOLVEFAIL         (MAPI_ERROR_MAX + 3)
  120. #define IDS_UNRESOLVEDNAMES     (MAPI_ERROR_MAX + 4)
  121. #define IDS_SENDERROR           (MAPI_ERROR_MAX + 5)
  122. #define IDS_DETAILS_TOO_MANY    (MAPI_ERROR_MAX + 6)
  123. #define IDS_DETAILSFAIL         (MAPI_ERROR_MAX + 7)
  124. #define IDS_NORECIPS            (MAPI_ERROR_MAX + 8)
  125. #define IDS_SAVEATTACHERROR     (MAPI_ERROR_MAX + 9)
  126. #define IDS_READFAIL            (MAPI_ERROR_MAX + 10)
  127. #define IDS_DIALOGACTIVE        (MAPI_ERROR_MAX + 11)
  128.  
  129. #define IDS_FILTER              (MAPI_ERROR_MAX + 50)
  130.  
  131. /* Manifest Constants */
  132.  
  133. #define ADDR_MAX            128
  134. #define MAXUSERS            10
  135. #define TO_EDIT_MAX         512
  136. #define CC_EDIT_MAX         512
  137. #define SUBJECT_EDIT_MAX    128
  138. #define NOTE_LINE_MAX       1024
  139. #define FILE_ATTACH_MAX     32
  140.  
  141. /* Message Box styles */
  142.  
  143. #define MBS_ERROR           (MB_ICONSTOP | MB_OK)
  144. #define MBS_INFO            (MB_ICONINFORMATION | MB_OK)
  145. #define MBS_OOPS            (MB_ICONEXCLAMATION | MB_OK)
  146.  
  147. /* Structure Definitions */
  148.  
  149. typedef struct _msgid *LPMSGID;
  150.  
  151. typedef struct _msgid
  152. {
  153.     LPSTR       lpszMsgID;
  154.     BOOL        fHasAttach;
  155.     BOOL        fUnRead;
  156.     LPSTR       lpszFrom;
  157.     LPSTR       lpszSubject;
  158.     LPSTR       lpszDateRec;
  159.     LPMSGID     lpPrev;
  160.     LPMSGID     lpNext;
  161. } MSGID;
  162.  
  163.  
  164.  
  165. /* Function Prototypes */
  166.  
  167. int  PASCAL WinMain(HINSTANCE, HINSTANCE, LPSTR, int);
  168. BOOL InitApplication(HANDLE);
  169. BOOL InitInstance(HANDLE, int);
  170. void DeinitApplication(void);
  171. long FAR PASCAL MainWndProc(HWND, UINT, UINT, LPARAM);
  172. BOOL FAR PASCAL AboutDlgProc(HWND, UINT, UINT, LONG);
  173. BOOL FAR PASCAL ComposeDlgProc(HWND, UINT, UINT, LONG);
  174. BOOL FAR PASCAL InBoxDlgProc(HWND, UINT, UINT, LONG);
  175. BOOL FAR PASCAL ReadMailDlgProc(HWND, UINT, UINT, LONG);
  176. BOOL FAR PASCAL OptionsDlgProc(HWND, UINT, UINT, LONG);
  177. BOOL FAR PASCAL DetailsDlgProc(HWND, UINT, UINT, LONG);
  178. void    MakeMessageBox(HWND, ULONG, UINT, UINT);
  179. ULONG   ResolveFriendlyNames(HWND, LPSTR, ULONG, ULONG *, lpMapiRecipDesc *);
  180. ULONG   CopyRecipient(lpMapiRecipDesc, lpMapiRecipDesc, lpMapiRecipDesc);
  181. ULONG   GetNextFile(HWND, ULONG, ULONG *, lpMapiFileDesc *);
  182. ULONG   CopyAttachment(lpMapiFileDesc, lpMapiFileDesc, lpMapiFileDesc);
  183. BOOL    FNameInList(LPSTR, ULONG, lpMapiRecipDesc);
  184. LPMSGID MakeMsgNode(lpMapiMessage, LPSTR);
  185. LPMSGID FindNode(LPMSGID, LPSTR);
  186. void    InsertMsgNode(LPMSGID, LPMSGID *);
  187. void    DeleteMsgNode(LPMSGID, LPMSGID *);
  188. void    FreeMsgList(LPMSGID);
  189. void    MakeDisplayNameStr(LPSTR, ULONG, ULONG, lpMapiRecipDesc);
  190. ULONG   SaveMsgChanges(HWND, lpMapiMessage, LPSTR);
  191. ULONG   MakeNewMessage(lpMapiMessage, UINT);
  192. void    LogSendMail(ULONG);
  193. void    SaveFileAttachments(HWND, lpMapiFileDesc);
  194. void    ToggleMenuState(HWND, BOOL);   
  195. BOOL    fSMAPIInstalled(void);
  196. void SecureMenu(HWND hWnd, BOOL fBeforeLogon);
  197.