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.

175 lines
4.2 KiB

  1. /*****************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORPORATION, 2000
  4. *
  5. * TITLE: emd.cpp
  6. *
  7. * VERSION: 1.0
  8. *
  9. * AUTHOR: RickTu
  10. *
  11. * DATE: 11/7/00
  12. *
  13. * DESCRIPTION: Implements code for the end page of the
  14. * print photos wizard...
  15. *
  16. *****************************************************************************/
  17. #include <precomp.h>
  18. #pragma hdrstop
  19. /*****************************************************************************
  20. CEndPage -- constructor/desctructor
  21. <Notes>
  22. *****************************************************************************/
  23. CEndPage::CEndPage( CWizardInfoBlob * pBlob )
  24. : _hDlg(NULL)
  25. {
  26. WIA_PUSH_FUNCTION_MASK((TRACE_PAGE_END, TEXT("CEndPage::CEndPage()")));
  27. _pWizInfo = pBlob;
  28. _pWizInfo->AddRef();
  29. }
  30. CEndPage::~CEndPage()
  31. {
  32. WIA_PUSH_FUNCTION_MASK((TRACE_PAGE_END, TEXT("CEndPage::~CEndPage()")));
  33. if (_pWizInfo)
  34. {
  35. _pWizInfo->Release();
  36. _pWizInfo = NULL;
  37. }
  38. }
  39. /*****************************************************************************
  40. CEndPage::_OnInitDialog
  41. Handle initializing the wizard page...
  42. *****************************************************************************/
  43. LRESULT CEndPage::_OnInitDialog()
  44. {
  45. WIA_PUSH_FUNCTION_MASK((TRACE_PAGE_END, TEXT("CEndPage::_OnInitDialog()")));
  46. if (!_pWizInfo)
  47. {
  48. WIA_ERROR((TEXT("FATAL: _pWizInfo is NULL, exiting early")));
  49. return FALSE;
  50. }
  51. //
  52. // Set font...
  53. //
  54. SendDlgItemMessage(_hDlg, IDC_DONE, WM_SETFONT, (WPARAM)_pWizInfo->GetIntroFont(_hDlg), 0);
  55. return TRUE;
  56. }
  57. /*****************************************************************************
  58. CEndPage::DoHandleMessage
  59. Hanlder for messages sent to this page...
  60. *****************************************************************************/
  61. INT_PTR CEndPage::DoHandleMessage( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
  62. {
  63. WIA_PUSH_FUNCTION_MASK((TRACE_DLGPROC, TEXT("CEndPage::DoHandleMessage( uMsg = 0x%x, wParam = 0x%x, lParam = 0x%x )"),uMsg,wParam,lParam));
  64. switch ( uMsg )
  65. {
  66. case WM_INITDIALOG:
  67. _hDlg = hDlg;
  68. return _OnInitDialog();
  69. case WM_NOTIFY:
  70. {
  71. LPNMHDR pnmh = (LPNMHDR)lParam;
  72. LONG_PTR lpRes = 0;
  73. switch (pnmh->code)
  74. {
  75. case PSN_SETACTIVE:
  76. {
  77. WIA_TRACE((TEXT("got PSN_SETACTIVE")));
  78. //
  79. // Put the correct text in the wizard page...
  80. //
  81. INT idText = IDS_WIZ_END_PAGE_SUCCESS;
  82. if (_pWizInfo)
  83. {
  84. if (_pWizInfo->NumberOfErrorsEncountered() > 0)
  85. {
  86. idText = IDS_WIZ_END_PAGE_ERROR;
  87. }
  88. //
  89. // Reset the error count
  90. //
  91. _pWizInfo->ResetErrorCount();
  92. }
  93. CSimpleString strText( idText, g_hInst );
  94. SetDlgItemText( _hDlg, IDC_END_PAGE_TEXT, strText.String() );
  95. //
  96. // Turn cancel into finish...
  97. //
  98. lpRes = 0;
  99. PropSheet_SetWizButtons( GetParent(_hDlg), PSWIZB_BACK | PSWIZB_FINISH );
  100. }
  101. break;
  102. case PSN_WIZNEXT:
  103. WIA_TRACE((TEXT("got PSN_WIZNEXT")));
  104. lpRes = -1;
  105. break;
  106. case PSN_WIZBACK:
  107. WIA_TRACE((TEXT("got PSN_WIZBACK")));
  108. lpRes = IDD_SELECT_TEMPLATE;
  109. break;
  110. case PSN_WIZFINISH:
  111. WIA_TRACE((TEXT("got PSN_WIZFINISH")));
  112. lpRes = FALSE; // allow wizard to exit
  113. if (_pWizInfo)
  114. {
  115. _pWizInfo->ShutDownWizard();
  116. }
  117. break;
  118. }
  119. SetWindowLongPtr( hDlg, DWLP_MSGRESULT, lpRes );
  120. return TRUE;
  121. }
  122. }
  123. return FALSE;
  124. }