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.

136 lines
4.1 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. dialogs.c
  5. Abstract:
  6. This file implements the dialog procs for the user
  7. information page.
  8. Environment:
  9. WIN32 User Mode
  10. Author:
  11. Wesley Witt (wesw) 17-Feb-1996
  12. --*/
  13. #include "wizard.h"
  14. #pragma hdrstop
  15. LRESULT
  16. ClientUserInfoDlgProc(
  17. HWND hwnd,
  18. UINT msg,
  19. WPARAM wParam,
  20. LPARAM lParam
  21. )
  22. {
  23. switch( msg ) {
  24. case WM_INITDIALOG:
  25. {
  26. LPTSTR UserName;
  27. LPTSTR AreaCode;
  28. LPTSTR FaxNumber;
  29. GetUserInformation( &UserName, &FaxNumber, &AreaCode );
  30. SendDlgItemMessage( hwnd, IDC_SENDER_NAME, EM_SETLIMITTEXT, LT_USER_NAME, 0 );
  31. SendDlgItemMessage( hwnd, IDC_SENDER_FAX_AREA_CODE, EM_SETLIMITTEXT, LT_AREA_CODE, 0 );
  32. SendDlgItemMessage( hwnd, IDC_SENDER_FAX_NUMBER, EM_SETLIMITTEXT, LT_PHONE_NUMBER, 0 );
  33. SetDlgItemText( hwnd, IDC_SENDER_NAME, UserName );
  34. SetDlgItemText( hwnd, IDC_SENDER_FAX_AREA_CODE, AreaCode );
  35. SetDlgItemText( hwnd, IDC_SENDER_FAX_NUMBER, FaxNumber );
  36. MemFree( UserName );
  37. MemFree( AreaCode );
  38. MemFree( FaxNumber );
  39. }
  40. break;
  41. case WM_NOTIFY:
  42. switch( ((LPNMHDR)lParam)->code ) {
  43. case PSN_SETACTIVE:
  44. if (Unattended) {
  45. UnAttendGetAnswer(
  46. UAA_SENDER_NAME,
  47. (LPBYTE) WizData.UserName,
  48. LT_USER_NAME
  49. );
  50. UnAttendGetAnswer(
  51. UAA_SENDER_FAX_AREA_CODE,
  52. (LPBYTE) WizData.AreaCode,
  53. LT_AREA_CODE+1
  54. );
  55. UnAttendGetAnswer(
  56. UAA_SENDER_FAX_NUMBER,
  57. (LPBYTE) WizData.PhoneNumber,
  58. LT_PHONE_NUMBER+1
  59. );
  60. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  61. return TRUE;
  62. }
  63. if (InstallMode & INSTALL_UPGRADE || InstallMode & INSTALL_REMOVE) {
  64. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  65. return TRUE;
  66. }
  67. break;
  68. case PSN_WIZNEXT:
  69. SendDlgItemMessage(
  70. hwnd,
  71. IDC_SENDER_NAME,
  72. WM_GETTEXT,
  73. LT_USER_NAME,
  74. (LPARAM) WizData.UserName
  75. );
  76. SendDlgItemMessage(
  77. hwnd,
  78. IDC_SENDER_FAX_AREA_CODE,
  79. WM_GETTEXT,
  80. LT_AREA_CODE+1,
  81. (LPARAM) WizData.AreaCode
  82. );
  83. SendDlgItemMessage(
  84. hwnd,
  85. IDC_SENDER_FAX_NUMBER,
  86. WM_GETTEXT,
  87. LT_PHONE_NUMBER+1,
  88. (LPARAM) WizData.PhoneNumber
  89. );
  90. if (!WizData.UserName[0]) {
  91. PopUpMsg( hwnd, IDS_INVALID_USER_NAME, TRUE, 0 );
  92. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  93. return TRUE;
  94. }
  95. if (!WizData.AreaCode[0]) {
  96. PopUpMsg( hwnd, IDS_INVALID_AREA_CODE, TRUE, 0 );
  97. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  98. return TRUE;
  99. }
  100. if (!WizData.PhoneNumber[0]) {
  101. PopUpMsg( hwnd, IDS_INVALID_PHONE_NUMBER, TRUE, 0 );
  102. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  103. return TRUE;
  104. }
  105. break;
  106. }
  107. break;
  108. }
  109. return FALSE;
  110. }