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.

79 lines
2.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-2001.
  5. //
  6. // File: Wiz97Sht.cpp
  7. //
  8. // Contents: Base class for cert find dialog
  9. //
  10. //----------------------------------------------------------------------------\
  11. //////////////////////////////////////////////////////////////////////
  12. #include "stdafx.h"
  13. #include "Wiz97Sht.h"
  14. #include "Wiz97PPg.h"
  15. //////////////////////////////////////////////////////////////////////
  16. // Construction/Destruction
  17. //////////////////////////////////////////////////////////////////////
  18. CWizard97PropertySheet::CWizard97PropertySheet(UINT nIDCaption, UINT nIDWaterMark, UINT nIDBanner)
  19. {
  20. ::ZeroMemory (&m_pPagePtr, sizeof (CWizard97PropertyPage*) * NUM_PAGES);
  21. ::ZeroMemory (&m_pPageArr, sizeof (HPROPSHEETPAGE) * NUM_PAGES);
  22. // NOTICE: do this because of header mismatch
  23. memset(&m_psh, 0x0, sizeof(PROPSHEETHEADER));
  24. m_psh.dwFlags = PSH_WIZARD | PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER;
  25. m_psh.pszbmWatermark = MAKEINTRESOURCE (nIDWaterMark);
  26. m_psh.pszbmHeader = MAKEINTRESOURCE (nIDBanner);
  27. m_psh.hplWatermark = NULL;
  28. m_psh.dwSize = sizeof (m_psh);
  29. m_psh.hInstance = AfxGetApp()->m_hInstance;
  30. m_psh.hwndParent = NULL;
  31. VERIFY (m_title.LoadString (nIDCaption));
  32. m_psh.pszCaption = (LPCWSTR) m_title;
  33. m_psh.phpage = NULL;
  34. m_psh.nStartPage = 0;
  35. m_psh.nPages = 0;
  36. m_nPageCount = 0;
  37. }
  38. CWizard97PropertySheet::~CWizard97PropertySheet()
  39. {
  40. }
  41. INT_PTR CWizard97PropertySheet::DoWizard(HWND hParent)
  42. {
  43. m_psh.hwndParent = hParent;
  44. // if ( m_nPageCount > 0 && m_pPagePtr[m_nPageCount - 1] )
  45. // m_pPagePtr[m_nPageCount - 1]->m_bLast = TRUE;
  46. m_psh.phpage = m_pPageArr;
  47. m_psh.nStartPage = 0;
  48. m_psh.nPages = m_nPageCount;
  49. return PropertySheet (&m_psh);
  50. }
  51. void CWizard97PropertySheet::AddPage(CWizard97PropertyPage * pPage)
  52. {
  53. ASSERT (pPage);
  54. if ( pPage )
  55. {
  56. ASSERT (m_nPageCount < NUM_PAGES);
  57. m_pPagePtr[m_nPageCount] = pPage;
  58. m_pPageArr[m_nPageCount] = ::MyCreatePropertySheetPage (
  59. (AFX_OLDPROPSHEETPAGE*) &(pPage->m_psp97));
  60. ASSERT (m_pPageArr[m_nPageCount]);
  61. m_nPageCount++;
  62. pPage->m_pWiz = this;
  63. }
  64. }