Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

298 lines
6.7 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. faxcpl.h
  5. Abstract:
  6. Header file for fax configuration DLL
  7. Environment:
  8. Windows NT fax configuration DLL
  9. Revision History:
  10. 02/27/96 -davidx-
  11. Created it.
  12. dd-mm-yy -author-
  13. description
  14. --*/
  15. #ifndef _FAXCPL_H_
  16. #define _FAXCPL_H_
  17. #include <windows.h>
  18. #include <windowsx.h>
  19. #include <winfax.h>
  20. #include "faxcfg.h"
  21. #include "faxutil.h"
  22. #include "faxreg.h"
  23. #include "faxcfgrs.h"
  24. #include "faxhelp.h"
  25. #define FAX_DRIVER_NAME TEXT("Windows NT Fax Driver")
  26. #define CLIENT_OPTIONS_PAGE 0
  27. #define CLIENT_COVERPG_PAGE 1
  28. #define STATUS_OPTIONS_PAGE 2
  29. #define ADVNCD_OPTIONS_PAGE 3
  30. #define PATH_SEPARATOR '\\'
  31. #define NUL 0
  32. //
  33. // Cover page filename extension and link filename extension
  34. //
  35. #define CP_FILENAME_EXT TEXT(".cov")
  36. #define LNK_FILENAME_EXT TEXT(".lnk")
  37. #define MAX_FILENAME_EXT 4
  38. //
  39. // Data structure for representing a list of cover pages:
  40. // the first nServerDirs paths refer to the server cover page directory
  41. // remaining paths contain user cover page directories
  42. //
  43. #define MAX_COVERPAGE_DIRS 8
  44. typedef struct {
  45. BOOL serverCP;
  46. INT nDirs;
  47. LPTSTR pDirPath[MAX_COVERPAGE_DIRS];
  48. } CPDATA, *PCPDATA;
  49. //
  50. // Flag bits attached to each cover page in a listbox
  51. //
  52. #define CPFLAG_DIRINDEX 0x00FF
  53. #define CPFLAG_LINK 0x0100
  54. #define CPACTION_BROWSE 0
  55. #define CPACTION_OPEN 1
  56. #define CPACTION_NEW 2
  57. #define CPACTION_REMOVE 3
  58. #define EQUAL_STRING 0
  59. #define FILENAME_EXT '.'
  60. #define MAX_STRING_LEN MAX_PATH
  61. #define MAX_MESSAGE_LEN 512
  62. //#define MemAlloc(size) ((PVOID) LocalAlloc(LMEM_FIXED, (size)))
  63. #define MemAllocZ(size) ((PVOID) MemAlloc((size)))
  64. //#define MemFree(ptr) { if (ptr) LocalFree((HLOCAL) (ptr)); }
  65. #define AllocStringZ(cch) MemAllocZ(sizeof(TCHAR) * (cch))
  66. #define AllocStringZ(cch) MemAllocZ(sizeof(TCHAR) * (cch))
  67. #define SizeOfString(p) ((_tcslen(p) + 1) * sizeof(TCHAR))
  68. #define IsNulChar(c) ((c) == NUL)
  69. #define IsEmptyString(p) ((p)[0] == NUL)
  70. //
  71. // globals
  72. //
  73. extern HINSTANCE ghInstance;
  74. static ULONG_PTR userInfoHelpIDs[] =
  75. {
  76. IDC_SENDER_NAME, IDH_USERINFO_FULL_NAME,
  77. IDC_SENDER_FAX_NUMBER, IDH_USERINFO_FAX_NUMBER,
  78. IDC_SENDER_MAILBOX, IDH_USERINFO_EMAIL_ADDRESS,
  79. IDC_SENDER_COMPANY, IDH_USERINFO_COMPANY,
  80. IDC_SENDER_ADDRESS, IDH_USERINFO_ADDRESS,
  81. IDC_SENDER_TITLE, IDH_USERINFO_TITLE,
  82. IDC_SENDER_DEPT, IDH_USERINFO_DEPARTMENT,
  83. IDC_SENDER_OFFICE_LOC, IDH_USERINFO_OFFICE_LOCATION,
  84. IDC_SENDER_OFFICE_TL, IDH_USERINFO_WORK_PHONE,
  85. IDC_SENDER_HOME_TL, IDH_USERINFO_HOME_PHONE,
  86. IDC_SENDER_BILLING_CODE, IDH_USERINFO_BILLING_CODE,
  87. IDCSTATIC_FULLNAME, IDH_USERINFO_FULL_NAME,
  88. IDCSTATIC_FAX_NUMBER_GROUP, IDH_USERINFO_RETURN_FAX_GRP,
  89. IDCSTATIC_COUNTRY, IDH_USERINFO_RETURN_FAX_GRP,
  90. IDCSTATIC_FAX_NUMBER, IDH_USERINFO_FAX_NUMBER,
  91. IDCSTATIC_MAILBOX, IDH_USERINFO_EMAIL_ADDRESS,
  92. IDCSTATIC_TITLE, IDH_USERINFO_TITLE,
  93. IDCSTATIC_COMPANY, IDH_USERINFO_COMPANY,
  94. IDCSTATIC_OFFICE, IDH_USERINFO_OFFICE_LOCATION,
  95. IDCSTATIC_DEPT, IDH_USERINFO_DEPARTMENT,
  96. IDCSTATIC_HOME_PHONE, IDH_USERINFO_HOME_PHONE,
  97. IDCSTATIC_WORK_PHONE, IDH_USERINFO_WORK_PHONE,
  98. IDCSTATIC_ADDRESS, IDH_USERINFO_ADDRESS,
  99. IDCSTATIC_FAX_NUMBER_GROUP, IDH_USERINFO_RETURN_FAX_GRP,
  100. IDCSTATIC_USERINFO_ICON, IDH_INACTIVE,
  101. IDCSTATIC_USERINFO, IDH_INACTIVE,
  102. IDCSTATIC_BILLING_CODE, IDH_USERINFO_BILLING_CODE,
  103. 0, 0
  104. };
  105. static ULONG_PTR statusMonitorHelpIDs[] = {
  106. IDC_STATUS_TASKBAR, IDH_STATUS_DISPLAY_ON_TASKBAR,
  107. IDC_STATUS_ONTOP, IDH_STATUS_ALWAYS_ON_TOP,
  108. IDC_STATUS_VISUAL, IDH_STATUS_VISUAL_NOTIFICATION,
  109. IDC_STATUS_SOUND, IDH_STATUS_SOUND_NOTIFICATION,
  110. IDC_STATUS_MANUAL, IDH_STATUS_ENABLE_MANUAL_ANSWER,
  111. IDCSTATIC_STATUS_OPTIONS, IDH_INACTIVE,
  112. IDCSTATIC_STATUS_ICON, IDH_INACTIVE,
  113. IDC_DISPLAY_GRP, IDH_INACTIVE,
  114. IDC_ARRIVE_GRP, IDH_INACTIVE,
  115. 0, 0
  116. };
  117. static ULONG_PTR clientCoverpgHelpIDs[] = {
  118. IDC_COVERPG_LIST, IDH_COVERPAGE_PERSONAL_LIST,
  119. IDC_COVERPG_ADD, IDH_COVERPAGE_ADD,
  120. IDC_COVERPG_NEW, IDH_COVERPAGE_NEW,
  121. IDC_COVERPG_OPEN, IDH_COVERPAGE_OPEN,
  122. IDC_COVERPG_REMOVE, IDH_COVERPAGE_REMOVE,
  123. IDCSTATIC_COVERPAGE_ICON, IDH_INACTIVE,
  124. IDCSTATIC_COVER_PAGE, IDH_INACTIVE,
  125. IDCSTATIC_COVERPG_DESCR, IDH_INACTIVE,
  126. 0, 0
  127. };
  128. static ULONG_PTR advancedHelpIDs[] = {
  129. IDCSTATIC_ADVANCED_ICON, IDH_INACTIVE,
  130. IDCSTATIC_ADVANCED_OPTIONS, IDH_INACTIVE,
  131. IDCSTATIC_MMC_DESC, IDH_INACTIVE,
  132. IDC_LAUNCH_MMC, IDH_LAUNCH_FAX_SERVICE_MANAGEMENT,
  133. IDCSTATIC_LAUNCH_MMC, IDH_INACTIVE,
  134. IDC_LAUNCH_MMC_HELP, IDH_HELP_BUTTON,
  135. IDCSTATIC_LAUNCH_MMC_HELP, IDH_INACTIVE,
  136. IDC_ADD_PRINTER, IDH_ADD_FAX_PRINTER,
  137. IDCSTATIC_ADD_PRINTER, IDH_INACTIVE,
  138. 0, 0
  139. };
  140. static PULONG_PTR arrayHelpIDs[4] =
  141. {
  142. userInfoHelpIDs,
  143. clientCoverpgHelpIDs,
  144. statusMonitorHelpIDs,
  145. advancedHelpIDs
  146. };
  147. //
  148. // prototypes
  149. //
  150. BOOL LoadWinfax();
  151. VOID UnloadWinfax();
  152. VOID
  153. SetChangedFlag(
  154. HWND hDlg,
  155. BOOL changed
  156. );
  157. BOOL
  158. HandleHelpPopup(
  159. HWND hDlg,
  160. UINT message,
  161. WPARAM wParam,
  162. LPARAM lParam,
  163. int index
  164. );
  165. //
  166. // Generate a list of available user cover pages
  167. //
  168. VOID
  169. InitCoverPageList(
  170. PCPDATA pCPInfo,
  171. HWND hDlg
  172. );
  173. //
  174. // Perform various action to manage the list of cover pages
  175. //
  176. VOID
  177. ManageCoverPageList(
  178. HWND hDlg,
  179. PCPDATA pCPInfo,
  180. HWND hwndList,
  181. INT action
  182. );
  183. //
  184. // Enable/disable buttons for manage cover page files
  185. //
  186. VOID
  187. UpdateCoverPageControls(
  188. HWND hDlg
  189. );
  190. //
  191. // Allocate memory to hold cover page information
  192. //
  193. PCPDATA
  194. AllocCoverPageInfo();
  195. //
  196. // Free up memory used for cover page information
  197. //
  198. VOID
  199. FreeCoverPageInfo(
  200. PCPDATA pCPInfo
  201. );
  202. INT
  203. GetSelectedCoverPage(
  204. PCPDATA pCPInfo,
  205. HWND hwndList,
  206. LPTSTR pBuffer
  207. );
  208. //
  209. // Display an error message dialog
  210. //
  211. INT
  212. DisplayMessageDialog(
  213. HWND hwndParent,
  214. UINT type,
  215. INT formatStrId,
  216. INT titleStrId,
  217. ...
  218. );
  219. LPTSTR
  220. MakeQuotedParameterString(
  221. LPTSTR pInputStr
  222. );
  223. //
  224. // Find the cover page editor executable filename
  225. //
  226. LPTSTR
  227. GetCoverPageEditor(
  228. VOID
  229. );
  230. #endif