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.

108 lines
1.8 KiB

  1. // Copyright (c) 2000 Microsoft Corporation
  2. //
  3. // Dlg to inform user of a non-rfc computer name
  4. //
  5. // 18 Aug 2000 sburns
  6. #include "headers.hxx"
  7. #include "NonRfcComputerNameDialog.hpp"
  8. #include "resource.h"
  9. static const DWORD HELP_MAP[] =
  10. {
  11. 0, 0
  12. };
  13. NonRfcComputerNameDialog::NonRfcComputerNameDialog(
  14. const String& computerName_)
  15. :
  16. Dialog(IDD_NON_RFC_COMPUTER_NAME, HELP_MAP),
  17. computerName(computerName_)
  18. {
  19. LOG_CTOR(NonRfcComputerNameDialog);
  20. ASSERT(!computerName.empty());
  21. }
  22. NonRfcComputerNameDialog::~NonRfcComputerNameDialog()
  23. {
  24. LOG_DTOR(NonRfcComputerNameDialog);
  25. }
  26. bool
  27. NonRfcComputerNameDialog::OnCommand(
  28. HWND /* windowFrom */ ,
  29. unsigned controlIdFrom,
  30. unsigned code)
  31. {
  32. switch (controlIdFrom)
  33. {
  34. case IDCANCEL:
  35. case IDC_CONTINUE:
  36. {
  37. if (code == BN_CLICKED)
  38. {
  39. Win::EndDialog(hwnd, CONTINUE);
  40. return true;
  41. }
  42. break;
  43. }
  44. case IDC_RENAME:
  45. {
  46. if (code == BN_CLICKED)
  47. {
  48. Win::EndDialog(hwnd, RENAME);
  49. return true;
  50. }
  51. break;
  52. }
  53. case IDC_SHOW_HELP:
  54. {
  55. if (code == BN_CLICKED)
  56. {
  57. Win::HtmlHelp(
  58. hwnd,
  59. L"DNSConcepts.chm",
  60. HH_DISPLAY_TOPIC,
  61. reinterpret_cast<DWORD_PTR>(L"error_dcpromo.htm"));
  62. return true;
  63. }
  64. break;
  65. }
  66. default:
  67. {
  68. // do nothing
  69. break;
  70. }
  71. }
  72. return false;
  73. }
  74. void
  75. NonRfcComputerNameDialog::OnInit()
  76. {
  77. LOG_FUNCTION(NonRfcComputerNameDialog::OnInit);
  78. String message =
  79. String::format(IDS_COMPUTER_NAME_NON_RFC, computerName.c_str());
  80. Win::SetDlgItemText(hwnd, IDC_TEXT, message);
  81. }