Leaked source code of windows server 2003
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.

1490 lines
57 KiB

  1. #include "precomp.h"
  2. extern PROPSHEETPAGE g_psp[NUM_PAGES];
  3. extern TCHAR g_szCustIns[MAX_PATH];
  4. extern TCHAR g_szTempSign[];
  5. extern int g_iCurPage;
  6. extern BOOL g_fDisableIMAPPage;
  7. extern BOOL g_fIntranet;
  8. #define MAX_SERVER 256
  9. static const TCHAR c_sz1[] = TEXT("1");
  10. static const TCHAR c_sz0[] = TEXT("0");
  11. static const TCHAR c_szYes[] = TEXT("Yes");
  12. static const TCHAR c_szNo[] = TEXT("No");
  13. static const TCHAR c_szEmpty[] = TEXT("");
  14. static const TCHAR c_szNULL[] = TEXT("NULL");
  15. /////////////////////////////////////////////////////////////////////////////
  16. // MailServer
  17. INT_PTR CALLBACK MailServer(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
  18. {
  19. TCHAR szMailServer[MAX_SERVER],
  20. szSMTPServer[MAX_SERVER],
  21. szNewsServer[MAX_SERVER],
  22. szChoice[16];
  23. LPCTSTR pszKey;
  24. HWND hComboBox;
  25. BOOL fIMAP,
  26. fSPAMail, fSPASMTP, fSPANNTP,
  27. fAcctRO, fNoModify;
  28. UNREFERENCED_PARAMETER(wParam);
  29. switch (message)
  30. {
  31. case WM_INITDIALOG:
  32. //----- Set up the global goo -----
  33. g_hWizard = hDlg;
  34. //----- Set up dialog controls -----
  35. EnableDBCSChars(hDlg, IDE_MAILSERVER);
  36. EnableDBCSChars(hDlg, IDE_SMTPSERVER);
  37. EnableDBCSChars(hDlg, IDE_NEWSERVER);
  38. Edit_LimitText(GetDlgItem(hDlg, IDE_MAILSERVER), countof(szMailServer)-1);
  39. Edit_LimitText(GetDlgItem(hDlg, IDE_SMTPSERVER), countof(szSMTPServer)-1);
  40. Edit_LimitText(GetDlgItem(hDlg, IDE_NEWSERVER), countof(szNewsServer)-1);
  41. hComboBox = GetDlgItem(hDlg, IDC_POPIMAP);
  42. ComboBox_ResetContent(hComboBox);
  43. LoadString(g_rvInfo.hInst, IDS_POP3, szChoice, countof(szChoice));
  44. ComboBox_AddString(hComboBox, szChoice);
  45. LoadString(g_rvInfo.hInst, IDS_IMAP, szChoice, countof(szChoice));
  46. ComboBox_AddString(hComboBox, szChoice);
  47. break;
  48. case IDM_BATCHADVANCE:
  49. DoBatchAdvance(hDlg);
  50. break;
  51. case WM_HELP:
  52. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  53. break;
  54. case WM_NOTIFY:
  55. switch (((NMHDR FAR *)lParam)->code)
  56. {
  57. case PSN_SETACTIVE:
  58. //----- Standard prolog -----
  59. // Note. Another case of the global goo.
  60. SetBannerText(hDlg);
  61. //----- Initialization of fields -----
  62. // only allow branding of news server fields if OCW is running us and they're installing
  63. // outlook
  64. fIMAP = InsGetYesNo(IS_INTERNETMAIL, IK_USEIMAP, FALSE, g_szCustIns);
  65. pszKey = fIMAP ? IK_IMAPSERVER : IK_POPSERVER;
  66. GetPrivateProfileString(IS_INTERNETMAIL, pszKey, c_szEmpty, szMailServer, countof(szMailServer), g_szCustIns);
  67. GetPrivateProfileString(IS_INTERNETMAIL, IK_SMTPSERVER, c_szEmpty, szSMTPServer, countof(szSMTPServer), g_szCustIns);
  68. StrRemoveWhitespace(szMailServer);
  69. StrRemoveWhitespace(szSMTPServer);
  70. fSPAMail = InsGetYesNo(IS_INTERNETMAIL, IK_USESPA, FALSE, g_szCustIns);
  71. fSPASMTP = InsGetYesNo(IS_INTERNETMAIL, IK_SMTPUSESPA, FALSE, g_szCustIns);
  72. fAcctRO = InsGetYesNo(IS_OEGLOBAL, IK_READONLY, FALSE, g_szCustIns);
  73. fNoModify = InsGetYesNo(IS_OEGLOBAL, IK_NOMODIFYACCTS, FALSE, g_szCustIns);
  74. SetDlgItemText(hDlg, IDE_MAILSERVER, szMailServer);
  75. SetDlgItemText(hDlg, IDE_SMTPSERVER, szSMTPServer);
  76. CheckDlgButton(hDlg, IDC_USESPAMAIL, fSPAMail);
  77. CheckDlgButton(hDlg, IDC_USESPASMTP, fSPASMTP);
  78. CheckDlgButton(hDlg, IDC_ACCTRO, fAcctRO);
  79. if (g_fIntranet)
  80. CheckDlgButton(hDlg, IDC_ACCTNOCONFIG, fNoModify);
  81. ComboBox_SetCurSel(GetDlgItem(hDlg, IDC_POPIMAP), fIMAP ? 1 : 0);
  82. GetPrivateProfileString(IS_INTERNETNEWS, IK_NNTPSERVER, c_szEmpty, szNewsServer, countof(szNewsServer), g_szCustIns);
  83. StrRemoveWhitespace(szNewsServer);
  84. fSPANNTP = InsGetYesNo(IS_INTERNETNEWS, IK_USESPA, FALSE, g_szCustIns);
  85. SetDlgItemText(hDlg, IDE_NEWSERVER, szNewsServer);
  86. CheckDlgButton(hDlg, IDC_USESPANNTP, fSPANNTP);
  87. CheckBatchAdvance(hDlg); // standard line
  88. break;
  89. case PSN_WIZBACK:
  90. case PSN_WIZNEXT:
  91. case PSN_WIZFINISH:
  92. //----- Read data from controls into internal variables -----
  93. fIMAP = (ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_POPIMAP)) > 0);
  94. g_fDisableIMAPPage = !fIMAP;
  95. GetDlgItemText(hDlg, IDE_MAILSERVER, szMailServer, countof(szMailServer));
  96. GetDlgItemText(hDlg, IDE_SMTPSERVER, szSMTPServer, countof(szSMTPServer));
  97. StrRemoveWhitespace(szMailServer);
  98. StrRemoveWhitespace(szSMTPServer);
  99. fSPAMail = IsDlgButtonChecked(hDlg, IDC_USESPAMAIL);
  100. fSPASMTP = IsDlgButtonChecked(hDlg, IDC_USESPASMTP);
  101. fAcctRO = IsDlgButtonChecked(hDlg, IDC_ACCTRO);
  102. fNoModify = IsDlgButtonChecked(hDlg, IDC_ACCTNOCONFIG);
  103. //----- Serialize data to the *.ins file -----
  104. WritePrivateProfileString(IS_INTERNETMAIL, IK_USEIMAP, fIMAP ? c_szYes : c_szNo, g_szCustIns);
  105. if (fIMAP)
  106. {
  107. WritePrivateProfileString(IS_INTERNETMAIL, IK_IMAPSERVER, szMailServer, g_szCustIns);
  108. WritePrivateProfileString(IS_INTERNETMAIL, IK_POPSERVER, NULL, g_szCustIns);
  109. }
  110. else
  111. {
  112. WritePrivateProfileString(IS_INTERNETMAIL, IK_IMAPSERVER, NULL, g_szCustIns);
  113. WritePrivateProfileString(IS_INTERNETMAIL, IK_POPSERVER, szMailServer, g_szCustIns);
  114. }
  115. WritePrivateProfileString(IS_INTERNETMAIL, IK_SMTPSERVER, szSMTPServer, g_szCustIns);
  116. WritePrivateProfileString(IS_INTERNETMAIL, IK_USESPA, fSPAMail ? c_szYes : c_szNo, g_szCustIns);
  117. WritePrivateProfileString(IS_INTERNETMAIL, IK_SMTPUSESPA, fSPASMTP ? c_szYes : c_szNo, g_szCustIns);
  118. WritePrivateProfileString(IS_INTERNETMAIL, IK_SMTPREQLOGON, fSPASMTP ? c_sz1 : c_sz0, g_szCustIns);
  119. WritePrivateProfileString(IS_OEGLOBAL, IK_READONLY, fAcctRO ? c_sz1 : c_sz0, g_szCustIns);
  120. if (g_fIntranet)
  121. WritePrivateProfileString(IS_OEGLOBAL, IK_NOMODIFYACCTS,fNoModify? c_sz1 : c_sz0, g_szCustIns);
  122. GetDlgItemText(hDlg, IDE_NEWSERVER, szNewsServer, countof(szNewsServer));
  123. StrRemoveWhitespace(szNewsServer);
  124. fSPANNTP = IsDlgButtonChecked(hDlg, IDC_USESPANNTP);
  125. WritePrivateProfileString(IS_INTERNETNEWS, IK_NNTPSERVER, szNewsServer, g_szCustIns);
  126. WritePrivateProfileString(IS_INTERNETNEWS, IK_USESPA, fSPANNTP ? c_szYes : c_szNo, g_szCustIns);
  127. WritePrivateProfileString(IS_INTERNETNEWS, IK_REQLOGON, fSPANNTP ? c_sz1 : c_sz0, g_szCustIns);
  128. //----- Standard epilog -----
  129. // Note. Last and classical at that example of the global goo.
  130. g_iCurPage = PPAGE_MAIL;
  131. EnablePages();
  132. if (((LPNMHDR)lParam)->code == PSN_WIZNEXT)
  133. PageNext(hDlg);
  134. else if (((LPNMHDR)lParam)->code == PSN_WIZBACK)
  135. PagePrev(hDlg);
  136. break;
  137. case PSN_HELP:
  138. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  139. break;
  140. case PSN_QUERYCANCEL:
  141. return !QueryCancel(hDlg);
  142. default:
  143. return FALSE;
  144. }
  145. break;
  146. default:
  147. return FALSE;
  148. }
  149. return TRUE;
  150. }
  151. /////////////////////////////////////////////////////////////////////////////
  152. // IMAPSettings
  153. INT_PTR CALLBACK IMAPSettings(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
  154. {
  155. TCHAR szRFP[MAX_PATH], szSentPath[MAX_PATH], szDrafts[MAX_PATH];
  156. BOOL fSpecial, fCheckNew;
  157. switch (message)
  158. {
  159. case WM_INITDIALOG:
  160. //----- Set up the global goo -----
  161. g_hWizard = hDlg;
  162. //----- Set up dialog controls -----
  163. EnableDBCSChars(hDlg, IDE_ROOTPATH);
  164. EnableDBCSChars(hDlg, IDE_SENTPATH);
  165. EnableDBCSChars(hDlg, IDE_DRAFTSPATH);
  166. Edit_LimitText(GetDlgItem(hDlg, IDE_ROOTPATH), countof(szRFP)-1);
  167. Edit_LimitText(GetDlgItem(hDlg, IDE_SENTPATH), countof(szSentPath)-1);
  168. Edit_LimitText(GetDlgItem(hDlg, IDE_DRAFTSPATH), countof(szDrafts)-1);
  169. break;
  170. case WM_COMMAND:
  171. if (BN_CLICKED == HIWORD(wParam))
  172. {
  173. switch (LOWORD(wParam))
  174. {
  175. case IDC_STORESPECIAL:
  176. fSpecial = IsDlgButtonChecked(hDlg, IDC_STORESPECIAL);
  177. EnableDlgItem2(hDlg, IDE_SENTPATH, fSpecial);
  178. EnableDlgItem2(hDlg, IDC_SENTPATH_TXT, fSpecial);
  179. EnableDlgItem2(hDlg, IDE_DRAFTSPATH, fSpecial);
  180. EnableDlgItem2(hDlg, IDC_DRAFTSPATH_TXT, fSpecial);
  181. break;
  182. }
  183. break;
  184. }
  185. case IDM_BATCHADVANCE:
  186. DoBatchAdvance(hDlg);
  187. break;
  188. case WM_HELP:
  189. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  190. break;
  191. case WM_NOTIFY:
  192. switch (((NMHDR FAR *)lParam)->code)
  193. {
  194. case PSN_SETACTIVE:
  195. //----- Standard prolog -----
  196. // Note. Another case of the global goo.
  197. SetBannerText(hDlg);
  198. //----- Initialization of fields -----
  199. GetPrivateProfileString(IS_INTERNETMAIL, IK_RFP, c_szEmpty, szRFP, countof(szRFP), g_szCustIns);
  200. GetPrivateProfileString(IS_INTERNETMAIL, IK_SENTITEMS, c_szEmpty, szSentPath, countof(szSentPath), g_szCustIns);
  201. GetPrivateProfileString(IS_INTERNETMAIL, IK_DRAFTS, c_szEmpty, szDrafts, countof(szDrafts), g_szCustIns);
  202. StrRemoveWhitespace(szRFP);
  203. StrRemoveWhitespace(szSentPath);
  204. StrRemoveWhitespace(szDrafts);
  205. fCheckNew = GetPrivateProfileInt(IS_INTERNETMAIL, IK_CHECKFORNEW, FALSE, g_szCustIns);
  206. fSpecial = GetPrivateProfileInt(IS_INTERNETMAIL, IK_USESPECIAL, FALSE, g_szCustIns);
  207. SetDlgItemText(hDlg, IDE_ROOTPATH, szRFP);
  208. SetDlgItemText(hDlg, IDE_SENTPATH, szSentPath);
  209. SetDlgItemText(hDlg, IDE_DRAFTSPATH, szDrafts);
  210. CheckDlgButton(hDlg, IDC_STORESPECIAL, fSpecial);
  211. CheckDlgButton(hDlg, IDC_CHECKNEW, fCheckNew);
  212. EnableDlgItem2(hDlg, IDE_SENTPATH, fSpecial);
  213. EnableDlgItem2(hDlg, IDC_SENTPATH_TXT, fSpecial);
  214. EnableDlgItem2(hDlg, IDE_DRAFTSPATH, fSpecial);
  215. EnableDlgItem2(hDlg, IDC_DRAFTSPATH_TXT, fSpecial);
  216. CheckBatchAdvance(hDlg); // standard line
  217. break;
  218. case PSN_WIZBACK:
  219. case PSN_WIZNEXT:
  220. case PSN_WIZFINISH:
  221. //----- Read data from controls into internal variables -----
  222. GetDlgItemText(hDlg, IDE_ROOTPATH, szRFP, countof(szRFP));
  223. GetDlgItemText(hDlg, IDE_SENTPATH, szSentPath, countof(szSentPath));
  224. GetDlgItemText(hDlg, IDE_DRAFTSPATH, szDrafts, countof(szDrafts));
  225. StrRemoveWhitespace(szRFP);
  226. StrRemoveWhitespace(szSentPath);
  227. StrRemoveWhitespace(szDrafts);
  228. fCheckNew = IsDlgButtonChecked(hDlg, IDC_CHECKNEW);
  229. fSpecial = IsDlgButtonChecked(hDlg, IDC_STORESPECIAL);
  230. //----- Serialize data to the *.ins file -----
  231. WritePrivateProfileString(IS_INTERNETMAIL, IK_RFP, szRFP, g_szCustIns);
  232. WritePrivateProfileString(IS_INTERNETMAIL, IK_SENTITEMS, szSentPath, g_szCustIns);
  233. WritePrivateProfileString(IS_INTERNETMAIL, IK_DRAFTS, szDrafts, g_szCustIns);
  234. WritePrivateProfileString(IS_INTERNETMAIL, IK_CHECKFORNEW, fCheckNew ? c_sz1 : c_sz0, g_szCustIns);
  235. WritePrivateProfileString(IS_INTERNETMAIL, IK_USESPECIAL, fSpecial ? c_sz1 : c_sz0, g_szCustIns);
  236. //----- Standard epilog -----
  237. // Note. Last and classical at that example of the global goo.
  238. g_iCurPage = PPAGE_IMAP;
  239. EnablePages();
  240. if (((LPNMHDR)lParam)->code == PSN_WIZNEXT)
  241. PageNext(hDlg);
  242. else if (((LPNMHDR)lParam)->code == PSN_WIZBACK)
  243. PagePrev(hDlg);
  244. break;
  245. case PSN_HELP:
  246. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  247. break;
  248. case PSN_QUERYCANCEL:
  249. return !QueryCancel(hDlg);
  250. default:
  251. return FALSE;
  252. }
  253. break;
  254. default:
  255. return FALSE;
  256. }
  257. return TRUE;
  258. }
  259. void SetTimeoutString(HWND hwnd, UINT pos)
  260. {
  261. UINT cch, csec, cmin;
  262. TCHAR szOut[128], sz[128];
  263. csec = TIMEOUT_SEC_MIN + (pos * TIMEOUT_DSEC);
  264. ASSERT(csec >= TIMEOUT_SEC_MIN && csec <= TIMEOUT_SEC_MAX);
  265. cmin = csec / 60;
  266. csec = csec % 60;
  267. if (cmin > 1)
  268. {
  269. LoadString(g_rvInfo.hInst, IDS_XMINUTES, sz, countof(sz));
  270. wnsprintf(szOut, countof(szOut), sz, cmin);
  271. cch = lstrlen(szOut);
  272. }
  273. else if (cmin == 1)
  274. {
  275. cch = LoadString(g_rvInfo.hInst, IDS_1MINUTE, szOut, countof(szOut));
  276. }
  277. else
  278. {
  279. cch = 0;
  280. }
  281. if (csec != 0)
  282. {
  283. if (cmin > 0)
  284. {
  285. szOut[cch] = TEXT(' ');
  286. cch++;
  287. }
  288. LoadString(g_rvInfo.hInst, IDS_XSECONDS, sz, countof(sz));
  289. wnsprintf(&szOut[cch], countof(szOut) - cch, sz, csec);
  290. }
  291. SetWindowText(hwnd, szOut);
  292. }
  293. /////////////////////////////////////////////////////////////////////////////
  294. // LDAPServer
  295. INT_PTR CALLBACK LDAPServer(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
  296. {
  297. TCHAR szLDAPServer[MAX_SERVER],
  298. szLDAPHome[INTERNET_MAX_URL_LENGTH],
  299. szLDAPBitmap[MAX_PATH],
  300. szWorkDir[MAX_PATH],
  301. szLDAPFriendly[MAX_SERVER],
  302. szLDAPBase[128],
  303. szTmp[MAX_PATH];
  304. BOOL fLDAPCheck,
  305. fTrans;
  306. UINT uTimeout,
  307. uMatches,
  308. uAuthType;
  309. DWORD dwFlags;
  310. switch (message)
  311. {
  312. case WM_INITDIALOG:
  313. //----- Set up the global goo -----
  314. g_hWizard = hDlg;
  315. //----- Set up dialog controls -----
  316. EnableDBCSChars(hDlg, IDE_FRIENDLYNAME);
  317. EnableDBCSChars(hDlg, IDE_SEARCHBASE);
  318. EnableDBCSChars(hDlg, IDE_LDAPBITMAP);
  319. EnableDBCSChars(hDlg, IDE_DIRSERVICE);
  320. EnableDBCSChars(hDlg, IDE_LDAPHOMEPAGE);
  321. Edit_LimitText(GetDlgItem(hDlg, IDE_FRIENDLYNAME), countof(szLDAPFriendly) - 1);
  322. Edit_LimitText(GetDlgItem(hDlg, IDE_DIRSERVICE), countof(szLDAPServer) - 1);
  323. Edit_LimitText(GetDlgItem(hDlg, IDE_LDAPHOMEPAGE), countof(szLDAPHome) - 1);
  324. Edit_LimitText(GetDlgItem(hDlg, IDE_SEARCHBASE), countof(szLDAPBase) - 1);
  325. Edit_LimitText(GetDlgItem(hDlg, IDE_LDAPBITMAP), countof(szLDAPBitmap) - 1);
  326. SendDlgItemMessage(hDlg, IDC_TIMEOUTSLD, TBM_SETRANGE, 0, (LPARAM)MAKELONG(0, CTIMEOUT - 1));
  327. SendDlgItemMessage(hDlg, IDC_SPIN1, UDM_SETRANGE, 0, MAKELONG(MATCHES_MAX, MATCHES_MIN));
  328. Edit_LimitText(GetDlgItem(hDlg, IDE_MATCHES), 4);
  329. break;
  330. case IDM_BATCHADVANCE:
  331. DoBatchAdvance(hDlg);
  332. break;
  333. case WM_HELP:
  334. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  335. break;
  336. case WM_HSCROLL:
  337. SetTimeoutString(GetDlgItem(hDlg, IDC_TIMEOUT), (UINT) SendMessage((HWND)lParam, TBM_GETPOS, 0, 0));
  338. break;
  339. case WM_COMMAND:
  340. if (HIWORD(wParam) == BN_CLICKED)
  341. {
  342. switch (LOWORD(wParam))
  343. {
  344. case IDC_BROWSELDAP:
  345. GetDlgItemText(hDlg, IDE_LDAPBITMAP, szLDAPBitmap, countof(szLDAPBitmap));
  346. if (BrowseForFile(hDlg, szLDAPBitmap, countof(szLDAPBitmap), GFN_BMP))
  347. SetDlgItemText(hDlg, IDE_LDAPBITMAP, szLDAPBitmap);
  348. break;
  349. default:
  350. return FALSE;
  351. }
  352. }
  353. break;
  354. case WM_NOTIFY:
  355. switch (((NMHDR FAR *)lParam)->code)
  356. {
  357. case PSN_SETACTIVE:
  358. //----- Standard prolog -----
  359. // Note. Another case of the global goo.
  360. SetBannerText(hDlg);
  361. PropSheet_SetWizButtons(GetParent(hDlg), PSWIZB_BACK | PSWIZB_NEXT);
  362. //----- Initialization of fields -----
  363. GetPrivateProfileString(IS_LDAP, IK_FRIENDLYNAME, c_szEmpty, szLDAPFriendly, countof(szLDAPFriendly), g_szCustIns);
  364. GetPrivateProfileString(IS_LDAP, IK_SERVER, c_szEmpty, szLDAPServer, countof(szLDAPServer), g_szCustIns);
  365. GetPrivateProfileString(IS_LDAP, IK_LDAPHOMEPAGE, c_szEmpty, szLDAPHome, countof(szLDAPHome), g_szCustIns);
  366. GetPrivateProfileString(IS_LDAP, IK_SEARCHBASE, c_szNULL, szLDAPBase, countof(szLDAPBase), g_szCustIns);
  367. GetPrivateProfileString(IS_LDAP, IK_BITMAP, c_szEmpty, szLDAPBitmap, countof(szLDAPBitmap), g_szCustIns);
  368. StrRemoveWhitespace(szLDAPFriendly);
  369. StrRemoveWhitespace(szLDAPServer);
  370. StrRemoveWhitespace(szLDAPHome);
  371. StrRemoveWhitespace(szLDAPBase);
  372. StrRemoveWhitespace(szLDAPBitmap);
  373. fLDAPCheck = (BOOL)GetPrivateProfileInt(IS_LDAP, IK_CHECKNAMES, FALSE, g_szCustIns);
  374. uTimeout = GetPrivateProfileInt(IS_LDAP, IK_TIMEOUT, TIMEOUT_SEC_DEFAULT, g_szCustIns);
  375. if (uTimeout < TIMEOUT_SEC_MIN)
  376. uTimeout = TIMEOUT_SEC_MIN;
  377. else if (uTimeout > TIMEOUT_SEC_MAX)
  378. uTimeout = TIMEOUT_SEC_MAX;
  379. uMatches = GetPrivateProfileInt(IS_LDAP, IK_MATCHES, MATCHES_DEFAULT, g_szCustIns);
  380. if (uMatches < MATCHES_MIN)
  381. uMatches = MATCHES_MIN;
  382. else if (uMatches > MATCHES_MAX)
  383. uMatches = MATCHES_MAX;
  384. uAuthType = GetPrivateProfileInt(IS_LDAP, IK_AUTHTYPE, AUTH_ANONYMOUS, g_szCustIns);
  385. if (uAuthType != AUTH_ANONYMOUS && uAuthType != AUTH_SPA)
  386. uAuthType = AUTH_ANONYMOUS;
  387. SetDlgItemText(hDlg, IDE_FRIENDLYNAME, szLDAPFriendly);
  388. SetDlgItemText(hDlg, IDE_DIRSERVICE, szLDAPServer);
  389. SetDlgItemText(hDlg, IDE_LDAPHOMEPAGE, szLDAPHome);
  390. SetDlgItemText(hDlg, IDE_SEARCHBASE, szLDAPBase);
  391. SetDlgItemText(hDlg, IDE_LDAPBITMAP, szLDAPBitmap);
  392. uTimeout = (uTimeout / TIMEOUT_DSEC) - 1;
  393. SendDlgItemMessage(hDlg, IDC_TIMEOUTSLD, TBM_SETPOS, TRUE, (LPARAM)uTimeout);
  394. SetTimeoutString(GetDlgItem(hDlg, IDC_TIMEOUT), uTimeout);
  395. SetDlgItemInt(hDlg, IDE_MATCHES, uMatches, FALSE);
  396. CheckDlgButton(hDlg, IDC_CHECKNAMES, fLDAPCheck ? BST_CHECKED : BST_UNCHECKED);
  397. CheckDlgButton(hDlg, IDC_SPA, uAuthType == AUTH_SPA ? BST_CHECKED : BST_UNCHECKED);
  398. PathCombine(szTmp, g_szTempSign, PathFindFileName(szLDAPBitmap));
  399. DeleteFile(szTmp);
  400. CheckBatchAdvance(hDlg); // standard line
  401. break;
  402. case PSN_WIZBACK:
  403. case PSN_WIZNEXT:
  404. case PSN_WIZFINISH:
  405. //----- Read data from controls into internal variables -----
  406. GetDlgItemText(hDlg, IDE_FRIENDLYNAME, szLDAPFriendly, countof(szLDAPFriendly));
  407. GetDlgItemText(hDlg, IDE_DIRSERVICE, szLDAPServer, countof(szLDAPServer));
  408. GetDlgItemText(hDlg, IDE_LDAPHOMEPAGE, szLDAPHome, countof(szLDAPHome));
  409. GetDlgItemText(hDlg, IDE_SEARCHBASE, szLDAPBase, countof(szLDAPBase));
  410. GetDlgItemText(hDlg, IDE_LDAPBITMAP, szLDAPBitmap, countof(szLDAPBitmap));
  411. StrRemoveWhitespace(szLDAPFriendly);
  412. StrRemoveWhitespace(szLDAPServer);
  413. StrRemoveWhitespace(szLDAPHome);
  414. StrRemoveWhitespace(szLDAPBase);
  415. StrRemoveWhitespace(szLDAPBitmap);
  416. fLDAPCheck = IsDlgButtonChecked(hDlg, IDC_CHECKNAMES);
  417. uAuthType = IsDlgButtonChecked(hDlg, IDC_SPA) ? AUTH_SPA : AUTH_ANONYMOUS;
  418. uTimeout = (UINT) SendDlgItemMessage(hDlg, IDC_TIMEOUTSLD, TBM_GETPOS, 0, 0);
  419. uTimeout = TIMEOUT_SEC_MIN + (uTimeout * TIMEOUT_DSEC);
  420. uMatches = GetDlgItemInt(hDlg, IDE_MATCHES, &fTrans, FALSE);
  421. // TODO: we should probably display an error msg here
  422. if (!fTrans)
  423. uMatches = MATCHES_DEFAULT;
  424. else if (uMatches < MATCHES_MIN)
  425. uMatches = MATCHES_MIN;
  426. else if (uMatches > MATCHES_MAX)
  427. uMatches = MATCHES_MAX;
  428. //----- Validate the input -----
  429. dwFlags = FC_FILE | FC_EXISTS;
  430. if (!CheckField(hDlg, IDE_LDAPBITMAP, dwFlags))
  431. {
  432. SetWindowLongPtr(hDlg, DWLP_MSGRESULT, -1);
  433. break;
  434. }
  435. if (!CheckField(hDlg, IDE_LDAPHOMEPAGE, FC_URL))
  436. {
  437. SetWindowLongPtr(hDlg, DWLP_MSGRESULT, -1);
  438. break;
  439. }
  440. //----- Serialize data to the *.ins file -----
  441. WritePrivateProfileString(IS_LDAP, IK_FRIENDLYNAME, szLDAPFriendly, g_szCustIns);
  442. WritePrivateProfileString(IS_LDAP, IK_SERVER, szLDAPServer, g_szCustIns);
  443. WritePrivateProfileString(IS_LDAP, IK_LDAPHOMEPAGE, szLDAPHome, g_szCustIns);
  444. InsWriteQuotedString (IS_LDAP, IK_SEARCHBASE, szLDAPBase, g_szCustIns);
  445. WritePrivateProfileString(IS_LDAP, IK_BITMAP, szLDAPBitmap, g_szCustIns);
  446. WritePrivateProfileString(IS_LDAP, IK_CHECKNAMES, fLDAPCheck ? c_sz1 : c_sz0, g_szCustIns);
  447. wnsprintf(szWorkDir, countof(szWorkDir), TEXT("%i"), uTimeout);
  448. WritePrivateProfileString(IS_LDAP, IK_TIMEOUT, szWorkDir, g_szCustIns);
  449. wnsprintf(szWorkDir, countof(szWorkDir), TEXT("%i"), uMatches);
  450. WritePrivateProfileString(IS_LDAP, IK_MATCHES, szWorkDir, g_szCustIns);
  451. wnsprintf(szWorkDir, countof(szWorkDir), TEXT("%i"), uAuthType);
  452. WritePrivateProfileString(IS_LDAP, IK_AUTHTYPE, szWorkDir, g_szCustIns);
  453. g_cmCabMappings.GetFeatureDir(FEATURE_LDAP, szWorkDir);
  454. ImportLDAPBitmap(g_szCustIns, szWorkDir, TRUE);
  455. //----- Standard epilog -----
  456. // Note. Last and classical at that example of the global goo.
  457. g_iCurPage = PPAGE_LDAP;
  458. EnablePages();
  459. if (((LPNMHDR)lParam)->code == PSN_WIZNEXT)
  460. PageNext(hDlg);
  461. else if (((LPNMHDR)lParam)->code == PSN_WIZBACK)
  462. PagePrev(hDlg);
  463. break;
  464. case PSN_HELP:
  465. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  466. break;
  467. case PSN_QUERYCANCEL:
  468. return !QueryCancel(hDlg);
  469. default:
  470. return FALSE;
  471. }
  472. break;
  473. default:
  474. return FALSE;
  475. }
  476. return TRUE;
  477. }
  478. /////////////////////////////////////////////////////////////////////////////
  479. // CustomizeOE
  480. INT_PTR CALLBACK CustomizeOE(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
  481. {
  482. TCHAR szInfopane[INTERNET_MAX_URL_LENGTH],
  483. szInfopaneBmp[MAX_PATH],
  484. szHTMLPath[MAX_PATH],
  485. szWorkDir[MAX_PATH],
  486. szSender[255],
  487. szReply[255],
  488. szTmp[MAX_PATH];
  489. UINT nID;
  490. BOOL fURL;
  491. DWORD dwFlags;
  492. switch (message)
  493. {
  494. case WM_INITDIALOG:
  495. //----- Set up the global goo -----
  496. g_hWizard = hDlg;
  497. //----- Set up dialog controls -----
  498. EnableDBCSChars(hDlg, IDE_OELOCALPATH);
  499. EnableDBCSChars(hDlg, IDE_OEIMAGEPATH);
  500. EnableDBCSChars(hDlg, IDE_OEWMPATH);
  501. EnableDBCSChars(hDlg, IDE_OEWMSENDER);
  502. EnableDBCSChars(hDlg, IDE_OEPANEURL);
  503. EnableDBCSChars(hDlg, IDE_OEWMREPLYTO);
  504. Edit_LimitText(GetDlgItem(hDlg, IDE_OEPANEURL), countof(szInfopane) - 1);
  505. Edit_LimitText(GetDlgItem(hDlg, IDE_OELOCALPATH), MAX_PATH);
  506. Edit_LimitText(GetDlgItem(hDlg, IDE_OEIMAGEPATH), countof(szInfopaneBmp) - 1);
  507. Edit_LimitText(GetDlgItem(hDlg, IDE_OEWMPATH), countof(szHTMLPath) - 1);
  508. Edit_LimitText(GetDlgItem(hDlg, IDE_OEWMSENDER), countof(szSender) - 1);
  509. Edit_LimitText(GetDlgItem(hDlg, IDE_OEWMREPLYTO), countof(szReply) - 1);
  510. break;
  511. case IDM_BATCHADVANCE:
  512. DoBatchAdvance(hDlg);
  513. break;
  514. case WM_COMMAND:
  515. if (HIWORD(wParam) == BN_CLICKED)
  516. {
  517. switch (LOWORD(wParam))
  518. {
  519. case IDC_OEPANEURL:
  520. case IDC_OEPANELOCAL:
  521. fURL = (LOWORD(wParam) == IDC_OEPANEURL);
  522. EnableDlgItem2(hDlg, IDE_OEPANEURL, fURL);
  523. EnableDlgItem2(hDlg, IDE_OELOCALPATH, !fURL);
  524. EnableDlgItem2(hDlg, IDC_BROWSEOEHTML, !fURL);
  525. EnableDlgItem2(hDlg, IDC_OELOCALPATH_TXT, !fURL);
  526. EnableDlgItem2(hDlg, IDE_OEIMAGEPATH, !fURL);
  527. EnableDlgItem2(hDlg, IDC_BROWSEOEIMAGE, !fURL);
  528. EnableDlgItem2(hDlg, IDC_OEIMAGEPATH_TXT, !fURL);
  529. break;
  530. case IDC_BROWSEOEHTML:
  531. GetDlgItemText(hDlg, IDE_OELOCALPATH, szInfopane, countof(szInfopane));
  532. if (BrowseForFile(hDlg, szInfopane, countof(szInfopane), GFN_LOCALHTM))
  533. SetDlgItemText(hDlg, IDE_OELOCALPATH, szInfopane);
  534. break;
  535. case IDC_BROWSEOEIMAGE:
  536. GetDlgItemText(hDlg, IDE_OEIMAGEPATH, szInfopaneBmp, countof(szInfopaneBmp));
  537. if (BrowseForFile(hDlg, szInfopaneBmp, countof(szInfopaneBmp), GFN_PICTURE))
  538. SetDlgItemText(hDlg, IDE_OEIMAGEPATH, szInfopaneBmp);
  539. break;
  540. case IDC_BROWSEOEWM:
  541. GetDlgItemText(hDlg, IDE_OEWMPATH, szHTMLPath, countof(szHTMLPath));
  542. if (BrowseForFile(hDlg, szHTMLPath, countof(szHTMLPath), GFN_LOCALHTM))
  543. SetDlgItemText(hDlg, IDE_OEWMPATH, szHTMLPath);
  544. break;
  545. default:
  546. break;
  547. }
  548. }
  549. break;
  550. case WM_NOTIFY:
  551. switch (((NMHDR FAR *)lParam)->code)
  552. {
  553. case PSN_SETACTIVE:
  554. //----- Standard prolog -----
  555. // Note. Another case of the global goo.
  556. SetBannerText(hDlg);
  557. //----- Initialization of fields (1st phase) -----
  558. GetPrivateProfileString(IS_INTERNETMAIL, IK_INFOPANE, c_szEmpty, szInfopane, countof(szInfopane), g_szCustIns);
  559. GetPrivateProfileString(IS_INTERNETMAIL, IK_INFOPANEBMP, c_szEmpty, szInfopaneBmp, countof(szInfopaneBmp), g_szCustIns);
  560. GetPrivateProfileString(IS_INTERNETMAIL, IK_WELCOMEMESSAGE, c_szEmpty, szHTMLPath, countof(szHTMLPath), g_szCustIns);
  561. GetPrivateProfileString(IS_INTERNETMAIL, IK_WELCOMENAME, c_szEmpty, szSender, countof(szSender), g_szCustIns);
  562. GetPrivateProfileString(IS_INTERNETMAIL, IK_WELCOMEADDR, c_szEmpty, szReply, countof(szReply), g_szCustIns);
  563. StrRemoveWhitespace(szInfopane);
  564. StrRemoveWhitespace(szInfopaneBmp);
  565. StrRemoveWhitespace(szHTMLPath);
  566. StrRemoveWhitespace(szSender);
  567. StrRemoveWhitespace(szReply);
  568. //----- Initialization of fields (2nd phase) -----
  569. nID = PathIsURL(szInfopane) ? IDC_OEPANEURL : IDC_OEPANELOCAL;
  570. //----- Set read values in the controls -----
  571. CheckRadioButton(hDlg, IDC_OEPANEURL, IDC_OEPANELOCAL, nID);
  572. SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(nID, BN_CLICKED), (LPARAM)GetDlgItem(hDlg, nID));
  573. if (nID == IDC_OEPANEURL)
  574. {
  575. SetDlgItemText(hDlg, IDE_OEPANEURL, szInfopane);
  576. SetDlgItemText(hDlg, IDE_OELOCALPATH, NULL);
  577. }
  578. else
  579. {
  580. SetDlgItemText(hDlg, IDE_OEPANEURL, NULL);
  581. SetDlgItemText(hDlg, IDE_OELOCALPATH, szInfopane);
  582. }
  583. SetDlgItemText(hDlg, IDE_OEIMAGEPATH, szInfopaneBmp);
  584. SetDlgItemText(hDlg, IDE_OEWMPATH, szHTMLPath);
  585. SetDlgItemText(hDlg, IDE_OEWMSENDER, szSender);
  586. SetDlgItemText(hDlg, IDE_OEWMREPLYTO, szReply);
  587. if ((nID != IDC_OEPANEURL) && ISNONNULL(szInfopane))
  588. {
  589. PathCombine(szTmp, g_szTempSign, PathFindFileName(szInfopane));
  590. DeleteFile(szTmp);
  591. }
  592. if (ISNONNULL(szInfopaneBmp))
  593. {
  594. PathCombine(szTmp, g_szTempSign, PathFindFileName(szInfopaneBmp));
  595. DeleteFile(szTmp);
  596. }
  597. if (ISNONNULL(szHTMLPath))
  598. {
  599. PathCombine(szTmp, g_szTempSign, PathFindFileName(szHTMLPath));
  600. DeleteFile(szTmp);
  601. }
  602. CheckBatchAdvance(hDlg); // standard line
  603. break;
  604. case PSN_WIZBACK:
  605. case PSN_WIZNEXT:
  606. case PSN_WIZFINISH:
  607. //----- Read data from controls into internal variables -----
  608. nID = IsDlgButtonChecked(hDlg, IDC_OEPANEURL) == BST_CHECKED ? IDE_OEPANEURL : IDE_OELOCALPATH;
  609. GetDlgItemText(hDlg, nID, szInfopane, countof(szInfopane));
  610. GetDlgItemText(hDlg, IDE_OEWMSENDER, szSender, countof(szSender));
  611. GetDlgItemText(hDlg, IDE_OEWMREPLYTO, szReply, countof(szReply));
  612. GetDlgItemText(hDlg, IDE_OEWMPATH, szHTMLPath, countof(szHTMLPath));
  613. GetDlgItemText(hDlg, IDE_OEIMAGEPATH, szInfopaneBmp, countof(szInfopaneBmp));
  614. StrRemoveWhitespace(szInfopane);
  615. StrRemoveWhitespace(szInfopaneBmp);
  616. StrRemoveWhitespace(szHTMLPath);
  617. StrRemoveWhitespace(szSender);
  618. StrRemoveWhitespace(szReply);
  619. //----- Validate the input -----
  620. dwFlags = FC_FILE | FC_EXISTS;
  621. if (nID == IDE_OEPANEURL)
  622. {
  623. if (!CheckField(hDlg, IDE_OEPANEURL, FC_URL))
  624. {
  625. SetWindowLongPtr(hDlg, DWLP_MSGRESULT, -1);
  626. break;
  627. }
  628. }
  629. else
  630. { /* if (nID == IDE_OELOCALPATH) */
  631. if (!CheckField(hDlg, nID, dwFlags))
  632. {
  633. SetWindowLongPtr(hDlg, DWLP_MSGRESULT, -1);
  634. break;
  635. }
  636. if (!CheckField(hDlg, IDE_OEIMAGEPATH, dwFlags))
  637. {
  638. SetWindowLongPtr(hDlg, DWLP_MSGRESULT, -1);
  639. break;
  640. }
  641. }
  642. if (!CheckField(hDlg, IDE_OEWMPATH, dwFlags))
  643. {
  644. SetWindowLongPtr(hDlg, DWLP_MSGRESULT, -1);
  645. break;
  646. }
  647. if (*szHTMLPath != TEXT('\0') && (!CheckField(hDlg, IDE_OEWMSENDER, FC_NONNULL) ||
  648. !CheckField(hDlg, IDE_OEWMREPLYTO, FC_NONNULL)))
  649. {
  650. SetWindowLongPtr(hDlg, DWLP_MSGRESULT, -1);
  651. break;
  652. }
  653. //----- Serialize data to the *.ins file -----
  654. WritePrivateProfileString(IS_INTERNETMAIL, IK_INFOPANE, szInfopane, g_szCustIns);
  655. WritePrivateProfileString(IS_INTERNETMAIL, IK_INFOPANEBMP, szInfopaneBmp, g_szCustIns);
  656. WritePrivateProfileString(IS_INTERNETMAIL, IK_WELCOMEMESSAGE, szHTMLPath, g_szCustIns);
  657. WritePrivateProfileString(IS_INTERNETMAIL, IK_WELCOMENAME, szSender, g_szCustIns);
  658. WritePrivateProfileString(IS_INTERNETMAIL, IK_WELCOMEADDR, szReply, g_szCustIns);
  659. g_cmCabMappings.GetFeatureDir(FEATURE_OE, szWorkDir);
  660. ImportOEInfo(g_szCustIns, szWorkDir, TRUE);
  661. //----- Standard epilog -----
  662. // Note. Last and classical at that example of the global goo.
  663. g_iCurPage = PPAGE_OE;
  664. EnablePages();
  665. if (((LPNMHDR)lParam)->code == PSN_WIZNEXT)
  666. PageNext(hDlg);
  667. else if (((LPNMHDR)lParam)->code == PSN_WIZBACK)
  668. PagePrev(hDlg);
  669. break;
  670. case PSN_HELP:
  671. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  672. break;
  673. case PSN_QUERYCANCEL:
  674. return !QueryCancel(hDlg);
  675. default:
  676. return FALSE;
  677. }
  678. break;
  679. case WM_HELP:
  680. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  681. break;
  682. default:
  683. return FALSE;
  684. }
  685. return TRUE;
  686. }
  687. /////////////////////////////////////////////////////////////////////////////
  688. // Signature
  689. INT_PTR CALLBACK Signature(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
  690. {
  691. TCHAR szBuf1[1024],
  692. szBuf2[1024];
  693. BOOL fUseMailForNews,
  694. fDoSig,
  695. fHtmlMail,
  696. fHtmlNews, fEnable;
  697. switch (message)
  698. {
  699. case WM_INITDIALOG:
  700. //----- Set up the global goo -----
  701. g_hWizard = hDlg;
  702. //----- Set up dialog controls -----
  703. EnableDBCSChars(hDlg, IDE_MAILSIGTEXT);
  704. EnableDBCSChars(hDlg, IDE_NEWSSIGTEXT);
  705. Edit_LimitText(GetDlgItem(hDlg, IDE_MAILSIGTEXT), countof(szBuf1)-1);
  706. Edit_LimitText(GetDlgItem(hDlg, IDE_NEWSSIGTEXT), countof(szBuf1)-1);
  707. break;
  708. case IDM_BATCHADVANCE:
  709. DoBatchAdvance(hDlg);
  710. break;
  711. case WM_COMMAND:
  712. switch (HIWORD(wParam))
  713. {
  714. case BN_CLICKED:
  715. switch (LOWORD(wParam))
  716. {
  717. case IDC_MAILSIGTEXT:
  718. case IDC_NEWSSIGTEXT:
  719. fEnable = (IsDlgButtonChecked(hDlg, IDC_MAILSIGTEXT) == BST_CHECKED);
  720. EnableDlgItem2(hDlg, IDE_MAILSIGTEXT, fEnable);
  721. EnableDlgItem2(hDlg, IDC_NEWSSIGTEXT, fEnable);
  722. fEnable &= (IsDlgButtonChecked(hDlg, IDC_NEWSSIGTEXT) == BST_CHECKED);
  723. EnableDlgItem2(hDlg, IDE_NEWSSIGTEXT, fEnable);
  724. break;
  725. }
  726. break;
  727. default:
  728. return FALSE;
  729. }
  730. break;
  731. case WM_NOTIFY:
  732. switch (((NMHDR FAR *)lParam)->code)
  733. {
  734. case PSN_SETACTIVE:
  735. //----- Standard prolog -----
  736. // Note. Another case of the global goo.
  737. SetBannerText(hDlg);
  738. //----- Initialization of fields -----
  739. fUseMailForNews = (BOOL)GetPrivateProfileInt(IS_MAILSIG, IK_USEMAILFORNEWS, FALSE, g_szCustIns);
  740. fDoSig = (BOOL)GetPrivateProfileInt(IS_MAILSIG, IK_USESIG, FALSE, g_szCustIns);
  741. fHtmlMail = (BOOL)GetPrivateProfileInt(IS_INTERNETMAIL, IK_HTMLMSGS, TRUE, g_szCustIns);
  742. fHtmlNews = (BOOL)GetPrivateProfileInt(IS_INTERNETNEWS, IK_HTMLMSGS, FALSE, g_szCustIns);
  743. GetPrivateProfileString(IS_MAILSIG, IK_SIGTEXT, c_szEmpty, szBuf1, countof(szBuf1), g_szCustIns);
  744. EncodeSignature(szBuf1, szBuf2, FALSE);
  745. SetDlgItemText(hDlg, IDE_MAILSIGTEXT, szBuf2);
  746. if (!fUseMailForNews)
  747. {
  748. GetPrivateProfileString(IS_SIG, IK_SIGTEXT, c_szEmpty, szBuf1, countof(szBuf1), g_szCustIns);
  749. EncodeSignature(szBuf1, szBuf2, FALSE);
  750. SetDlgItemText(hDlg, IDE_NEWSSIGTEXT, szBuf2);
  751. }
  752. //----- Set up dialog controls -----
  753. // Note. Some of it is done above already;
  754. CheckDlgButton(hDlg, IDC_MAILSIGTEXT, fDoSig ? BST_CHECKED : BST_UNCHECKED);
  755. CheckDlgButton(hDlg, IDC_NEWSSIGTEXT, (fDoSig && !fUseMailForNews) ? BST_CHECKED : BST_UNCHECKED);
  756. EnableDlgItem2(hDlg, IDE_MAILSIGTEXT, fDoSig);
  757. EnableDlgItem2(hDlg, IDC_NEWSSIGTEXT, fDoSig);
  758. EnableDlgItem2(hDlg, IDE_NEWSSIGTEXT, fDoSig && !fUseMailForNews);
  759. CheckDlgButton(hDlg, IDC_HTMLMAIL, fHtmlMail ? BST_CHECKED : BST_UNCHECKED);
  760. CheckDlgButton(hDlg, IDC_HTMLNEWS, fHtmlNews ? BST_CHECKED : BST_UNCHECKED);
  761. CheckBatchAdvance(hDlg); // standard line
  762. break;
  763. case PSN_WIZBACK:
  764. case PSN_WIZNEXT:
  765. case PSN_WIZFINISH:
  766. //----- Read data from controls into internal variables -----
  767. fUseMailForNews = (IsDlgButtonChecked(hDlg, IDC_NEWSSIGTEXT) != BST_CHECKED);
  768. fDoSig = (IsDlgButtonChecked(hDlg, IDC_MAILSIGTEXT) == BST_CHECKED);
  769. fHtmlMail = (IsDlgButtonChecked(hDlg, IDC_HTMLMAIL) == BST_CHECKED);
  770. fHtmlNews = (IsDlgButtonChecked(hDlg, IDC_HTMLNEWS) == BST_CHECKED);
  771. GetDlgItemText(hDlg, IDE_MAILSIGTEXT, szBuf1, countof(szBuf1));
  772. EncodeSignature(szBuf1, szBuf2, TRUE);
  773. WritePrivateProfileString(IS_MAILSIG, IK_SIGTEXT, szBuf2, g_szCustIns);
  774. GetDlgItemText(hDlg, IDE_NEWSSIGTEXT, szBuf1, countof(szBuf1));
  775. EncodeSignature(szBuf1, szBuf2, TRUE);
  776. WritePrivateProfileString(IS_SIG, IK_SIGTEXT, szBuf2, g_szCustIns);
  777. //----- Serialize data to the *.ins file -----
  778. // Note. Some of it is done above already.
  779. WritePrivateProfileString(IS_MAILSIG, IK_USEMAILFORNEWS, fUseMailForNews ? c_sz1 : c_sz0, g_szCustIns);
  780. WritePrivateProfileString(IS_MAILSIG, IK_USESIG, fDoSig ? c_sz1 : c_sz0, g_szCustIns);
  781. WritePrivateProfileString(IS_SIG, IK_USESIG, fDoSig ? c_sz1 : c_sz0, g_szCustIns);
  782. WritePrivateProfileString(IS_INTERNETMAIL, IK_HTMLMSGS, fHtmlMail ? c_sz1 : c_sz0, g_szCustIns);
  783. WritePrivateProfileString(IS_INTERNETNEWS, IK_HTMLMSGS, fHtmlNews ? c_sz1 : c_sz0, g_szCustIns);
  784. //----- Standard epilog -----
  785. // Note. Last and classical at that example of the global goo.
  786. g_iCurPage = PPAGE_SIG;
  787. EnablePages();
  788. if (((LPNMHDR)lParam)->code == PSN_WIZNEXT)
  789. PageNext(hDlg);
  790. else if (((LPNMHDR)lParam)->code == PSN_WIZBACK)
  791. PagePrev(hDlg);
  792. break;
  793. case PSN_HELP:
  794. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  795. break;
  796. case PSN_QUERYCANCEL:
  797. return !QueryCancel(hDlg);
  798. default:
  799. return FALSE;
  800. }
  801. break;
  802. case WM_HELP:
  803. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  804. break;
  805. default:
  806. return FALSE;
  807. }
  808. return TRUE;
  809. }
  810. #define CBSECTION 1024
  811. void InitializeNewsgroups(HWND hwnd, LPCTSTR pszSection, LPCTSTR pszValue, LPCTSTR pszFile)
  812. {
  813. LPTSTR pszGroups, psz, pszDest;
  814. TCHAR szGroupSection[256];
  815. DWORD dw;
  816. dw = GetPrivateProfileString(pszSection, pszValue, c_szEmpty, szGroupSection, countof(szGroupSection), pszFile);
  817. if (dw > 0)
  818. {
  819. pszGroups = (LPTSTR)LocalAlloc(LMEM_FIXED, sizeof(TCHAR) * CBSECTION);
  820. if (pszGroups != NULL)
  821. {
  822. dw = GetPrivateProfileSection(szGroupSection, pszGroups, CBSECTION, pszFile);
  823. if (dw > 0)
  824. {
  825. psz = pszGroups;
  826. pszDest = pszGroups;
  827. while (*psz != 0)
  828. {
  829. while (*psz != 0 && *psz != '=')
  830. {
  831. *pszDest = *psz;
  832. psz++;
  833. pszDest++;
  834. }
  835. if (*psz != 0)
  836. {
  837. psz++;
  838. while (*psz != 0)
  839. psz++;
  840. }
  841. psz++;
  842. *pszDest = 0x0d;
  843. pszDest++;
  844. *pszDest = 0x0a;
  845. pszDest++;
  846. }
  847. *pszDest = 0;
  848. }
  849. SetWindowText(hwnd, pszGroups);
  850. LocalFree(pszGroups);
  851. }
  852. }
  853. }
  854. void SaveNewsgroups(HWND hwnd, LPCTSTR pszSection, LPCTSTR pszValue, LPCTSTR pszFile)
  855. {
  856. LPTSTR pszGroups, psz, pszDest, pszDestT;
  857. TCHAR szGroupSection[256];
  858. DWORD dw, cch;
  859. BOOL fGroups;
  860. fGroups = FALSE;
  861. cch = GetWindowTextLength(hwnd);
  862. if (cch > 0)
  863. {
  864. cch += 4;
  865. pszGroups = (LPTSTR)LocalAlloc(LMEM_FIXED, sizeof(TCHAR) * cch);
  866. if (pszGroups != NULL)
  867. {
  868. cch = GetWindowText(hwnd, pszGroups, cch);
  869. psz = pszGroups;
  870. pszDest = pszGroups;
  871. pszDestT = pszDest;
  872. while (*psz != 0)
  873. {
  874. if (*psz == '\r' && *(psz + 1) == '\n')
  875. {
  876. psz += 2;
  877. if (pszDest > pszDestT)
  878. {
  879. *pszDest = '=';
  880. pszDest++;
  881. *pszDest = 0;
  882. pszDest++;
  883. pszDestT = pszDest;
  884. fGroups = TRUE;
  885. }
  886. continue;
  887. }
  888. else if (*psz != '\t' && *psz != ' ' && *psz != '\r' && *psz != '\n')
  889. {
  890. *pszDest = *psz;
  891. pszDest++;
  892. }
  893. psz++;
  894. }
  895. if (pszDest > pszDestT)
  896. {
  897. *pszDest = '=';
  898. pszDest++;
  899. *pszDest = 0;
  900. pszDest++;
  901. }
  902. *pszDest = 0;
  903. if (fGroups)
  904. {
  905. dw = GetPrivateProfileString(pszSection, pszValue, c_szEmpty, szGroupSection, countof(szGroupSection), pszFile);
  906. if (dw == 0)
  907. StrCpy(szGroupSection, IK_NEWSGROUPLIST);
  908. WritePrivateProfileString(pszSection, pszValue, szGroupSection, pszFile);
  909. WritePrivateProfileSection(szGroupSection, pszGroups, pszFile);
  910. }
  911. LocalFree(pszGroups);
  912. }
  913. }
  914. if (!fGroups)
  915. {
  916. dw = GetPrivateProfileString(pszSection, pszValue, c_szEmpty, szGroupSection, countof(szGroupSection), pszFile);
  917. if (dw > 0)
  918. WritePrivateProfileSection(szGroupSection, NULL, pszFile);
  919. WritePrivateProfileString(pszSection, pszValue, NULL, pszFile);
  920. }
  921. }
  922. /////////////////////////////////////////////////////////////////////////////
  923. // PreConfigSettings
  924. INT_PTR CALLBACK PreConfigSettings(HWND hDlg, UINT message, WPARAM, LPARAM lParam)
  925. {
  926. BOOL fDefMail,
  927. #if defined(CONDITIONAL_JUNKMAIL)
  928. fJunkMail,
  929. #endif
  930. fDefNews,
  931. fDeleteLinks;
  932. TCHAR szServiceName[MAX_PATH],
  933. szServiceURL[INTERNET_MAX_URL_LENGTH];
  934. switch (message)
  935. {
  936. case WM_INITDIALOG:
  937. //----- Set up the global goo -----
  938. g_hWizard = hDlg;
  939. //----- Set up dialog controls -----
  940. // EnableDBCSChars(hDlg, IDE_NGROUPS);
  941. EnableDBCSChars(hDlg, IDE_SERVICENAME);
  942. EnableDBCSChars(hDlg, IDE_SERVICEURL);
  943. Edit_LimitText(GetDlgItem(hDlg, IDE_SERVICENAME), countof(szServiceName)-1);
  944. Edit_LimitText(GetDlgItem(hDlg, IDE_SERVICEURL), countof(szServiceURL)-1);
  945. break;
  946. case IDM_BATCHADVANCE:
  947. DoBatchAdvance(hDlg);
  948. break;
  949. case WM_HELP:
  950. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  951. break;
  952. case WM_NOTIFY:
  953. switch (((NMHDR FAR *)lParam)->code)
  954. {
  955. case PSN_SETACTIVE:
  956. //----- Standard prolog -----
  957. // Note. Another case of the global goo.
  958. SetBannerText(hDlg);
  959. //----- Initialization of fields -----
  960. fDefMail = InsGetYesNo(IS_INTERNETMAIL, IK_DEFAULTCLIENT, FALSE, g_szCustIns);
  961. fDefNews = InsGetYesNo(IS_INTERNETNEWS, IK_DEFAULTCLIENT, FALSE, g_szCustIns);
  962. #if defined(CONDITIONAL_JUNKMAIL)
  963. fJunkMail = InsGetYesNo(IS_INTERNETMAIL, IK_JUNKMAIL, FALSE, g_szCustIns);
  964. #endif
  965. fDeleteLinks = InsGetBool(IS_OUTLKEXP, IK_DELETELINKS, FALSE, g_szCustIns);
  966. GetPrivateProfileString(IS_OEGLOBAL, IK_SERVICENAME, c_szEmpty, szServiceName, countof(szServiceName), g_szCustIns);
  967. GetPrivateProfileString(IS_OEGLOBAL, IK_SERVICEURL, c_szEmpty, szServiceURL, countof(szServiceURL), g_szCustIns);
  968. StrRemoveWhitespace(szServiceName);
  969. StrRemoveWhitespace(szServiceURL);
  970. #if defined(CONDITIONAL_JUNKMAIL)
  971. //----- Set up dialog controls -----
  972. CheckDlgButton(hDlg, IDC_JUNKMAIL,fJunkMail? BST_CHECKED : BST_UNCHECKED);
  973. #endif
  974. CheckDlgButton(hDlg, IDC_DEFMAIL, fDefMail ? BST_CHECKED : BST_UNCHECKED);
  975. CheckDlgButton(hDlg, IDC_DEFNEWS, fDefNews ? BST_CHECKED : BST_UNCHECKED);
  976. CheckDlgButton(hDlg, IDC_DELETELINKS, fDeleteLinks ? BST_CHECKED : BST_UNCHECKED);
  977. InitializeNewsgroups(GetDlgItem(hDlg, IDE_NGROUPS), IS_INTERNETNEWS, IK_NEWSGROUPS, g_szCustIns);
  978. SetDlgItemText(hDlg, IDE_SERVICENAME, szServiceName);
  979. SetDlgItemText(hDlg, IDE_SERVICEURL, szServiceURL);
  980. CheckBatchAdvance(hDlg); // standard line
  981. break;
  982. case PSN_WIZBACK:
  983. case PSN_WIZNEXT:
  984. case PSN_WIZFINISH:
  985. //----- Read data from controls into internal variables -----
  986. fDefMail = (IsDlgButtonChecked(hDlg, IDC_DEFMAIL) == BST_CHECKED);
  987. fDefNews = (IsDlgButtonChecked(hDlg, IDC_DEFNEWS) == BST_CHECKED);
  988. #if defined(CONDITIONAL_JUNKMAIL)
  989. fJunkMail= (IsDlgButtonChecked(hDlg, IDC_JUNKMAIL) == BST_CHECKED);
  990. #endif
  991. fDeleteLinks = (IsDlgButtonChecked(hDlg, IDC_DELETELINKS) == BST_CHECKED);
  992. GetDlgItemText(hDlg, IDE_SERVICENAME, szServiceName, countof(szServiceName));
  993. GetDlgItemText(hDlg, IDE_SERVICEURL, szServiceURL, countof(szServiceURL));
  994. StrRemoveWhitespace(szServiceName);
  995. StrRemoveWhitespace(szServiceURL);
  996. //----- Validate the input -----
  997. if (ISNONNULL(szServiceName) || ISNONNULL(szServiceURL))
  998. {
  999. if (!CheckField(hDlg, IDE_SERVICENAME, FC_NONNULL))
  1000. {
  1001. SetWindowLongPtr(hDlg, DWLP_MSGRESULT, -1);
  1002. break;
  1003. }
  1004. if (!CheckField(hDlg, IDE_SERVICEURL, FC_URL | FC_NONNULL))
  1005. {
  1006. SetWindowLongPtr(hDlg, DWLP_MSGRESULT, -1);
  1007. break;
  1008. }
  1009. }
  1010. //----- Serialize data to the *.ins file -----
  1011. WritePrivateProfileString(IS_INTERNETMAIL, IK_DEFAULTCLIENT, fDefMail ? c_szYes : c_szNo, g_szCustIns);
  1012. WritePrivateProfileString(IS_INTERNETNEWS, IK_DEFAULTCLIENT, fDefNews ? c_szYes : c_szNo, g_szCustIns);
  1013. #if defined(CONDITIONAL_JUNKMAIL)
  1014. WritePrivateProfileString(IS_INTERNETMAIL, IK_JUNKMAIL, fJunkMail? c_sz1 : c_sz0, g_szCustIns);
  1015. #endif
  1016. InsWriteBool(IS_OUTLKEXP, IK_DELETELINKS, fDeleteLinks? c_sz1 : NULL, g_szCustIns);
  1017. SaveNewsgroups(GetDlgItem(hDlg, IDE_NGROUPS), IS_INTERNETNEWS, IK_NEWSGROUPS, g_szCustIns);
  1018. WritePrivateProfileString(IS_OEGLOBAL, IK_SERVICENAME, szServiceName, g_szCustIns);
  1019. WritePrivateProfileString(IS_OEGLOBAL, IK_SERVICEURL, szServiceURL, g_szCustIns);
  1020. //----- Standard epilog -----
  1021. // Note. Last and classical at that example of the global goo.
  1022. g_iCurPage = PPAGE_PRECONFIG;
  1023. EnablePages();
  1024. if (((LPNMHDR)lParam)->code == PSN_WIZNEXT)
  1025. PageNext(hDlg);
  1026. else if (((LPNMHDR)lParam)->code == PSN_WIZBACK)
  1027. PagePrev(hDlg);
  1028. break;
  1029. case PSN_HELP:
  1030. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  1031. break;
  1032. case PSN_QUERYCANCEL:
  1033. return !QueryCancel(hDlg);
  1034. default:
  1035. return FALSE;
  1036. }
  1037. break;
  1038. default:
  1039. return FALSE;
  1040. }
  1041. return TRUE;
  1042. }
  1043. /////////////////////////////////////////////////////////////////////////////
  1044. // ViewSettings
  1045. INT_PTR CALLBACK ViewSettings(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
  1046. {
  1047. BOOL fFolderBar,
  1048. fFolderList,
  1049. fContacts,
  1050. fTip,
  1051. fStatus,
  1052. fToolbar,
  1053. fToolbarText,
  1054. fOutlook,
  1055. fPreview,
  1056. fPreviewHdr,
  1057. fPreviewSide;
  1058. LPCTSTR psz;
  1059. switch (message)
  1060. {
  1061. case WM_INITDIALOG:
  1062. //----- Set up the global goo -----
  1063. g_hWizard = hDlg;
  1064. //----- Set up dialog controls -----
  1065. break;
  1066. case WM_COMMAND:
  1067. if (BN_CLICKED == HIWORD(wParam))
  1068. {
  1069. switch (LOWORD(wParam))
  1070. {
  1071. case IDC_TOOLBAR:
  1072. fToolbar = IsDlgButtonChecked(hDlg, IDC_TOOLBAR);
  1073. EnableDlgItem2(hDlg, IDC_TBARTEXT, fToolbar);
  1074. break;
  1075. case IDC_PREVIEW:
  1076. fPreview = IsDlgButtonChecked(hDlg, IDC_PREVIEW);
  1077. EnableDlgItem2(hDlg, IDC_SPLITVERT, fPreview);
  1078. EnableDlgItem2(hDlg, IDC_SPLITHORZ, fPreview);
  1079. EnableDlgItem2(hDlg, IDC_PREVIEWHDR, fPreview);
  1080. break;
  1081. }
  1082. break;
  1083. }
  1084. break;
  1085. case IDM_BATCHADVANCE:
  1086. DoBatchAdvance(hDlg);
  1087. break;
  1088. case WM_HELP:
  1089. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  1090. break;
  1091. case WM_NOTIFY:
  1092. switch (((NMHDR FAR *)lParam)->code)
  1093. {
  1094. case PSN_SETACTIVE:
  1095. //----- Standard prolog -----
  1096. // Note. Another case of the global goo.
  1097. SetBannerText(hDlg);
  1098. //----- Initialization of fields -----
  1099. fFolderBar = GetPrivateProfileInt(IS_OUTLKEXP, IK_FOLDERBAR, TRUE, g_szCustIns);
  1100. fFolderList = GetPrivateProfileInt(IS_OUTLKEXP, IK_FOLDERLIST, TRUE, g_szCustIns);
  1101. fOutlook = GetPrivateProfileInt(IS_OUTLKEXP, IK_OUTLOOKBAR, FALSE, g_szCustIns);
  1102. fStatus = GetPrivateProfileInt(IS_OUTLKEXP, IK_STATUSBAR, TRUE, g_szCustIns);
  1103. fContacts = GetPrivateProfileInt(IS_OUTLKEXP, IK_CONTACTS, TRUE, g_szCustIns);
  1104. fTip = GetPrivateProfileInt(IS_OUTLKEXP, IK_TIPOFTHEDAY, TRUE, g_szCustIns);
  1105. fToolbar = GetPrivateProfileInt(IS_OUTLKEXP, IK_TOOLBAR, TRUE, g_szCustIns);
  1106. if (fToolbar)
  1107. fToolbarText = GetPrivateProfileInt(IS_OUTLKEXP, IK_TOOLBARTEXT, TRUE, g_szCustIns);
  1108. else
  1109. fToolbarText = TRUE;
  1110. fPreview = GetPrivateProfileInt(IS_OUTLKEXP, IK_PREVIEWPANE, TRUE, g_szCustIns);
  1111. if (fPreview)
  1112. {
  1113. fPreviewHdr = GetPrivateProfileInt(IS_OUTLKEXP, IK_PREVIEWHDR, TRUE, g_szCustIns);
  1114. fPreviewSide = GetPrivateProfileInt(IS_OUTLKEXP, IK_PREVIEWSIDE, FALSE, g_szCustIns);
  1115. }
  1116. else
  1117. {
  1118. fPreviewHdr = TRUE;
  1119. fPreviewSide = FALSE;
  1120. }
  1121. //----- Set up dialog controls -----
  1122. CheckDlgButton(hDlg, IDC_FOLDERBAR, fFolderBar ? BST_CHECKED : BST_UNCHECKED);
  1123. CheckDlgButton(hDlg, IDC_FOLDERLIST, fFolderList ? BST_CHECKED : BST_UNCHECKED);
  1124. CheckDlgButton(hDlg, IDC_OUTLOOKBAR, fOutlook ? BST_CHECKED : BST_UNCHECKED);
  1125. CheckDlgButton(hDlg, IDC_STATUSBAR, fStatus ? BST_CHECKED : BST_UNCHECKED);
  1126. CheckDlgButton(hDlg, IDC_CONTACTS, fContacts ? BST_CHECKED : BST_UNCHECKED);
  1127. CheckDlgButton(hDlg, IDC_TIPOFDAY, fTip ? BST_CHECKED : BST_UNCHECKED);
  1128. CheckDlgButton(hDlg, IDC_TOOLBAR, fToolbar ? BST_CHECKED : BST_UNCHECKED);
  1129. if (!fToolbar)
  1130. SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(IDC_TOOLBAR, BN_CLICKED), (LPARAM)GetDlgItem(hDlg, IDC_TOOLBAR));
  1131. CheckDlgButton(hDlg, IDC_TBARTEXT, fToolbarText ? BST_CHECKED : BST_UNCHECKED);
  1132. CheckDlgButton(hDlg, IDC_PREVIEW, fPreview ? BST_CHECKED : BST_UNCHECKED);
  1133. if (!fPreview)
  1134. SendMessage(hDlg, WM_COMMAND, MAKEWPARAM(IDC_PREVIEW, BN_CLICKED), (LPARAM)GetDlgItem(hDlg, IDC_PREVIEW));
  1135. CheckDlgButton(hDlg, fPreviewSide ? IDC_SPLITVERT : IDC_SPLITHORZ, BST_CHECKED);
  1136. CheckDlgButton(hDlg, IDC_PREVIEWHDR, fPreviewHdr ? BST_CHECKED : BST_UNCHECKED);
  1137. CheckBatchAdvance(hDlg); // standard line
  1138. break;
  1139. case PSN_WIZBACK:
  1140. case PSN_WIZNEXT:
  1141. case PSN_WIZFINISH:
  1142. //----- Read data from controls into internal variables -----
  1143. fFolderBar = (IsDlgButtonChecked(hDlg, IDC_FOLDERBAR) == BST_CHECKED);
  1144. fFolderList = (IsDlgButtonChecked(hDlg, IDC_FOLDERLIST) == BST_CHECKED);
  1145. fOutlook = (IsDlgButtonChecked(hDlg, IDC_OUTLOOKBAR) == BST_CHECKED);
  1146. fStatus = (IsDlgButtonChecked(hDlg, IDC_STATUSBAR) == BST_CHECKED);
  1147. fContacts = (IsDlgButtonChecked(hDlg, IDC_CONTACTS) == BST_CHECKED);
  1148. fTip = (IsDlgButtonChecked(hDlg, IDC_TIPOFDAY) == BST_CHECKED);
  1149. fToolbar = (IsDlgButtonChecked(hDlg, IDC_TOOLBAR) == BST_CHECKED);
  1150. fToolbarText = (IsDlgButtonChecked(hDlg, IDC_TBARTEXT) == BST_CHECKED);
  1151. fPreview = (IsDlgButtonChecked(hDlg, IDC_PREVIEW) == BST_CHECKED);
  1152. fPreviewSide = (IsDlgButtonChecked(hDlg, IDC_SPLITVERT) == BST_CHECKED);
  1153. fPreviewHdr = (IsDlgButtonChecked(hDlg, IDC_PREVIEWHDR) == BST_CHECKED);
  1154. //----- Serialize data to the *.ins file -----
  1155. WritePrivateProfileString(IS_OUTLKEXP, IK_FOLDERBAR, fFolderBar ? c_sz1 : c_sz0, g_szCustIns);
  1156. WritePrivateProfileString(IS_OUTLKEXP, IK_FOLDERLIST, fFolderList ? c_sz1 : c_sz0, g_szCustIns);
  1157. WritePrivateProfileString(IS_OUTLKEXP, IK_OUTLOOKBAR, fOutlook ? c_sz1 : c_sz0, g_szCustIns);
  1158. WritePrivateProfileString(IS_OUTLKEXP, IK_STATUSBAR, fStatus ? c_sz1 : c_sz0, g_szCustIns);
  1159. WritePrivateProfileString(IS_OUTLKEXP, IK_CONTACTS, fContacts ? c_sz1 : c_sz0, g_szCustIns);
  1160. WritePrivateProfileString(IS_OUTLKEXP, IK_TIPOFTHEDAY, fTip ? c_sz1 : c_sz0, g_szCustIns);
  1161. WritePrivateProfileString(IS_OUTLKEXP, IK_TOOLBAR, fToolbar ? c_sz1 : c_sz0, g_szCustIns);
  1162. if (fToolbar)
  1163. psz = fToolbarText ? c_sz1 : c_sz0;
  1164. else
  1165. psz = NULL;
  1166. WritePrivateProfileString(IS_OUTLKEXP, IK_TOOLBARTEXT, psz, g_szCustIns);
  1167. WritePrivateProfileString(IS_OUTLKEXP, IK_PREVIEWPANE, fPreview ? c_sz1 : c_sz0, g_szCustIns);
  1168. if (fPreview)
  1169. psz = fPreviewHdr ? c_sz1 : c_sz0;
  1170. else
  1171. psz = NULL;
  1172. WritePrivateProfileString(IS_OUTLKEXP, IK_PREVIEWHDR, psz, g_szCustIns);
  1173. if (fPreview)
  1174. psz = fPreviewSide ? c_sz1 : c_sz0;
  1175. else
  1176. psz = NULL;
  1177. WritePrivateProfileString(IS_OUTLKEXP, IK_PREVIEWSIDE, psz, g_szCustIns);
  1178. //----- Standard epilog -----
  1179. // Note. Last and classical at that example of the global goo.
  1180. g_iCurPage = PPAGE_OEVIEW;
  1181. EnablePages();
  1182. if (((LPNMHDR)lParam)->code == PSN_WIZNEXT)
  1183. PageNext(hDlg);
  1184. else if (((LPNMHDR)lParam)->code == PSN_WIZBACK)
  1185. PagePrev(hDlg);
  1186. break;
  1187. case PSN_HELP:
  1188. IeakPageHelp(hDlg, g_psp[g_iCurPage].pszTemplate);
  1189. break;
  1190. case PSN_QUERYCANCEL:
  1191. return !QueryCancel(hDlg);
  1192. default:
  1193. return FALSE;
  1194. }
  1195. break;
  1196. default:
  1197. return FALSE;
  1198. }
  1199. return TRUE;
  1200. }