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.

114 lines
2.6 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Windows NT Secure Server Roles Security Configuration Wizard
  4. //
  5. // Microsoft Windows
  6. // Copyright (C) Microsoft Corporation, 1992 - 2002
  7. //
  8. // File: ServiceSelPage.cxx
  9. //
  10. // History: 30-Oct-01 Yanggao created
  11. //
  12. //-----------------------------------------------------------------------------
  13. #include "pch.h"
  14. #include "resource.h"
  15. #include "misc.h"
  16. #include "state.h"
  17. #include "chklist.h"
  18. #include "ServiceSelPage.h"
  19. //////////////////////////////////////////////////////////////////////////////////
  20. // Service Enabled Page
  21. //
  22. //////////////////////////////////////////////////////////////////////////////////
  23. ServiceEnabledPage::ServiceEnabledPage()
  24. :
  25. Dialog(IDD_SERVICE_ENABLED, 0) //no help map
  26. {
  27. LOG_CTOR(ServiceEnabledPage);
  28. }
  29. ServiceEnabledPage::~ServiceEnabledPage()
  30. {
  31. LOG_DTOR(ServiceEnabledPage);
  32. }
  33. void
  34. ServiceEnabledPage::OnInit()
  35. {
  36. LOG_FUNCTION(ServiceEnabledPage::OnInit);
  37. HWND hWnd = Win::GetDlgItem(hwnd, IDC_CHECKBOX);
  38. if (!hWnd) {
  39. return;
  40. }
  41. Win::SendMessage(hWnd, CLM_RESETCONTENT,0,0);
  42. //get enabled services and add them into the checklist box.
  43. /*HRESULT hr = S_OK;
  44. ServiceObject * pService;
  45. int nIndex = (int) Win::SendMessage(hWnd,
  46. CLM_ADDITEM,
  47. (WPARAM)pService->serviceName,
  48. (LPARAM)0);
  49. if (nIndex != -1)
  50. {
  51. BOOL bSet;
  52. //First column setting
  53. bSet = CLST_CHECKED;
  54. Win::SendMessage(hWnd,
  55. CLM_SETSTATE,
  56. MAKELONG(nIndex,1),
  57. bSet ? CLST_CHECKED : CLST_UNCHECKED);
  58. }*/
  59. }
  60. bool
  61. ServiceEnabledPage::OnCommand(
  62. HWND /*windowFrom*/,
  63. unsigned controlIDFrom,
  64. unsigned /*code*/)
  65. {
  66. LOG_FUNCTION(ServiceEnabledPage::OnCommand);
  67. // State& state = State::GetInstance();
  68. switch (controlIDFrom)
  69. {
  70. case IDOK:
  71. Win::EndDialog(hwnd, IDOK);
  72. return true;
  73. case IDCANCEL:
  74. Win::EndDialog(hwnd, IDCANCEL);
  75. return true;
  76. default:
  77. break;
  78. }
  79. return false;
  80. }
  81. bool
  82. ServiceEnabledPage::OnMessage(
  83. UINT message,
  84. WPARAM /*wparam*/,
  85. LPARAM /*lparam*/)
  86. {
  87. LOG_FUNCTION(ServiceEnabledPage::OnMessage);
  88. switch (message)
  89. {
  90. case WM_COMMAND:
  91. default:
  92. {
  93. // do nothing
  94. break;
  95. }
  96. }
  97. return false;
  98. }