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.

719 lines
18 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: I S D N P A G E . C P P
  7. //
  8. // Contents: Contains the isdn page for enumerated net class devices
  9. //
  10. // Notes:
  11. //
  12. // Author: BillBe 9 Sep 1997
  13. //
  14. //---------------------------------------------------------------------------
  15. #include "pch.h"
  16. #pragma hdrstop
  17. #include "isdnpage.h"
  18. #include "isdnshts.h"
  19. #include "ncreg.h"
  20. #include "ncsetup.h"
  21. #include "ncui.h"
  22. CIsdnPage::CIsdnPage()
  23. : m_fDirty(FALSE),
  24. m_hkeyDriver(NULL),
  25. m_hdi(NULL),
  26. m_pdeid(NULL),
  27. m_pisdnci(NULL)
  28. {
  29. }
  30. CIsdnPage::~CIsdnPage()
  31. {
  32. if (m_pisdnci)
  33. {
  34. // Free the structure. This was allocated by
  35. // HrReadIsdnPropertiesInfo.
  36. //
  37. FreeIsdnPropertiesInfo(m_pisdnci);
  38. }
  39. RegSafeCloseKey(m_hkeyDriver);
  40. }
  41. //+--------------------------------------------------------------------------
  42. //
  43. // Member: CIsdnPage::CreatePage
  44. //
  45. // Purpose: Creates the Isdn page only if there the device is an isdn
  46. // adapter
  47. //
  48. // Arguments:
  49. // hdi [in] SetupApi HDEVINFO for device
  50. // pdeid [in] SetupApi PSP_DEVINFO_DATA for device
  51. //
  52. // Returns: HPROPSHEETPAGE
  53. //
  54. // Author: billbe 9 Sep 1997
  55. //
  56. // Notes:
  57. //
  58. HPROPSHEETPAGE
  59. CIsdnPage::CreatePage(HDEVINFO hdi, PSP_DEVINFO_DATA pdeid)
  60. {
  61. Assert(INVALID_HANDLE_VALUE != hdi);
  62. Assert(hdi);
  63. Assert(pdeid);
  64. HPROPSHEETPAGE hpsp = NULL;
  65. // Open the device's instance key
  66. HRESULT hr = HrSetupDiOpenDevRegKey(hdi, pdeid,
  67. DICS_FLAG_GLOBAL, 0, DIREG_DRV, KEY_ALL_ACCESS,
  68. &m_hkeyDriver);
  69. // If the key was opened and this adapter is ISDN
  70. if (SUCCEEDED(hr) && FShowIsdnPages(m_hkeyDriver))
  71. {
  72. // read the adapter's properties from the registry
  73. hr = HrReadIsdnPropertiesInfo(m_hkeyDriver, hdi, pdeid, &m_pisdnci);
  74. if (SUCCEEDED(hr))
  75. {
  76. m_hdi = hdi;
  77. m_pdeid = pdeid;
  78. hpsp = CPropSheetPage::CreatePage(IDP_ISDN_SWITCH_TYPE, 0);
  79. }
  80. }
  81. return hpsp;
  82. }
  83. //+--------------------------------------------------------------------------
  84. //
  85. // Member: CIsdnPage::OnInitDialog
  86. //
  87. // Purpose: Handler for the WM_INITDIALOG window message. Initializes
  88. // the dialog window.
  89. //
  90. // Author: BillBe 09 Sep 1997
  91. //
  92. // Notes:
  93. //
  94. //
  95. LRESULT
  96. CIsdnPage::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam,
  97. BOOL& bHandled)
  98. {
  99. // Populate the switch types from the multi-sz that we read
  100. PopulateIsdnSwitchTypes(m_hWnd, IDC_CMB_SwitchType, m_pisdnci);
  101. SetSwitchType(m_hWnd, IDC_CMB_SwitchType, m_pisdnci->dwCurSwitchType);
  102. //Enable or disable the Configure button depending on the switch type selected.
  103. EnableDisableConfigure();
  104. // Note the current selections
  105. //
  106. m_pisdnci->nOldBChannel = (INT)SendDlgItemMessage(IDC_LBX_Variant,
  107. LB_GETCURSEL, 0, 0);
  108. m_pisdnci->nOldDChannel = (INT)SendDlgItemMessage(IDC_LBX_Line,
  109. LB_GETCURSEL, 0, 0);
  110. return 0;
  111. }
  112. LRESULT
  113. CIsdnPage::OnSwitchType(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  114. BOOL& bHandled)
  115. {
  116. if (wNotifyCode == CBN_SELCHANGE)
  117. {
  118. m_fDirty = TRUE;
  119. SetChangedFlag();
  120. //Enable or disable the Configure button depending on the switch type selected.
  121. EnableDisableConfigure();
  122. }
  123. return 0;
  124. }
  125. //+--------------------------------------------------------------------------
  126. //
  127. // Member: CIsdnPage::OnApply
  128. //
  129. // Purpose: Handler for the PSN_APPLY message
  130. //
  131. // Author: BillBe 10 Sep 1997
  132. //
  133. // Notes:
  134. //
  135. //
  136. LRESULT
  137. CIsdnPage::OnApply(int idCtrl, LPNMHDR pnmh, BOOL& bHandled)
  138. {
  139. // only do something if data has changed.
  140. if (m_fDirty)
  141. {
  142. // Update the switch type
  143. m_pisdnci->dwCurSwitchType = DwGetSwitchType(m_hWnd, m_pisdnci,
  144. IDC_CMB_SwitchType);
  145. // Write the parameters back out into the registry.
  146. (void) HrWriteIsdnPropertiesInfo(m_hkeyDriver, m_pisdnci);
  147. // Notify the UI that its display might need updating
  148. //
  149. SP_DEVINSTALL_PARAMS deip;
  150. // Try to get the current params
  151. (void) HrSetupDiGetDeviceInstallParams(m_hdi, m_pdeid, &deip);
  152. deip.FlagsEx |= DI_FLAGSEX_PROPCHANGE_PENDING;
  153. // Try to set the new params. If it fails, it is not
  154. // catastrophic so we ignore return values
  155. (void) HrSetupDiSetDeviceInstallParams(m_hdi, m_pdeid, &deip);
  156. // Changes have been applied so clear our dirty flag
  157. m_fDirty = FALSE;
  158. }
  159. return 0;
  160. }
  161. LRESULT
  162. CIsdnPage::OnConfigure(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  163. BOOL& bHandled)
  164. {
  165. DWORD dwSwitchType;
  166. dwSwitchType = DwGetSwitchType(m_hWnd, m_pisdnci, IDC_CMB_SwitchType);
  167. switch (dwSwitchType)
  168. {
  169. case ISDN_SWITCH_ATT:
  170. case ISDN_SWITCH_NI1:
  171. case ISDN_SWITCH_NI2:
  172. case ISDN_SWITCH_NTI:
  173. if (m_pisdnci->fIsPri)
  174. {
  175. // PRI adapters use the EAZ page instead
  176. DoEazDlg();
  177. }
  178. else
  179. {
  180. DoSpidsDlg();
  181. }
  182. break;
  183. case ISDN_SWITCH_INS64:
  184. DoJapanDlg();
  185. break;
  186. case ISDN_SWITCH_1TR6:
  187. case ISDN_SWITCH_AUTO:
  188. DoEazDlg();
  189. break;
  190. case ISDN_SWITCH_VN3:
  191. case ISDN_SWITCH_DSS1:
  192. case ISDN_SWITCH_AUS:
  193. case ISDN_SWITCH_BEL:
  194. case ISDN_SWITCH_VN4:
  195. case ISDN_SWITCH_SWE:
  196. case ISDN_SWITCH_ITA:
  197. case ISDN_SWITCH_TWN:
  198. DoMsnDlg();
  199. break;
  200. default:
  201. AssertSz(FALSE, "Where do we go from here.. now that all of our "
  202. "children are growin' up?");
  203. break;
  204. }
  205. return 0;
  206. }
  207. VOID CIsdnPage::DoSpidsDlg()
  208. {
  209. CSpidsDlg dlg(m_pisdnci);
  210. INT_PTR nRet;
  211. m_pisdnci->idd = dlg.IDD;
  212. nRet = dlg.DoModal(m_hWnd);
  213. if (nRet)
  214. {
  215. m_fDirty = TRUE;
  216. SetChangedFlag();
  217. }
  218. }
  219. VOID CIsdnPage::DoJapanDlg()
  220. {
  221. CJapanDlg dlg(m_pisdnci);
  222. INT_PTR nRet;
  223. m_pisdnci->idd = dlg.IDD;
  224. nRet = dlg.DoModal(m_hWnd);
  225. if (nRet)
  226. {
  227. m_fDirty = TRUE;
  228. SetChangedFlag();
  229. }
  230. }
  231. VOID CIsdnPage::DoEazDlg()
  232. {
  233. CEazDlg dlg(m_pisdnci);
  234. INT_PTR nRet;
  235. m_pisdnci->idd = dlg.IDD;
  236. nRet = dlg.DoModal(m_hWnd);
  237. if (nRet)
  238. {
  239. m_fDirty = TRUE;
  240. SetChangedFlag();
  241. }
  242. }
  243. VOID CIsdnPage::DoMsnDlg()
  244. {
  245. CMsnDlg dlg(m_pisdnci);
  246. INT_PTR nRet;
  247. m_pisdnci->idd = dlg.IDD;
  248. nRet = dlg.DoModal(m_hWnd);
  249. if (nRet)
  250. {
  251. m_fDirty = TRUE;
  252. SetChangedFlag();
  253. }
  254. }
  255. static const CONTEXTIDMAP c_adwContextIdMap[] =
  256. {
  257. { IDC_LBX_Line, 2003230, 2003230 },
  258. { IDC_LBX_Variant, 2003240, 2003240 },
  259. { IDC_EDT_PhoneNumber, 2003250, 2003255 },
  260. { IDC_EDT_SPID, 2003265, 2003260 },
  261. { IDC_EDT_MSN, 2003270, 2003270 },
  262. { IDC_PSB_ADD, 2003280, 2003280 },
  263. { IDC_LBX_MSN, 2003290, 2003290 },
  264. { IDC_PSB_REMOVE, 2003300, 2003300 },
  265. { IDC_CMB_SwitchType, 2003310, 2003310 },
  266. { IDC_PSB_Configure, 2003320, 2003320 },
  267. { 0, 0, 0 }, // end marker
  268. };
  269. LRESULT CIsdnPage::OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam,
  270. BOOL& bHandled)
  271. {
  272. OnHelpGeneric(m_hWnd, (LPHELPINFO)lParam, c_adwContextIdMap, m_pisdnci->idd == IDD_ISDN_JAPAN, c_szIsdnHelpFile);
  273. return TRUE;
  274. }
  275. LRESULT CIsdnPage::OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam,
  276. BOOL& bHandled)
  277. {
  278. HELPINFO hi;
  279. HMENU h = CreatePopupMenu();
  280. POINT pScreen;
  281. TCHAR szWhat[MAX_PATH];
  282. if (h == NULL)
  283. {
  284. return FALSE;
  285. }
  286. LoadString(_Module.GetResourceInstance(), IDS_ISDN_WHATS_THIS, szWhat, MAX_PATH);
  287. InsertMenu(h, -1, MF_BYPOSITION, 777, szWhat);
  288. pScreen.x = ((int)(short)LOWORD(lParam));
  289. pScreen.y = ((int)(short)HIWORD(lParam));
  290. int n;
  291. switch(n = TrackPopupMenu(h, TPM_NONOTIFY | TPM_RETURNCMD, pScreen.x, pScreen.y, 0, m_hWnd, NULL))
  292. {
  293. case 777:
  294. hi.iContextType = HELPINFO_WINDOW;
  295. hi.iCtrlId = ::GetWindowLong((HWND)wParam, GWL_ID);
  296. OnHelpGeneric(m_hWnd, &hi, c_adwContextIdMap, m_pisdnci->idd == IDD_ISDN_JAPAN, c_szIsdnHelpFile);
  297. break;
  298. }
  299. DestroyMenu(h);
  300. return TRUE;
  301. }
  302. VOID CIsdnPage::EnableDisableConfigure ()
  303. {
  304. DWORD dwSwitchType;
  305. HWND hwndConfigure;
  306. dwSwitchType = DwGetSwitchType(m_hWnd, m_pisdnci, IDC_CMB_SwitchType);
  307. hwndConfigure = ::GetDlgItem(m_hWnd, IDC_PSB_Configure);
  308. Assert(hwndConfigure);
  309. if (hwndConfigure)
  310. {
  311. switch (dwSwitchType)
  312. {
  313. case ISDN_SWITCH_ATT:
  314. case ISDN_SWITCH_NI1:
  315. case ISDN_SWITCH_NI2:
  316. case ISDN_SWITCH_NTI:
  317. case ISDN_SWITCH_AUTO:
  318. if (m_pisdnci->fIsPri)
  319. {
  320. ::EnableWindow(hwndConfigure, FALSE);
  321. }
  322. else
  323. {
  324. ::EnableWindow(hwndConfigure, TRUE);
  325. }
  326. break;
  327. default:
  328. ::EnableWindow(hwndConfigure, TRUE);
  329. }
  330. }
  331. return;
  332. }
  333. //+---------------------------------------------------------------------------
  334. //
  335. // Function: HrGetIsdnPage
  336. //
  337. // Purpose: Creates the Isdn page for enumerated net devices.
  338. // This function is called by the NetPropPageProvider fcn.
  339. //
  340. // Arguments:
  341. // hdi [in] See SetupApi for info
  342. // pdeid [in] See SetupApi for for info
  343. // phpsp [out] Pointer to the handle to the isdn property page
  344. //
  345. // Returns:
  346. //
  347. // Author: billbe 9 Sep 1997
  348. //
  349. // Notes:
  350. //
  351. HRESULT
  352. HrGetIsdnPage(HDEVINFO hdi, PSP_DEVINFO_DATA pdeid,
  353. HPROPSHEETPAGE* phpsp)
  354. {
  355. Assert(hdi);
  356. Assert(pdeid);
  357. Assert(phpsp);
  358. HRESULT hr;
  359. HPROPSHEETPAGE hpsp;
  360. CIsdnPage* pisdn = new CIsdnPage();
  361. if (pisdn == NULL)
  362. {
  363. return(ERROR_NOT_ENOUGH_MEMORY);
  364. }
  365. // create the isdn page
  366. hpsp = pisdn->CreatePage(hdi, pdeid);
  367. // if successful, set the out param
  368. if (hpsp)
  369. {
  370. *phpsp = hpsp;
  371. hr = S_OK;
  372. }
  373. else
  374. {
  375. // Either there is no isdn page to display or there
  376. // was an error.
  377. hr = E_FAIL;
  378. *phpsp = NULL;
  379. delete pisdn;
  380. }
  381. TraceErrorOptional("HrGetIsdnPage", hr, E_FAIL == hr);
  382. return (hr);
  383. }
  384. LRESULT CSpidsDlg::OnOk(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  385. BOOL& bHandled)
  386. {
  387. OnIsdnInfoPageTransition(m_hWnd, m_pisdnci);
  388. EndDialog(TRUE);
  389. return 0;
  390. }
  391. LRESULT CSpidsDlg::OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  392. BOOL& bHandled)
  393. {
  394. EndDialog(FALSE);
  395. return 0;
  396. }
  397. LRESULT CSpidsDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam,
  398. BOOL& bHandled)
  399. {
  400. // Populate the channels from the array of B-Channels stored in our
  401. // config info for the first D-Channel
  402. //
  403. PopulateIsdnChannels(m_hWnd, IDC_EDT_SPID, IDC_EDT_PhoneNumber,
  404. IDC_LBX_Line, IDC_LBX_Variant, m_pisdnci);
  405. ::SetFocus(GetDlgItem(IDC_EDT_PhoneNumber));
  406. // Note the current selections
  407. //
  408. m_pisdnci->nOldBChannel = (INT)SendDlgItemMessage(IDC_LBX_Variant,
  409. LB_GETCURSEL, 0, 0);
  410. m_pisdnci->nOldDChannel = (INT)SendDlgItemMessage(IDC_LBX_Line,
  411. LB_GETCURSEL, 0, 0);
  412. SendDlgItemMessage(IDC_EDT_SPID, EM_LIMITTEXT, c_cchMaxSpid, 0);
  413. SendDlgItemMessage(IDC_EDT_PhoneNumber, EM_LIMITTEXT, c_cchMaxOther, 0);
  414. return FALSE;
  415. }
  416. LRESULT CSpidsDlg::OnSelChange(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  417. BOOL& bHandled)
  418. {
  419. if (wNotifyCode == LBN_SELCHANGE)
  420. {
  421. OnIsdnInfoPageSelChange(m_hWnd, m_pisdnci);
  422. }
  423. return 0;
  424. }
  425. LRESULT CSpidsDlg::OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam,
  426. BOOL& bHandled)
  427. {
  428. OnHelpGeneric(m_hWnd, (LPHELPINFO)lParam, c_adwContextIdMap, m_pisdnci->idd == IDD_ISDN_JAPAN, c_szIsdnHelpFile);
  429. return TRUE;
  430. }
  431. //
  432. // CEazDlg Implementation
  433. //
  434. LRESULT CEazDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam,
  435. BOOL& bHandled)
  436. {
  437. // Populate the channels from the array of B-Channels stored in our
  438. // config info for the first D-Channel
  439. //
  440. PopulateIsdnChannels(m_hWnd, IDC_EDT_SPID, IDC_EDT_PhoneNumber,
  441. IDC_LBX_Line, IDC_LBX_Variant, m_pisdnci);
  442. ::SetFocus(GetDlgItem(IDC_EDT_PhoneNumber));
  443. // Note the current selections
  444. //
  445. m_pisdnci->nOldBChannel = (INT)SendDlgItemMessage(IDC_LBX_Variant,
  446. LB_GETCURSEL, 0, 0);
  447. m_pisdnci->nOldDChannel = (INT)SendDlgItemMessage(IDC_LBX_Line,
  448. LB_GETCURSEL, 0, 0);
  449. SendDlgItemMessage(IDC_EDT_PhoneNumber, EM_LIMITTEXT, c_cchMaxOther, 0);
  450. return FALSE;
  451. }
  452. LRESULT CEazDlg::OnOk(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  453. BOOL& bHandled)
  454. {
  455. OnIsdnInfoPageTransition(m_hWnd, m_pisdnci);
  456. EndDialog(TRUE);
  457. return 0;
  458. }
  459. LRESULT CEazDlg::OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  460. BOOL& bHandled)
  461. {
  462. EndDialog(FALSE);
  463. return 0;
  464. }
  465. LRESULT CEazDlg::OnSelChange(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  466. BOOL& bHandled)
  467. {
  468. if (wNotifyCode == LBN_SELCHANGE)
  469. {
  470. OnIsdnInfoPageSelChange(m_hWnd, m_pisdnci);
  471. }
  472. return 0;
  473. }
  474. LRESULT CEazDlg::OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam,
  475. BOOL& bHandled)
  476. {
  477. OnHelpGeneric(m_hWnd, (LPHELPINFO)lParam, c_adwContextIdMap, m_pisdnci->idd == IDD_ISDN_JAPAN, c_szIsdnHelpFile);
  478. return TRUE;
  479. }
  480. //
  481. // CMsnDlg Implementation
  482. //
  483. LRESULT CMsnDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam,
  484. BOOL& bHandled)
  485. {
  486. OnMsnPageInitDialog(m_hWnd, m_pisdnci);
  487. // Note the current selections
  488. //
  489. m_pisdnci->nOldDChannel = (INT)SendDlgItemMessage(IDC_LBX_Line,
  490. LB_GETCURSEL, 0, 0);
  491. SendDlgItemMessage(IDC_EDT_MSN, EM_LIMITTEXT, c_cchMaxOther, 0);
  492. return FALSE;
  493. }
  494. LRESULT CMsnDlg::OnOk(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  495. BOOL& bHandled)
  496. {
  497. INT iCurSel;
  498. iCurSel = (INT)SendDlgItemMessage(IDC_LBX_Line, LB_GETCURSEL, 0, 0);
  499. if (iCurSel != LB_ERR)
  500. {
  501. GetDataFromListBox(iCurSel, m_hWnd, m_pisdnci);
  502. }
  503. EndDialog(TRUE);
  504. return 0;
  505. }
  506. LRESULT CMsnDlg::OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  507. BOOL& bHandled)
  508. {
  509. EndDialog(FALSE);
  510. return 0;
  511. }
  512. LRESULT CMsnDlg::OnAdd(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  513. BOOL& bHandled)
  514. {
  515. OnMsnPageAdd(m_hWnd, m_pisdnci);
  516. return 0;
  517. }
  518. LRESULT CMsnDlg::OnRemove(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  519. BOOL& bHandled)
  520. {
  521. OnMsnPageRemove(m_hWnd, m_pisdnci);
  522. return 0;
  523. }
  524. LRESULT CMsnDlg::OnChange(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  525. BOOL& bHandled)
  526. {
  527. OnMsnPageEditSelChange(m_hWnd, m_pisdnci);
  528. return 0;
  529. }
  530. LRESULT CMsnDlg::OnSelChange(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  531. BOOL& bHandled)
  532. {
  533. if (wNotifyCode == LBN_SELCHANGE)
  534. {
  535. OnMsnPageSelChange(m_hWnd, m_pisdnci);
  536. }
  537. return 0;
  538. }
  539. LRESULT CMsnDlg::OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam,
  540. BOOL& bHandled)
  541. {
  542. OnHelpGeneric(m_hWnd, (LPHELPINFO)lParam, c_adwContextIdMap, m_pisdnci->idd == IDD_ISDN_JAPAN, c_szIsdnHelpFile);
  543. return TRUE;
  544. }
  545. //
  546. // CJapanDlg Implementation
  547. //
  548. LRESULT CJapanDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam,
  549. BOOL& bHandled)
  550. {
  551. // Populate the channels from the array of B-Channels stored in our
  552. // config info for the first D-Channel
  553. //
  554. PopulateIsdnChannels(m_hWnd, IDC_EDT_SPID, IDC_EDT_PhoneNumber,
  555. IDC_LBX_Line, IDC_LBX_Variant, m_pisdnci);
  556. ::SetFocus(GetDlgItem(IDC_EDT_PhoneNumber));
  557. // Note the current selections
  558. //
  559. m_pisdnci->nOldBChannel = (INT)SendDlgItemMessage(IDC_LBX_Variant,
  560. LB_GETCURSEL, 0, 0);
  561. m_pisdnci->nOldDChannel = (INT)SendDlgItemMessage(IDC_LBX_Line,
  562. LB_GETCURSEL, 0, 0);
  563. SendDlgItemMessage(IDC_EDT_PhoneNumber, EM_LIMITTEXT, c_cchMaxOther, 0);
  564. SendDlgItemMessage(IDC_EDT_SPID, EM_LIMITTEXT, c_cchMaxOther, 0);
  565. return FALSE;
  566. }
  567. LRESULT CJapanDlg::OnOk(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  568. BOOL& bHandled)
  569. {
  570. OnIsdnInfoPageTransition(m_hWnd, m_pisdnci);
  571. EndDialog(TRUE);
  572. return 0;
  573. }
  574. LRESULT CJapanDlg::OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  575. BOOL& bHandled)
  576. {
  577. EndDialog(FALSE);
  578. return 0;
  579. }
  580. LRESULT CJapanDlg::OnSelChange(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  581. BOOL& bHandled)
  582. {
  583. if (wNotifyCode == LBN_SELCHANGE)
  584. {
  585. OnIsdnInfoPageSelChange(m_hWnd, m_pisdnci);
  586. }
  587. return 0;
  588. }
  589. LRESULT CJapanDlg::OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam,
  590. BOOL& bHandled)
  591. {
  592. OnHelpGeneric(m_hWnd, (LPHELPINFO)lParam, c_adwContextIdMap, m_pisdnci->idd == IDD_ISDN_JAPAN, c_szIsdnHelpFile);
  593. return TRUE;
  594. }