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.

136 lines
3.4 KiB

  1. /****************************************************************************************
  2. * NAME: PolicyLocDlg.cpp
  3. *
  4. * CLASS: CPolicyLocationDialog
  5. *
  6. * OVERVIEW
  7. *
  8. * Internet Authentication Server:
  9. * This dialog box is used to change the Network Access Policy Location
  10. *
  11. * Copyright (C) Microsoft Corporation, 1998 - 1999 . All Rights Reserved.
  12. *
  13. * History:
  14. * 4/12/98 Created by Byao
  15. *
  16. *****************************************************************************************/
  17. #include "Precompiled.h"
  18. #include "PolicyLocDlg.h"
  19. // Constructor/Destructor
  20. CPolicyLocationDialog::CPolicyLocationDialog(BOOL fChooseDS, BOOL fDSAvailable)
  21. {
  22. m_fChooseDS = fChooseDS;
  23. m_fDSAvailable = fDSAvailable;
  24. }
  25. CPolicyLocationDialog::~CPolicyLocationDialog()
  26. {
  27. }
  28. LRESULT CPolicyLocationDialog::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  29. {
  30. TRACE_FUNCTION("CPolicyLocationDialog::OnInitDialog");
  31. if ( !m_fDSAvailable )
  32. {
  33. ::EnableWindow(GetDlgItem(IDC_RADIO_STORE_ACTIVEDS), FALSE);
  34. }
  35. if ( m_fChooseDS )
  36. {
  37. CheckDlgButton(IDC_RADIO_STORE_ACTIVEDS, BST_CHECKED);
  38. CheckDlgButton(IDC_RADIO_STORE_LOCAL, BST_UNCHECKED);
  39. }
  40. else
  41. {
  42. CheckDlgButton(IDC_RADIO_STORE_ACTIVEDS, BST_UNCHECKED);
  43. CheckDlgButton(IDC_RADIO_STORE_LOCAL, BST_CHECKED);
  44. }
  45. return 1; // Let the system set the focus
  46. }
  47. LRESULT CPolicyLocationDialog::OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  48. {
  49. TRACE_FUNCTION("CPolicyLocationDialog::OnOK");
  50. EndDialog(wID);
  51. return 0;
  52. }
  53. LRESULT CPolicyLocationDialog::OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  54. {
  55. TRACE_FUNCTION("CPolicyLocationDialog::OnCancel");
  56. EndDialog(wID);
  57. return 0;
  58. }
  59. //+---------------------------------------------------------------------------
  60. //
  61. // Function: CPolicyLocationDialog::OnActiveDS
  62. //
  63. // Synopsis: User decided to use policies from the Active Directory
  64. //
  65. // Arguments: WORD wNotifyCode -
  66. // WORD wID -
  67. // HWND hWndCtl -
  68. // BOOL& bHandled -
  69. //
  70. // Returns: LRESULT -
  71. //
  72. // History: Created Header byao 4/13/98 5:26:42 PM
  73. //
  74. //+---------------------------------------------------------------------------
  75. LRESULT CPolicyLocationDialog::OnActiveDS(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  76. {
  77. TRACE_FUNCTION("CPolicyLocationDialog::OnActiveDS");
  78. if ( wNotifyCode == BN_CLICKED )
  79. {
  80. CheckDlgButton(IDC_RADIO_STORE_ACTIVEDS, BST_CHECKED);
  81. CheckDlgButton(IDC_RADIO_STORE_LOCAL, BST_UNCHECKED);
  82. m_fChooseDS = TRUE;
  83. }
  84. return 0;
  85. }
  86. //+---------------------------------------------------------------------------
  87. //
  88. // Function: CPolicyLocationDialog::OnLocale
  89. //
  90. // Synopsis: User has decided to use policies from the local machine
  91. //
  92. // Arguments: WORD wNotifyCode -
  93. // WORD wID -
  94. // HWND hWndCtl -
  95. // BOOL& bHandled -
  96. //
  97. // Returns: LRESULT -
  98. //
  99. // History: Created Header byao 4/13/98 5:27:04 PM
  100. //
  101. //+---------------------------------------------------------------------------
  102. LRESULT CPolicyLocationDialog::OnLocale(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  103. {
  104. TRACE_FUNCTION("CPolicyLocationDialog::OnLocale");
  105. if ( wNotifyCode == BN_CLICKED )
  106. {
  107. CheckDlgButton(IDC_RADIO_STORE_ACTIVEDS, BST_UNCHECKED);
  108. CheckDlgButton(IDC_RADIO_STORE_LOCAL, BST_CHECKED);
  109. m_fChooseDS = FALSE;
  110. }
  111. return 0;
  112. }