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.

205 lines
4.7 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. // All rights reserved.
  5. //
  6. // File Name:
  7. // spfolder.c
  8. //
  9. // Description:
  10. // This file contains the dialog procedure for the page that asks if the
  11. // user wants a sysprep folder. (IDD_CREATESYSPREPFOLDER).
  12. //
  13. //----------------------------------------------------------------------------
  14. #include "pch.h"
  15. #include "resource.h"
  16. INT_PTR CALLBACK DlgSysprepFolderPage( IN HWND hwnd,
  17. IN UINT uMsg,
  18. IN WPARAM wParam,
  19. IN LPARAM lParam);
  20. //----------------------------------------------------------------------------
  21. //
  22. // Function: OnSysprepFolderInitDialog
  23. //
  24. // Purpose:
  25. //
  26. // Arguments: IN HWND hwnd - handle to the dialog box
  27. //
  28. // Returns: VOID
  29. //
  30. //----------------------------------------------------------------------------
  31. VOID
  32. OnSysprepInitDialog( IN HWND hwnd ) {
  33. //
  34. // Default to making the Sysprep folder
  35. //
  36. CheckRadioButton( hwnd,
  37. IDC_YES_SYSPREP_FOLDER,
  38. IDC_NO_SYSPREP_FOLDER,
  39. IDC_YES_SYSPREP_FOLDER );
  40. }
  41. //----------------------------------------------------------------------------
  42. //
  43. // Function: OnWizNextSysprepFolder
  44. //
  45. // Purpose:
  46. //
  47. // Arguments: IN HWND hwnd - handle to the dialog box
  48. //
  49. // Returns: VOID
  50. //
  51. //----------------------------------------------------------------------------
  52. static BOOL
  53. OnWizNextSysprepFolder( IN HWND hwnd )
  54. {
  55. BOOL bStayHere = FALSE;
  56. if( IsDlgButtonChecked( hwnd, IDC_YES_SYSPREP_FOLDER ) )
  57. {
  58. GenSettings.bCreateSysprepFolder = TRUE;
  59. }
  60. else
  61. {
  62. GenSettings.bCreateSysprepFolder = FALSE;
  63. }
  64. //
  65. // Warn the user that if they have already picked files that need a
  66. // sysprep folder but then here have chosen not to create a sysprep
  67. // folder.
  68. //
  69. if( ! GenSettings.bCreateSysprepFolder )
  70. {
  71. if( GenSettings.iRegionalSettings == REGIONAL_SETTINGS_SKIP ||
  72. GenSettings.iRegionalSettings == REGIONAL_SETTINGS_NOT_SPECIFIED )
  73. {
  74. INT iRet;
  75. iRet = ReportErrorId( hwnd,
  76. MSGTYPE_YESNO,
  77. IDS_ERR_MIGHT_NEED_SYSPREP_FOLDER_FOR_FILES );
  78. if( iRet == IDNO )
  79. {
  80. bStayHere = TRUE;
  81. }
  82. }
  83. else if( GenSettings.iRegionalSettings == REGIONAL_SETTINGS_SPECIFY )
  84. {
  85. INT iCount = GetNameListSize( &GenSettings.LanguageGroups );
  86. if( iCount != 0 )
  87. {
  88. INT iRet;
  89. iRet = ReportErrorId( hwnd,
  90. MSGTYPE_YESNO,
  91. IDS_ERR_NEED_SYSPREP_FOLDER_FOR_FILES );
  92. if( iRet == IDNO )
  93. {
  94. bStayHere = TRUE;
  95. }
  96. }
  97. }
  98. }
  99. return ( !bStayHere );
  100. }
  101. //----------------------------------------------------------------------------
  102. //
  103. // Function: DlgSysprepFolderPage
  104. //
  105. // Purpose:
  106. //
  107. // Arguments: standard Win32 dialog proc arguments
  108. //
  109. // Returns: standard Win32 dialog proc return value -- whether the message
  110. // was handled or not
  111. //
  112. //----------------------------------------------------------------------------
  113. INT_PTR CALLBACK
  114. DlgSysprepFolderPage( IN HWND hwnd,
  115. IN UINT uMsg,
  116. IN WPARAM wParam,
  117. IN LPARAM lParam) {
  118. BOOL bStatus = TRUE;
  119. switch( uMsg ) {
  120. case WM_INITDIALOG: {
  121. OnSysprepInitDialog( hwnd );
  122. break;
  123. }
  124. case WM_NOTIFY: {
  125. LPNMHDR pnmh = (LPNMHDR)lParam;
  126. switch( pnmh->code ) {
  127. case PSN_QUERYCANCEL:
  128. CancelTheWizard(hwnd); break;
  129. case PSN_SETACTIVE: {
  130. PropSheet_SetWizButtons( GetParent(hwnd),
  131. PSWIZB_BACK | PSWIZB_NEXT );
  132. break;
  133. }
  134. case PSN_WIZBACK:
  135. break;
  136. case PSN_WIZNEXT:
  137. if (!OnWizNextSysprepFolder( hwnd ))
  138. WIZ_FAIL(hwnd);
  139. break;
  140. default:
  141. break;
  142. }
  143. break;
  144. }
  145. default:
  146. bStatus = FALSE;
  147. break;
  148. }
  149. return( bStatus );
  150. }