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.

103 lines
2.3 KiB

  1. #include "faxocm.h"
  2. #pragma hdrstop
  3. typedef enum {
  4. WizPageWelcome,
  5. WizPageEula,
  6. WizPageFinal,
  7. WizPageMaximum
  8. } WizPage;
  9. WIZPAGE SetupWizardPages[WizPageMaximum] =
  10. {
  11. { PSWIZB_NEXT, WizPageWelcome, IDD_WELCOME, WelcomeDlgProc, 0, 0 },
  12. { PSWIZB_NEXT|PSWIZB_BACK, WizPageEula, IDD_EULA, EulaDlgProc, IDS_EULA_TITLE, IDS_EULA_SUBTITLE },
  13. { PSWIZB_FINISH, WizPageFinal, IDD_FINAL, FinalDlgProc, 0, 0 }
  14. };
  15. HPROPSHEETPAGE
  16. CreateWizardPage(
  17. PWIZPAGE WizPage
  18. )
  19. {
  20. WCHAR TitleBuffer[256];
  21. PROPSHEETPAGE WizardPage;
  22. WizardPage.dwSize = sizeof(PROPSHEETPAGE);
  23. if (WizPage->Title == 0) {
  24. WizardPage.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
  25. } else {
  26. WizardPage.dwFlags = PSP_DEFAULT | PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE;
  27. }
  28. WizardPage.hInstance = hInstance;
  29. WizardPage.pszTemplate = MAKEINTRESOURCE(WizPage->DlgId);
  30. WizardPage.pszIcon = NULL;
  31. WizardPage.pszTitle = NULL;
  32. WizardPage.pfnDlgProc = CommonDlgProc;
  33. WizardPage.lParam = (LPARAM) WizPage;
  34. WizardPage.pfnCallback = NULL;
  35. WizardPage.pcRefParent = NULL;
  36. WizardPage.pszHeaderTitle = NULL;
  37. WizardPage.pszHeaderSubTitle = NULL;
  38. if (WizPage->Title) {
  39. if (LoadString(
  40. hInstance,
  41. WizPage->Title,
  42. TitleBuffer,
  43. sizeof(TitleBuffer)/sizeof(WCHAR)
  44. ))
  45. {
  46. WizardPage.pszHeaderTitle = _wcsdup( TitleBuffer );
  47. }
  48. }
  49. if (WizPage->SubTitle) {
  50. if (LoadString(
  51. hInstance,
  52. WizPage->SubTitle,
  53. TitleBuffer,
  54. sizeof(TitleBuffer)/sizeof(WCHAR)
  55. ))
  56. {
  57. WizardPage.pszHeaderSubTitle = _wcsdup( TitleBuffer );
  58. }
  59. }
  60. return CreatePropertySheetPage( &WizardPage );
  61. }
  62. HPROPSHEETPAGE
  63. GetWelcomeWizardPage(
  64. VOID
  65. )
  66. {
  67. return CreateWizardPage( &SetupWizardPages[0] );
  68. }
  69. HPROPSHEETPAGE
  70. GetEulaWizardPage(
  71. VOID
  72. )
  73. {
  74. return CreateWizardPage( &SetupWizardPages[1] );
  75. }
  76. HPROPSHEETPAGE
  77. GetFinalWizardPage(
  78. VOID
  79. )
  80. {
  81. return CreateWizardPage( &SetupWizardPages[2] );
  82. }