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.

124 lines
2.6 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1991-1996 **/
  4. /**********************************************************************/
  5. /*
  6. What.cpp
  7. Property Page support for Group management wizard
  8. FILE HISTORY:
  9. jony Apr-1996 created
  10. */
  11. #include "stdafx.h"
  12. #include "Romaine.h"
  13. #include "What.h"
  14. #include <lmcons.h>
  15. #include <lmaccess.h>
  16. #include <lmerr.h>
  17. #ifdef _DEBUG
  18. #define new DEBUG_NEW
  19. #undef THIS_FILE
  20. static char THIS_FILE[] = __FILE__;
  21. #endif
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CWhat property page
  24. IMPLEMENT_DYNCREATE(CWhat, CPropertyPage)
  25. CWhat::CWhat() : CPropertyPage(CWhat::IDD)
  26. {
  27. //{{AFX_DATA_INIT(CWhat)
  28. m_csGroupName = _T("");
  29. m_csDescription = _T("");
  30. //}}AFX_DATA_INIT
  31. }
  32. CWhat::~CWhat()
  33. {
  34. }
  35. void CWhat::DoDataExchange(CDataExchange* pDX)
  36. {
  37. CPropertyPage::DoDataExchange(pDX);
  38. //{{AFX_DATA_MAP(CWhat)
  39. DDX_Text(pDX, IDC_GROUP_NAME, m_csGroupName);
  40. DDX_Text(pDX, IDC_DESCRIPTION, m_csDescription);
  41. //}}AFX_DATA_MAP
  42. }
  43. BEGIN_MESSAGE_MAP(CWhat, CPropertyPage)
  44. //{{AFX_MSG_MAP(CWhat)
  45. ON_WM_SHOWWINDOW()
  46. //}}AFX_MSG_MAP
  47. END_MESSAGE_MAP()
  48. /////////////////////////////////////////////////////////////////////////////
  49. // CWhat message handlers
  50. LRESULT CWhat::OnWizardNext()
  51. {
  52. UpdateData(TRUE);
  53. CWnd* pWnd = GetDlgItem(IDC_GROUP_NAME);
  54. CRomaineApp* pApp = (CRomaineApp*)AfxGetApp();
  55. if (m_csGroupName == "")
  56. {
  57. AfxMessageBox(IDS_NO_GROUP_NAME);
  58. pWnd->SetFocus();
  59. return -1;
  60. }
  61. if (m_csGroupName.FindOneOf(L"\"\\/[];:|=,+*?<>") != -1)
  62. {
  63. AfxMessageBox(IDS_GROUP_INVALID_NAME);
  64. pWnd->SetFocus();
  65. return -1;
  66. }
  67. if (m_csGroupName.GetLength() > 20)
  68. {
  69. AfxMessageBox(IDS_GROUP_INVALID_NAME);
  70. pWnd->SetFocus();
  71. return -1;
  72. }
  73. pApp->m_csGroupName = m_csGroupName;
  74. pApp->m_csGroupDesc = m_csDescription;
  75. return CPropertyPage::OnWizardNext();
  76. }
  77. void CWhat::OnShowWindow(BOOL bShow, UINT nStatus)
  78. {
  79. CPropertyPage::OnShowWindow(bShow, nStatus);
  80. CRomaineApp* pApp = (CRomaineApp*)AfxGetApp();
  81. if (bShow)
  82. {
  83. GetDlgItem(IDC_GROUP_NAME)->SetFocus();
  84. pApp->m_cps1.SetWizardButtons(PSWIZB_NEXT | PSWIZB_BACK);
  85. if (pApp->bRestart1 == TRUE)
  86. {
  87. m_csGroupName = _T("");
  88. m_csDescription = _T("");
  89. UpdateData(FALSE);
  90. pApp->bRestart1 == FALSE;
  91. }
  92. }
  93. }
  94. LRESULT CWhat::OnWizardBack()
  95. {
  96. CRomaineApp* pApp = (CRomaineApp*)AfxGetApp();
  97. pApp->m_cps1.SetWizardButtons(PSWIZB_NEXT);
  98. return CPropertyPage::OnWizardBack();
  99. }