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.

179 lines
4.6 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. _pWizInfo(pBlob)
  26. {
  27. WIA_PUSH_FUNCTION_MASK((TRACE_PAGE_END, TEXT("CEndPage::CEndPage()")));
  28. if (_pWizInfo)
  29. {
  30. _pWizInfo->AddRef();
  31. }
  32. }
  33. CEndPage::~CEndPage()
  34. {
  35. WIA_PUSH_FUNCTION_MASK((TRACE_PAGE_END, TEXT("CEndPage::~CEndPage()")));
  36. if (_pWizInfo)
  37. {
  38. _pWizInfo->Release();
  39. _pWizInfo = NULL;
  40. }
  41. }
  42. /*****************************************************************************
  43. CEndPage::_OnInitDialog
  44. Handle initializing the wizard page...
  45. *****************************************************************************/
  46. LRESULT CEndPage::_OnInitDialog()
  47. {
  48. WIA_PUSH_FUNCTION_MASK((TRACE_PAGE_END, TEXT("CEndPage::_OnInitDialog()")));
  49. if (!_pWizInfo)
  50. {
  51. WIA_ERROR((TEXT("FATAL: _pWizInfo is NULL, exiting early")));
  52. return FALSE;
  53. }
  54. //
  55. // Set font...
  56. //
  57. SendDlgItemMessage(_hDlg, IDC_DONE, WM_SETFONT, (WPARAM)_pWizInfo->GetIntroFont(_hDlg), 0);
  58. return TRUE;
  59. }
  60. /*****************************************************************************
  61. CEndPage::DoHandleMessage
  62. Hanlder for messages sent to this page...
  63. *****************************************************************************/
  64. INT_PTR CEndPage::DoHandleMessage( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
  65. {
  66. WIA_PUSH_FUNCTION_MASK((TRACE_DLGPROC, TEXT("CEndPage::DoHandleMessage( uMsg = 0x%x, wParam = 0x%x, lParam = 0x%x )"),uMsg,wParam,lParam));
  67. switch ( uMsg )
  68. {
  69. case WM_INITDIALOG:
  70. _hDlg = hDlg;
  71. return _OnInitDialog();
  72. case WM_NOTIFY:
  73. {
  74. LPNMHDR pnmh = (LPNMHDR)lParam;
  75. LONG_PTR lpRes = 0;
  76. if (pnmh)
  77. {
  78. switch (pnmh->code)
  79. {
  80. case PSN_SETACTIVE:
  81. {
  82. WIA_TRACE((TEXT("got PSN_SETACTIVE")));
  83. //
  84. // Put the correct text in the wizard page...
  85. //
  86. INT idText = IDS_WIZ_END_PAGE_SUCCESS;
  87. if (_pWizInfo)
  88. {
  89. if (_pWizInfo->NumberOfErrorsEncountered() > 0)
  90. {
  91. idText = IDS_WIZ_END_PAGE_ERROR;
  92. }
  93. //
  94. // Reset the error count
  95. //
  96. _pWizInfo->ResetErrorCount();
  97. }
  98. CSimpleString strText( idText, g_hInst );
  99. SetDlgItemText( _hDlg, IDC_END_PAGE_TEXT, strText.String() );
  100. //
  101. // Turn cancel into finish...
  102. //
  103. lpRes = 0;
  104. PropSheet_SetWizButtons( GetParent(_hDlg), PSWIZB_BACK | PSWIZB_FINISH );
  105. }
  106. break;
  107. case PSN_WIZNEXT:
  108. WIA_TRACE((TEXT("got PSN_WIZNEXT")));
  109. lpRes = -1;
  110. break;
  111. case PSN_WIZBACK:
  112. WIA_TRACE((TEXT("got PSN_WIZBACK")));
  113. lpRes = IDD_SELECT_TEMPLATE;
  114. break;
  115. case PSN_WIZFINISH:
  116. WIA_TRACE((TEXT("got PSN_WIZFINISH")));
  117. lpRes = FALSE; // allow wizard to exit
  118. if (_pWizInfo)
  119. {
  120. _pWizInfo->ShutDownWizard();
  121. }
  122. break;
  123. }
  124. }
  125. SetWindowLongPtr( hDlg, DWLP_MSGRESULT, lpRes );
  126. return TRUE;
  127. }
  128. }
  129. return FALSE;
  130. }