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.

136 lines
3.7 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. m_bSfmGuests = FALSE;
  20. //}}AFX_DATA_INIT
  21. }
  22. CSharePageGeneralSFM::~CSharePageGeneralSFM()
  23. {
  24. }
  25. void CSharePageGeneralSFM::DoDataExchange(CDataExchange* pDX)
  26. {
  27. CSharePageGeneral::DoDataExchange(pDX);
  28. //{{AFX_DATA_MAP(CSharePageGeneralSFM)
  29. DDX_Control(pDX, IDC_SFM_CHECK_READONLY, m_checkboxSfmReadonly);
  30. DDX_Control(pDX, IDC_SFM_CHECK_GUESTS, m_checkboxSfmGuests);
  31. DDX_Control(pDX, IDC_SFM_EDIT_PASSWORD, m_editSfmPassword);
  32. DDX_Control(pDX, IDC_SFM_GROUPBOX, m_groupboxSfm);
  33. DDX_Control(pDX, IDC_SFM_STATIC1, m_staticSfmText);
  34. DDX_Text(pDX, IDC_SFM_EDIT_PASSWORD, m_strSfmPassword);
  35. DDV_MaxChars(pDX, m_strSfmPassword, 8); // AFP_VOLPASS_LEN
  36. DDX_Check(pDX, IDC_SFM_CHECK_READONLY, m_bSfmReadonly);
  37. DDX_Check(pDX, IDC_SFM_CHECK_GUESTS, m_bSfmGuests);
  38. //}}AFX_DATA_MAP
  39. }
  40. BEGIN_MESSAGE_MAP(CSharePageGeneralSFM, CSharePageGeneral)
  41. //{{AFX_MSG_MAP(CSharePageGeneralSFM)
  42. ON_BN_CLICKED(IDC_SFM_CHECK_GUESTS, OnSfmCheckGuests)
  43. ON_BN_CLICKED(IDC_SFM_CHECK_READONLY, OnSfmCheckReadonly)
  44. ON_EN_CHANGE(IDC_SFM_EDIT_PASSWORD, OnChangeSfmEditPassword)
  45. ON_MESSAGE(WM_HELP, OnHelp)
  46. ON_MESSAGE(WM_CONTEXTMENU, OnContextHelp)
  47. //}}AFX_MSG_MAP
  48. END_MESSAGE_MAP()
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CSharePageGeneralSFM message handlers
  51. BOOL CSharePageGeneralSFM::Load( CFileMgmtComponentData* pFileMgmtData, LPDATAOBJECT piDataObject )
  52. {
  53. if ( CSharePageGeneral::Load (pFileMgmtData, piDataObject) )
  54. {
  55. ReadSfmSettings();
  56. }
  57. else
  58. return FALSE;
  59. return TRUE;
  60. }
  61. // These two functions are implemented in sfm.cpp:
  62. // void CSharePageGeneralSFM::ReadSfmSettings()
  63. // void CSharePageGeneralSFM::WriteSfmSettings()
  64. BOOL CSharePageGeneralSFM::OnApply()
  65. {
  66. // UpdateData (TRUE) has already been called by OnKillActive () just before OnApply ()
  67. // if ( !UpdateData(TRUE) )
  68. // return FALSE;
  69. WriteSfmSettings();
  70. return CSharePageGeneral::OnApply();
  71. }
  72. void CSharePageGeneralSFM::OnSfmCheckGuests()
  73. {
  74. SetModified (TRUE);
  75. }
  76. void CSharePageGeneralSFM::OnSfmCheckReadonly()
  77. {
  78. SetModified (TRUE);
  79. }
  80. void CSharePageGeneralSFM::OnChangeSfmEditPassword()
  81. {
  82. SetModified (TRUE);
  83. }
  84. /////////////////////////////////////////////////////////////////////
  85. // Help
  86. BOOL CSharePageGeneralSFM::OnHelp(WPARAM wParam, LPARAM lParam)
  87. {
  88. LPHELPINFO lphi = (LPHELPINFO) lParam;
  89. if ( HELPINFO_WINDOW == lphi->iContextType ) // a control
  90. {
  91. if (IDC_SFM_EDIT_PASSWORD == lphi->iCtrlId ||
  92. IDC_SFM_CHECK_READONLY == lphi->iCtrlId ||
  93. IDC_SFM_CHECK_GUESTS == lphi->iCtrlId)
  94. {
  95. return ::WinHelp ((HWND) lphi->hItemHandle, L"sfmmgr.hlp",
  96. HELP_WM_HELP,
  97. g_aHelpIDs_CONFIGURE_SFM);
  98. }
  99. }
  100. return CSharePageGeneral::OnHelp (wParam, lParam);
  101. }
  102. BOOL CSharePageGeneralSFM::OnContextHelp(WPARAM wParam, LPARAM lParam)
  103. {
  104. int ctrlID = ::GetDlgCtrlID ((HWND) wParam);
  105. if (IDC_SFM_EDIT_PASSWORD == ctrlID ||
  106. IDC_SFM_CHECK_READONLY == ctrlID ||
  107. IDC_SFM_CHECK_GUESTS == ctrlID)
  108. {
  109. return ::WinHelp ((HWND) wParam, L"sfmmgr.hlp", HELP_CONTEXTMENU,
  110. g_aHelpIDs_CONFIGURE_SFM);
  111. }
  112. return CSharePageGeneral::OnContextHelp (wParam, lParam);
  113. }