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.

99 lines
1.7 KiB

  1. // Copyright (c) 2000 Microsoft Corporation
  2. //
  3. // Dlg to inform user of a bad computer name
  4. //
  5. // 21 Aug 2000 sburns
  6. #include "headers.hxx"
  7. #include "BadComputerNameDialog.hpp"
  8. #include "resource.h"
  9. static const DWORD HELP_MAP[] =
  10. {
  11. 0, 0
  12. };
  13. BadComputerNameDialog::BadComputerNameDialog(
  14. const String& message_)
  15. :
  16. Dialog(IDD_BAD_COMPUTER_NAME, HELP_MAP),
  17. message(message_)
  18. {
  19. LOG_CTOR(BadComputerNameDialog);
  20. ASSERT(!message.empty());
  21. }
  22. BadComputerNameDialog::~BadComputerNameDialog()
  23. {
  24. LOG_DTOR(BadComputerNameDialog);
  25. }
  26. bool
  27. BadComputerNameDialog::OnCommand(
  28. HWND /* windowFrom */ ,
  29. unsigned controlIdFrom,
  30. unsigned code)
  31. {
  32. switch (controlIdFrom)
  33. {
  34. case IDCANCEL:
  35. case IDOK:
  36. {
  37. if (code == BN_CLICKED)
  38. {
  39. // the value with which we end this dialog is not important:
  40. // there is only one choice to the user: ACK
  41. Win::EndDialog(hwnd, 1);
  42. return true;
  43. }
  44. break;
  45. }
  46. case IDC_SHOW_HELP:
  47. {
  48. if (code == BN_CLICKED)
  49. {
  50. Win::HtmlHelp(
  51. hwnd,
  52. L"DNSConcepts.chm",
  53. HH_DISPLAY_TOPIC,
  54. reinterpret_cast<DWORD_PTR>(L"error_dcpromo.htm"));
  55. return true;
  56. }
  57. break;
  58. }
  59. default:
  60. {
  61. // do nothing
  62. break;
  63. }
  64. }
  65. return false;
  66. }
  67. void
  68. BadComputerNameDialog::OnInit()
  69. {
  70. LOG_FUNCTION(BadComputerNameDialog::OnInit);
  71. Win::SetDlgItemText(hwnd, IDC_TEXT, message);
  72. }