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.

219 lines
7.6 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1994 **
  4. //*********************************************************************
  5. //
  6. // END.CPP - Functions for final Wizard pages
  7. //
  8. // HISTORY:
  9. //
  10. // 05/28/98 donaldm created
  11. //
  12. //*********************************************************************
  13. #include "pre.h"
  14. #include "icwextsn.h"
  15. /*******************************************************************
  16. NAME: EndInitProc
  17. SYNOPSIS: Called when page is displayed
  18. ENTRY: hDlg - dialog window
  19. fFirstInit - TRUE if this is the first time the dialog
  20. is initialized, FALSE if this InitProc has been called
  21. before (e.g. went past this page and backed up)
  22. ********************************************************************/
  23. BOOL CALLBACK EndInitProc
  24. (
  25. HWND hDlg,
  26. BOOL fFirstInit,
  27. UINT *puNextPage
  28. )
  29. {
  30. HWND hwndPropsheet = GetParent(hDlg);
  31. SetWindowLongPtr(GetDlgItem(hDlg, IDC_STATIC_ICON), GWLP_USERDATA, 201);
  32. // This is the very last page, so no back is not possible
  33. if (!g_bAllowCancel)
  34. {
  35. PropSheet_CancelToClose(hwndPropsheet);
  36. // Get the main frame window's style
  37. LONG window_style = GetWindowLong(hwndPropsheet, GWL_STYLE);
  38. //Remove the system menu from the window's style
  39. window_style &= ~WS_SYSMENU;
  40. //set the style attribute of the main frame window
  41. SetWindowLong(hwndPropsheet, GWL_STYLE, window_style);
  42. }
  43. if (!fFirstInit)
  44. {
  45. HWND hwndBtn = GetDlgItem(hDlg, IDC_CHECK_BROWSING);
  46. TCHAR szTemp [MAX_MESSAGE_LEN*2] = TEXT("\0");
  47. if (gpICWCONNApprentice)
  48. gpICWCONNApprentice->SetStateDataFromDllToExe( &gpWizardState->cmnStateData);
  49. PropSheet_SetWizButtons(hwndPropsheet, PSWIZB_FINISH);
  50. // if we've travelled through external apprentice pages,
  51. // it's easy for our current page pointer to get munged,
  52. // so reset it here for sanity's sake.
  53. #ifndef ICWDEBUG
  54. // NOTE: No ORD_PAGE_ENDOEMCUSTOM for ICWDEBUG
  55. if (gpWizardState->cmnStateData.bOEMCustom)
  56. gpWizardState->uCurrentPage = ORD_PAGE_ENDOEMCUSTOM;
  57. else
  58. #endif
  59. gpWizardState->uCurrentPage = ORD_PAGE_END;
  60. //the ins has failed let's display the special message.
  61. if (gpWizardState->cmnStateData.ispInfo.bFailedIns)
  62. {
  63. TCHAR szErrTitle [MAX_MESSAGE_LEN] = TEXT("\0");
  64. TCHAR szErrMsg1 [MAX_RES_LEN] = TEXT("\0");
  65. TCHAR szErrMsg2 [MAX_RES_LEN] = TEXT("\0");
  66. TCHAR szErrMsg3 [MAX_RES_LEN] = TEXT("\0");
  67. TCHAR szErrMsgTmp1 [MAX_RES_LEN] = TEXT("\0");
  68. TCHAR szErrMsgTmp2 [MAX_RES_LEN] = TEXT("\0");
  69. LoadString(g_hInstance, IDS_INSCONFIG_ERROR_TITLE, szErrTitle, MAX_MESSAGE_LEN);
  70. SetWindowText(GetDlgItem(hDlg, IDC_LBLTITLE), szErrTitle);
  71. if(*(gpWizardState->cmnStateData.ispInfo.szISPName))
  72. {
  73. LoadString(g_hInstance, IDS_PRECONFIG_ERROR_1, szErrMsg1, ARRAYSIZE(szErrMsg1));
  74. wsprintf(szErrMsgTmp1, szErrMsg1, gpWizardState->cmnStateData.ispInfo.szISPName);
  75. lstrcpy(szTemp,szErrMsgTmp1);
  76. }
  77. else
  78. {
  79. LoadString(g_hInstance, IDS_PRECONFIG_ERROR_1_NOINFO, szErrMsg1, ARRAYSIZE(szErrMsg1));
  80. lstrcpy(szTemp, szErrMsg1);
  81. }
  82. if(*(gpWizardState->cmnStateData.ispInfo.szSupportNumber))
  83. {
  84. LoadString(g_hInstance, IDS_PRECONFIG_ERROR_2, szErrMsg2, ARRAYSIZE(szErrMsg2));
  85. wsprintf(szErrMsgTmp2, szErrMsg2, gpWizardState->cmnStateData.ispInfo.szSupportNumber);
  86. lstrcat(szTemp, szErrMsgTmp2);
  87. }
  88. else
  89. {
  90. LoadString(g_hInstance, IDS_PRECONFIG_ERROR_2_NOINFO, szErrMsg2, ARRAYSIZE(szErrMsg2));
  91. lstrcat(szTemp, szErrMsg2);
  92. }
  93. LoadString(g_hInstance, IDS_INSCONFIG_ERROR_INSTRUCT, szErrMsg3, ARRAYSIZE(szErrMsg3));
  94. lstrcat(szTemp, szErrMsg3);
  95. SetWindowText(GetDlgItem(hDlg, IDC_INSERROR_FINISH_TEXT), szTemp);
  96. ShowWindow(GetDlgItem(hDlg, IDC_FINISH_TEXT), SW_HIDE);
  97. ShowWindow(GetDlgItem(hDlg, IDC_FINISH_SUPPORT_TEXT), SW_HIDE);
  98. ShowWindow(GetDlgItem(hDlg, IDC_STATIC_ICON), SW_HIDE);
  99. ShowWindow(GetDlgItem(hDlg, IDC_CLOSE_WIZ_CLICK_FINISH), SW_HIDE);
  100. ShowWindow(hwndBtn, SW_HIDE);
  101. }
  102. else
  103. {
  104. if (gpWizardState->cmnStateData.dwFlags & ICW_CFGFLAG_AUTOCONFIG)
  105. LoadString(g_hInstance, IDS_END_AUTOCFG_FINISH, szTemp, MAX_MESSAGE_LEN);
  106. else if (gpWizardState->cmnStateData.dwFlags & ICW_CFGFLAG_SMARTREBOOT_NEWISP)
  107. LoadString(g_hInstance, IDS_END_SIGNUP_FINISH, szTemp, MAX_MESSAGE_LEN);
  108. else
  109. LoadString(g_hInstance, IDS_END_MANUAL_FINISH, szTemp, MAX_MESSAGE_LEN);
  110. SetWindowText(GetDlgItem(hDlg, IDC_FINISH_TEXT), szTemp);
  111. }
  112. // IDC_CHECK_BROWSING is now permanently unchecked and hidden
  113. // (can't modify resources so we do it in code)
  114. ShowWindow(hwndBtn, SW_HIDE);
  115. }
  116. return TRUE;
  117. }
  118. /*******************************************************************
  119. NAME: EndOKProc
  120. SYNOPSIS: Called when Next or Back btns pressed from "Intro" page
  121. ENTRY: hDlg - dialog window
  122. fForward - TRUE if 'Next' was pressed, FALSE if 'Back'
  123. puNextPage - if 'Next' was pressed,
  124. proc can fill this in with next page to go to. This
  125. parameter is ingored if 'Back' was pressed.
  126. pfKeepHistory - page will not be kept in history if
  127. proc fills this in with FALSE.
  128. EXIT: returns TRUE to allow page to be turned, FALSE
  129. to keep the same page.
  130. ********************************************************************/
  131. BOOL CALLBACK EndOKProc
  132. (
  133. HWND hDlg,
  134. BOOL fForward,
  135. UINT *puNextPage,
  136. BOOL *pfKeepHistory
  137. )
  138. {
  139. // If connection info is not saved, save it
  140. if (gpINETCFGApprentice)
  141. {
  142. DWORD dwStatus;
  143. gpINETCFGApprentice->Save(hDlg, &dwStatus);
  144. }
  145. return TRUE;
  146. }
  147. /*******************************************************************
  148. NAME: EndOlsInitProc
  149. SYNOPSIS: Called when page is displayed
  150. ENTRY: hDlg - dialog window
  151. fFirstInit - TRUE if this is the first time the dialog
  152. is initialized, FALSE if this InitProc has been called
  153. before (e.g. went past this page and backed up)
  154. ********************************************************************/
  155. #ifndef ICWDEBUG
  156. BOOL CALLBACK EndOlsInitProc
  157. (
  158. HWND hDlg,
  159. BOOL fFirstInit,
  160. UINT *puNextPage
  161. )
  162. {
  163. // This is a finish page
  164. PropSheet_SetWizButtons(GetParent(hDlg),PSWIZB_BACK | PSWIZB_FINISH);
  165. if (!fFirstInit)
  166. {
  167. // if we've travelled through external apprentice pages,
  168. // it's easy for our current page pointer to get munged,
  169. // so reset it here for sanity's sake.
  170. gpWizardState->uCurrentPage = ORD_PAGE_ENDOLS;
  171. }
  172. return TRUE;
  173. }
  174. #endif //ICWDEBUG