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.

125 lines
3.4 KiB

  1. // ShrPgSFM.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ShrPgSFM.h"
  5. #include "SFMhelp.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CSharePageGeneralSFM property page
  13. IMPLEMENT_DYNCREATE(CSharePageGeneralSFM, CSharePageGeneral)
  14. CSharePageGeneralSFM::CSharePageGeneralSFM() : CSharePageGeneral(CSharePageGeneralSFM::IDD)
  15. {
  16. //{{AFX_DATA_INIT(CSharePageGeneralSFM)
  17. m_strSfmPassword = _T("");
  18. m_bSfmReadonly = FALSE;
  19. //}}AFX_DATA_INIT
  20. }
  21. CSharePageGeneralSFM::~CSharePageGeneralSFM()
  22. {
  23. }
  24. void CSharePageGeneralSFM::DoDataExchange(CDataExchange* pDX)
  25. {
  26. CSharePageGeneral::DoDataExchange(pDX);
  27. //{{AFX_DATA_MAP(CSharePageGeneralSFM)
  28. DDX_Control(pDX, IDC_SFM_CHECK_READONLY, m_checkboxSfmReadonly);
  29. DDX_Control(pDX, IDC_SFM_EDIT_PASSWORD, m_editSfmPassword);
  30. DDX_Control(pDX, IDC_SFM_GROUPBOX, m_groupboxSfm);
  31. DDX_Control(pDX, IDC_SFM_STATIC1, m_staticSfmText);
  32. DDX_Text(pDX, IDC_SFM_EDIT_PASSWORD, m_strSfmPassword);
  33. DDV_MaxChars(pDX, m_strSfmPassword, 8); // AFP_VOLPASS_LEN
  34. DDX_Check(pDX, IDC_SFM_CHECK_READONLY, m_bSfmReadonly);
  35. //}}AFX_DATA_MAP
  36. }
  37. BEGIN_MESSAGE_MAP(CSharePageGeneralSFM, CSharePageGeneral)
  38. //{{AFX_MSG_MAP(CSharePageGeneralSFM)
  39. ON_BN_CLICKED(IDC_SFM_CHECK_READONLY, OnSfmCheckReadonly)
  40. ON_EN_CHANGE(IDC_SFM_EDIT_PASSWORD, OnChangeSfmEditPassword)
  41. ON_MESSAGE(WM_HELP, OnHelp)
  42. ON_MESSAGE(WM_CONTEXTMENU, OnContextHelp)
  43. //}}AFX_MSG_MAP
  44. END_MESSAGE_MAP()
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CSharePageGeneralSFM message handlers
  47. BOOL CSharePageGeneralSFM::Load( CFileMgmtComponentData* pFileMgmtData, LPDATAOBJECT piDataObject )
  48. {
  49. if ( CSharePageGeneral::Load (pFileMgmtData, piDataObject) )
  50. {
  51. ReadSfmSettings();
  52. }
  53. else
  54. return FALSE;
  55. return TRUE;
  56. }
  57. // These two functions are implemented in sfm.cpp:
  58. // void CSharePageGeneralSFM::ReadSfmSettings()
  59. // void CSharePageGeneralSFM::WriteSfmSettings()
  60. BOOL CSharePageGeneralSFM::OnApply()
  61. {
  62. // UpdateData (TRUE) has already been called by OnKillActive () just before OnApply ()
  63. // if ( !UpdateData(TRUE) )
  64. // return FALSE;
  65. WriteSfmSettings();
  66. return CSharePageGeneral::OnApply();
  67. }
  68. void CSharePageGeneralSFM::OnSfmCheckReadonly()
  69. {
  70. SetModified (TRUE);
  71. }
  72. void CSharePageGeneralSFM::OnChangeSfmEditPassword()
  73. {
  74. SetModified (TRUE);
  75. }
  76. /////////////////////////////////////////////////////////////////////
  77. // Help
  78. BOOL CSharePageGeneralSFM::OnHelp(WPARAM wParam, LPARAM lParam)
  79. {
  80. LPHELPINFO lphi = (LPHELPINFO) lParam;
  81. if ( HELPINFO_WINDOW == lphi->iContextType ) // a control
  82. {
  83. if (IDC_SFM_EDIT_PASSWORD == lphi->iCtrlId ||
  84. IDC_SFM_CHECK_READONLY == lphi->iCtrlId)
  85. {
  86. return ::WinHelp ((HWND) lphi->hItemHandle, L"sfmmgr.hlp",
  87. HELP_WM_HELP,
  88. g_aHelpIDs_CONFIGURE_SFM);
  89. }
  90. }
  91. return CSharePageGeneral::OnHelp (wParam, lParam);
  92. }
  93. BOOL CSharePageGeneralSFM::OnContextHelp(WPARAM wParam, LPARAM lParam)
  94. {
  95. int ctrlID = ::GetDlgCtrlID ((HWND) wParam);
  96. if (IDC_SFM_EDIT_PASSWORD == ctrlID ||
  97. IDC_SFM_CHECK_READONLY == ctrlID)
  98. {
  99. return ::WinHelp ((HWND) wParam, L"sfmmgr.hlp", HELP_CONTEXTMENU,
  100. g_aHelpIDs_CONFIGURE_SFM);
  101. }
  102. return CSharePageGeneral::OnContextHelp (wParam, lParam);
  103. }