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.

87 lines
1.5 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. const UINT SELF_DESTRUCT_MESSAGE = WM_USER + 200;
  10. static const DWORD HELP_MAP[] =
  11. {
  12. 0, 0
  13. };
  14. UnattendSplashDialog::UnattendSplashDialog()
  15. :
  16. Dialog(IDD_UNATTEND_SPLASH, HELP_MAP)
  17. {
  18. LOG_CTOR(UnattendSplashDialog);
  19. }
  20. UnattendSplashDialog::~UnattendSplashDialog()
  21. {
  22. LOG_DTOR(UnattendSplashDialog);
  23. }
  24. void
  25. UnattendSplashDialog::OnInit()
  26. {
  27. LOG_FUNCTION(UnattendSplashDialog::OnInit);
  28. // Since the window does not have a title bar, we need to give it some
  29. // text to appear on the button label on the shell task bar.
  30. Win::SetWindowText(hwnd, String::load(IDS_WIZARD_TITLE));
  31. }
  32. void
  33. UnattendSplashDialog::SelfDestruct()
  34. {
  35. LOG_FUNCTION(UnattendSplashDialog::SelfDestruct);
  36. // Post our window proc a self destruct message. We use Post instead of
  37. // send, as we expect that in some cases, this function will be called from
  38. // a thread other than the one that created the window. (It is illegal to
  39. // try to destroy a window from a thread that it not the thread that
  40. // created the window.)
  41. Win::PostMessage(hwnd, SELF_DESTRUCT_MESSAGE, 0, 0);
  42. }
  43. bool
  44. UnattendSplashDialog::OnMessage(
  45. UINT message,
  46. WPARAM /* wparam */ ,
  47. LPARAM /* lparam */ )
  48. {
  49. if (message == SELF_DESTRUCT_MESSAGE)
  50. {
  51. delete this;
  52. return true;
  53. }
  54. return false;
  55. }