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.

164 lines
3.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: finish.cxx
  9. //
  10. // Contents: Finish Page.
  11. //
  12. // History: 2-Oct-01 EricB created
  13. //
  14. //-----------------------------------------------------------------------------
  15. #include "pch.h"
  16. #include "resource.h"
  17. #include "misc.h"
  18. #include "state.h"
  19. #include "finish.h"
  20. FinishPage::FinishPage()
  21. :
  22. WizardPage(
  23. IDD_FINISH,
  24. IDS_FINISH_PAGE_TITLE,
  25. IDS_FINISH_PAGE_SUBTITLE,
  26. false)
  27. {
  28. LOG_CTOR(FinishPage);
  29. }
  30. FinishPage::~FinishPage()
  31. {
  32. LOG_DTOR(FinishPage);
  33. }
  34. void
  35. FinishPage::OnInit()
  36. {
  37. LOG_FUNCTION(FinishPage::OnInit);
  38. SetLargeFont(hwnd, IDC_BIG_BOLD_TITLE);
  39. Win::PropSheet_CancelToClose(Win::GetParent(hwnd));
  40. }
  41. bool
  42. FinishPage::OnSetActive()
  43. {
  44. LOG_FUNCTION(FinishPage::OnSetActive);
  45. Win::PropSheet_SetWizButtons(
  46. Win::GetParent(hwnd),
  47. PSWIZB_FINISH);
  48. return true;
  49. }
  50. bool
  51. FinishPage::OnCommand(
  52. HWND windowFrom,
  53. unsigned controlIdFrom,
  54. unsigned code)
  55. {
  56. bool result = false;
  57. UNREFERENCED_PARAMETER(code);
  58. UNREFERENCED_PARAMETER(controlIdFrom);
  59. UNREFERENCED_PARAMETER(windowFrom);
  60. /*
  61. switch (controlIdFrom)
  62. {
  63. case IDCANCEL:
  64. {
  65. // multi-line edit control eats escape keys. This is a workaround
  66. // from ericb, to forward the message to the prop sheet.
  67. Win::SendMessage(
  68. Win::GetParent(hwnd),
  69. WM_COMMAND,
  70. MAKEWPARAM(controlIdFrom, code),
  71. (LPARAM) windowFrom);
  72. break;
  73. }
  74. case IDC_MESSAGE:
  75. {
  76. switch (code)
  77. {
  78. case EN_SETFOCUS:
  79. {
  80. if (needToKillSelection)
  81. {
  82. // kill the text selection
  83. Win::Edit_SetSel(windowFrom, -1, -1);
  84. needToKillSelection = false;
  85. result = true;
  86. }
  87. break;
  88. }
  89. case MultiLineEditBoxThatForwardsEnterKey::FORWARDED_ENTER:
  90. {
  91. // our subclasses mutli-line edit control will send us
  92. // WM_COMMAND messages when the enter key is pressed. We
  93. // reinterpret this message as a press on the default button of
  94. // the prop sheet.
  95. // This workaround from phellyar.
  96. // NTRAID#NTBUG9-232092-2001/07/02-sburns
  97. // CODEWORK: There are several instances of this code so far;
  98. // looks like it merits a common base class.
  99. HWND propSheet = Win::GetParent(hwnd);
  100. int defaultButtonId =
  101. Win::Dialog_GetDefaultButtonId(propSheet);
  102. // we expect that there is always a default button on the prop sheet
  103. ASSERT(defaultButtonId);
  104. Win::SendMessage(
  105. propSheet,
  106. WM_COMMAND,
  107. MAKELONG(defaultButtonId, BN_CLICKED),
  108. 0);
  109. result = true;
  110. break;
  111. }
  112. }
  113. break;
  114. }
  115. default:
  116. {
  117. // do nothing
  118. break;
  119. }
  120. }
  121. */
  122. return result;
  123. }
  124. bool
  125. FinishPage::OnWizFinish()
  126. {
  127. LOG_FUNCTION(FinishPage::OnWizFinish);
  128. return true;
  129. }