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.

78 lines
1.1 KiB

  1. // Copyright (C) 1997 Microsoft Corporation
  2. //
  3. // Dlg to confirm reboot
  4. //
  5. // 12-12-97 sburns
  6. #include "headers.hxx"
  7. #include "RebootDialog.hpp"
  8. #include "resource.h"
  9. static const DWORD HELP_MAP[] =
  10. {
  11. 0, 0
  12. };
  13. RebootDialog::RebootDialog(bool forFailure)
  14. :
  15. Dialog(
  16. forFailure ? IDD_REBOOT_FAILURE : IDD_REBOOT,
  17. HELP_MAP)
  18. {
  19. LOG_CTOR(RebootDialog);
  20. }
  21. RebootDialog::~RebootDialog()
  22. {
  23. LOG_DTOR(RebootDialog);
  24. }
  25. bool
  26. RebootDialog::OnCommand(
  27. HWND /* windowFrom */ ,
  28. unsigned controlIDFrom,
  29. unsigned code)
  30. {
  31. // LOG_FUNCTION(RebootDialog::OnCommand);
  32. if (code == BN_CLICKED)
  33. {
  34. switch (controlIDFrom)
  35. {
  36. case IDC_RESTART_NOW:
  37. {
  38. HRESULT unused = Win::EndDialog(hwnd, 1);
  39. ASSERT(SUCCEEDED(unused));
  40. return true;
  41. }
  42. case IDCANCEL:
  43. case IDC_RESTART_LATER:
  44. {
  45. HRESULT unused = Win::EndDialog(hwnd, 0);
  46. ASSERT(SUCCEEDED(unused));
  47. return true;
  48. }
  49. default:
  50. {
  51. // do nothing
  52. }
  53. }
  54. }
  55. return false;
  56. }