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.

90 lines
2.5 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. dialogs.c
  5. Abstract:
  6. This file implements the dialog proc for the last wizard page.
  7. Environment:
  8. WIN32 User Mode
  9. Author:
  10. Wesley Witt (wesw) 17-Feb-1996
  11. --*/
  12. #include "wizard.h"
  13. #pragma hdrstop
  14. LRESULT
  15. LastPageDlgProc(
  16. HWND hwnd,
  17. UINT msg,
  18. WPARAM wParam,
  19. LPARAM lParam
  20. )
  21. {
  22. static BOOL Ok = TRUE;
  23. switch( msg ) {
  24. case WM_INITDIALOG:
  25. EnableWindow( GetDlgItem( GetParent( hwnd), IDCANCEL ), FALSE );
  26. SetDlgItemText(
  27. hwnd,
  28. IDC_LAST_LABEL01,
  29. RequestedSetupType == SETUP_TYPE_REMOTE_ADMIN ?
  30. GetString( IDS_LABEL02_LAST ) : GetString( IDS_LABEL01_LAST )
  31. );
  32. break;
  33. case WM_NOTIFY:
  34. switch( ((LPNMHDR)lParam)->code ) {
  35. case PSN_SETACTIVE:
  36. if (Unattended) {
  37. if (NtGuiMode) {
  38. //
  39. // if we're running in nt gui mode setup then
  40. // this is the end. we cannot simply call
  41. // ExitProcess() as in the normal faxsetup case
  42. // because we'll end gui mode setup, doh! the
  43. // best thing to do is simply simulate the user
  44. // pushing the finish button.
  45. //
  46. PostMessage( GetParent( hwnd), PSM_PRESSBUTTON, PSBTN_FINISH, 0 );
  47. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  48. return TRUE;
  49. }
  50. if (RebootRequired && !SuppressReboot) {
  51. SetupPromptReboot( NULL, NULL, FALSE );
  52. }
  53. ExitProcess(0);
  54. }
  55. if (InstallMode == INSTALL_REMOVE && Ok) {
  56. Ok = FALSE;
  57. SetWindowLong( hwnd, DWL_MSGRESULT, IDD_LAST_UNINSTALL_PAGE );
  58. return TRUE;
  59. }
  60. break;
  61. case PSN_WIZFINISH:
  62. if (RebootRequired && !SuppressReboot) {
  63. SetupPromptReboot( NULL, NULL, FALSE );
  64. }
  65. PostMessage( GetParent(GetParent(hwnd)), WM_USER+500, 0, 0 );
  66. break;
  67. }
  68. break;
  69. }
  70. return FALSE;
  71. }