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.

94 lines
1.8 KiB

  1. // Copyright (C) 1998 Microsoft Corporation
  2. //
  3. // Splash screen for unattended mode
  4. //
  5. // 10-1-98 sburns
  6. #include "headers.hxx"
  7. #include "UnattendSplashDialog.hpp"
  8. #include "resource.h"
  9. #include "state.hpp"
  10. const UINT SELF_DESTRUCT_MESSAGE = WM_USER + 200;
  11. static const DWORD HELP_MAP[] =
  12. {
  13. 0, 0
  14. };
  15. UnattendSplashDialog::UnattendSplashDialog(int splashMessageResId)
  16. :
  17. Dialog(IDD_UNATTEND_SPLASH, HELP_MAP),
  18. messageResId(splashMessageResId)
  19. {
  20. LOG_CTOR(UnattendSplashDialog);
  21. ASSERT(messageResId);
  22. }
  23. UnattendSplashDialog::~UnattendSplashDialog()
  24. {
  25. LOG_DTOR(UnattendSplashDialog);
  26. }
  27. void
  28. UnattendSplashDialog::OnInit()
  29. {
  30. LOG_FUNCTION(UnattendSplashDialog::OnInit);
  31. // Since the window does not have a title bar, we need to give it some
  32. // text to appear on the button label on the shell task bar.
  33. Win::SetWindowText(hwnd, String::load(IDS_WIZARD_TITLE));
  34. // NTRAID#NTBUG9-502991-2001/12/07-sburns
  35. Win::SetDlgItemText(hwnd, IDC_MESSAGE, messageResId);
  36. }
  37. void
  38. UnattendSplashDialog::SelfDestruct()
  39. {
  40. LOG_FUNCTION(UnattendSplashDialog::SelfDestruct);
  41. // Post our window proc a self destruct message. We use Post instead of
  42. // send, as we expect that in some cases, this function will be called from
  43. // a thread other than the one that created the window. (It is illegal to
  44. // try to destroy a window from a thread that it not the thread that
  45. // created the window.)
  46. Win::PostMessage(hwnd, SELF_DESTRUCT_MESSAGE, 0, 0);
  47. }
  48. bool
  49. UnattendSplashDialog::OnMessage(
  50. UINT message,
  51. WPARAM /* wparam */ ,
  52. LPARAM /* lparam */ )
  53. {
  54. if (message == SELF_DESTRUCT_MESSAGE)
  55. {
  56. delete this;
  57. return true;
  58. }
  59. return false;
  60. }