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.

93 lines
2.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: csw97sht.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // csw97sht.cpp: implementation of the CWizard97PropertySheet class.
  11. //
  12. //////////////////////////////////////////////////////////////////////
  13. #include <pch.cpp>
  14. #pragma hdrstop
  15. #include "prsht.h"
  16. #include "csw97sht.h"
  17. #include "csw97ppg.h"
  18. //#include "resource.h"
  19. //////////////////////////////////////////////////////////////////////
  20. // Construction/Destruction
  21. //////////////////////////////////////////////////////////////////////
  22. CWizard97PropertySheet::CWizard97PropertySheet(
  23. HINSTANCE hInstance,
  24. UINT nIDCaption,
  25. UINT nIDWaterMark,
  26. UINT nIDBanner,
  27. BOOL fWizard)
  28. {
  29. ZeroMemory(&m_pPagePtr, sizeof(CWizard97PropertyPage*) * NUM_PAGES);
  30. ZeroMemory(&m_pPageArr, sizeof(HPROPSHEETPAGE) * NUM_PAGES);
  31. // NOTICE: do this because of header mismatch
  32. ZeroMemory(&m_psh, sizeof(PROPSHEETHEADER));
  33. m_psh.dwFlags = fWizard ? (PSH_WIZARD | PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER) : PSH_DEFAULT;
  34. m_psh.pszbmWatermark = MAKEINTRESOURCE(nIDWaterMark);
  35. m_psh.pszbmHeader = MAKEINTRESOURCE(nIDBanner);
  36. m_psh.hplWatermark = NULL;
  37. m_psh.dwSize = sizeof(m_psh);
  38. m_psh.hInstance = hInstance; //AfxGetApp()->m_hInstance;
  39. m_psh.hwndParent = NULL;
  40. VERIFY(m_title.LoadString(nIDCaption));
  41. m_psh.pszCaption = (LPCTSTR) m_title;
  42. m_psh.phpage = NULL;
  43. m_psh.nStartPage = 0;
  44. m_psh.nPages = 0;
  45. m_nPageCount = 0;
  46. }
  47. CWizard97PropertySheet::~CWizard97PropertySheet()
  48. {
  49. }
  50. BOOL
  51. CWizard97PropertySheet::DoWizard(
  52. HWND hParent)
  53. {
  54. m_psh.hwndParent = hParent;
  55. // if (m_nPageCount > 0 && m_pPagePtr[m_nPageCount - 1])
  56. // m_pPagePtr[m_nPageCount - 1]->m_bLast = TRUE;
  57. m_psh.phpage = m_pPageArr;
  58. m_psh.nStartPage = 0;
  59. m_psh.nPages = m_nPageCount;
  60. return (BOOL)PropertySheet(&m_psh);
  61. }
  62. void
  63. CWizard97PropertySheet::AddPage(
  64. CWizard97PropertyPage *pPage)
  65. {
  66. ASSERT(pPage);
  67. if (pPage)
  68. {
  69. ASSERT(m_nPageCount < NUM_PAGES);
  70. m_pPagePtr[m_nPageCount] = pPage;
  71. m_pPageArr[m_nPageCount] = ::CreatePropertySheetPage(&(pPage->m_psp97));
  72. ASSERT(m_pPageArr[m_nPageCount]);
  73. m_nPageCount++;
  74. pPage->m_pWiz = this;
  75. }
  76. }