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.

134 lines
4.0 KiB

  1. #pragma once
  2. class CWizardSheet;
  3. #include "resource.h"
  4. #include "WelcomePage.h"
  5. #include "ImportOrExport.h"
  6. #include "SelectSite.h"
  7. #include "PackageConfig.h"
  8. #include "PostProcessAdd.h"
  9. #include "ExportSummary.h"
  10. #include "ExportProgress.h"
  11. #include "ExportFinishPage.h"
  12. #include "LoadPackage.h"
  13. #include "PackageInfo.h"
  14. #include "ImportOptions.h"
  15. #include "ImportProgress.h"
  16. #include "ImportFinishPage.h"
  17. class CWizardSheet : public CPropertySheetImpl<CWizardSheet>
  18. {
  19. public:
  20. typedef THandle<HGDIOBJ, ::DeleteObject> TGdiObjHandle;
  21. typedef HRESULT (__stdcall *PFN_AUTOCOMPLETE)( HWND, DWORD );
  22. CWizardSheet() :
  23. m_pageWelcome( this ),
  24. m_pageImportOrExport( this ),
  25. m_pageSelectSite( this ),
  26. m_pagePkgCfg( this ),
  27. m_pagePostProcess( this ),
  28. m_pageExportSummary( this ),
  29. m_pageExportProgress( this ),
  30. m_pageExportFinish( this ),
  31. m_pageLoadPkg( this ),
  32. m_pagePkgInfo( this ),
  33. m_pageImpOpt( this ),
  34. m_pageImportProgress( this ),
  35. m_PageImportFinish( this )
  36. {
  37. // Create the font for the wizard title texts and for the text of tipd
  38. NONCLIENTMETRICS ncm = { 0 };
  39. ncm.cbSize = sizeof( ncm );
  40. ::SystemParametersInfo( SPI_GETNONCLIENTMETRICS, 0, &ncm, 0 );
  41. LOGFONTW TitleLogFont = ncm.lfMessageFont;
  42. TitleLogFont.lfWeight = FW_BOLD;
  43. ::wcscpy( TitleLogFont.lfFaceName, L"Verdana" );
  44. // Create the tips font
  45. m_fontBold = ::CreateFontIndirect( &TitleLogFont );
  46. // Create the intro/end title font
  47. HDC hDC = ::GetDC(NULL); // Gets the screen DC
  48. TitleLogFont.lfHeight = -::MulDiv( 12, ::GetDeviceCaps(hDC, LOGPIXELSY), 72);
  49. m_fontTitles = ::CreateFontIndirect( &TitleLogFont );
  50. ::ReleaseDC( NULL, hDC );
  51. hDC = NULL;
  52. // Adjust the wizard style
  53. SetWatermark( MAKEINTRESOURCE( IDB_WZ_SIDE ) );
  54. SetHeader( MAKEINTRESOURCE( IDB_BITMAP1 ) );
  55. // Add the pages
  56. AddPage( m_pageWelcome );
  57. AddPage( m_pageImportOrExport );
  58. AddPage( m_pageSelectSite );
  59. AddPage( m_pagePkgCfg );
  60. AddPage( m_pagePostProcess );
  61. AddPage( m_pageExportSummary );
  62. AddPage( m_pageExportProgress );
  63. AddPage( m_pageExportFinish );
  64. AddPage( m_pageLoadPkg );
  65. AddPage( m_pagePkgInfo );
  66. AddPage( m_pageImpOpt );
  67. AddPage( m_pageImportProgress );
  68. AddPage( m_PageImportFinish );
  69. // We will use the shell autocomplete for most of the file/path edit controls
  70. // Sicne this function requires IE5, we will load it dynamicaly
  71. m_shShellLib = ::LoadLibraryW( L"Shlwapi.dll" );
  72. if ( m_shShellLib.IsValid() )
  73. {
  74. m_pfnAutocomplete = reinterpret_cast<PFN_AUTOCOMPLETE>( ::GetProcAddress( m_shShellLib.get(), "SHAutoComplete" ) );
  75. if ( NULL == m_pfnAutocomplete )
  76. {
  77. m_shShellLib.Close();
  78. }
  79. }
  80. }
  81. void SetAutocomplete( HWND hwnd, DWORD dwFlags )
  82. {
  83. _ASSERT( hwnd != NULL );
  84. if ( m_pfnAutocomplete != NULL )
  85. {
  86. VERIFY( SUCCEEDED( m_pfnAutocomplete( hwnd, dwFlags ) ) );
  87. }
  88. }
  89. public:
  90. TGdiObjHandle m_fontTitles;
  91. TGdiObjHandle m_fontBold;
  92. TLibHandle m_shShellLib;
  93. PFN_AUTOCOMPLETE m_pfnAutocomplete; // The shell autocomplete API
  94. CWelcomePage m_pageWelcome;
  95. CImportOrExport m_pageImportOrExport;
  96. CSelectSite m_pageSelectSite;
  97. CPackageConfig m_pagePkgCfg;
  98. CPostProcessAdd m_pagePostProcess;
  99. CExportSummary m_pageExportSummary;
  100. CExportProgress m_pageExportProgress;
  101. CExportFinishPage m_pageExportFinish;
  102. CLoadPackage m_pageLoadPkg;
  103. CPackageInfo m_pagePkgInfo;
  104. CImportOptions m_pageImpOpt;
  105. CImportProgress m_pageImportProgress;
  106. CImportFinishPage m_PageImportFinish;
  107. };