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.3 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 client's
  7. server name 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. ClientServerNameDlgProc(
  17. HWND hwnd,
  18. UINT msg,
  19. WPARAM wParam,
  20. LPARAM lParam
  21. )
  22. {
  23. TCHAR Buffer[EM_SETLIMITTEXT+1];
  24. switch( msg ) {
  25. case WM_INITDIALOG:
  26. SendDlgItemMessage( hwnd, IDC_SERVER_NAME, EM_SETLIMITTEXT, LT_PRINTER_NAME, 0 );
  27. break;
  28. case WM_NOTIFY:
  29. switch( ((LPNMHDR)lParam)->code ) {
  30. case PSN_SETACTIVE:
  31. if (Unattended) {
  32. UnAttendGetAnswer(
  33. UAA_PRINTER_NAME,
  34. (LPBYTE) WizData.PrinterName,
  35. LT_PRINTER_NAME
  36. );
  37. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  38. return TRUE;
  39. }
  40. if (InstallMode & INSTALL_UPGRADE || InstallMode & INSTALL_REMOVE) {
  41. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  42. return TRUE;
  43. }
  44. break;
  45. case PSN_WIZNEXT:
  46. SendDlgItemMessage(
  47. hwnd,
  48. IDC_SERVER_NAME,
  49. WM_GETTEXT,
  50. LT_PRINTER_NAME,
  51. (LPARAM) Buffer
  52. );
  53. if (!Buffer[0]) {
  54. PopUpMsg( hwnd, IDS_PRINTER_NAME, TRUE, 0 );
  55. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  56. return TRUE;
  57. }
  58. if (Buffer[0] == TEXT('\\') && Buffer[1] == TEXT('\\')) {
  59. _tcscpy( WizData.PrinterName, Buffer );
  60. } else {
  61. WizData.PrinterName[0] = TEXT('\\');
  62. WizData.PrinterName[1] = TEXT('\\');
  63. WizData.PrinterName[2] = 0;
  64. _tcscat( WizData.PrinterName, Buffer );
  65. }
  66. break;
  67. }
  68. break;
  69. }
  70. return FALSE;
  71. }