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.

123 lines
3.8 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 server
  7. routing directory store 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. RouteStoreDlgProc(
  17. HWND hwnd,
  18. UINT msg,
  19. WPARAM wParam,
  20. LPARAM lParam
  21. )
  22. {
  23. switch( msg ) {
  24. case WM_INITDIALOG:
  25. CheckDlgButton( hwnd, IDC_ANS_NO, BST_UNCHECKED );
  26. CheckDlgButton( hwnd, IDC_ANS_YES, BST_CHECKED );
  27. EnableWindow( GetDlgItem( hwnd, IDC_DEST_DIRPATH ), TRUE );
  28. EnableWindow( GetDlgItem( hwnd, IDC_BROWSE_DIR ), TRUE );
  29. ExpandEnvironmentStrings(
  30. DEFAULT_FAX_STORE_DIR,
  31. WizData.RouteDir,
  32. sizeof(WizData.RouteDir)
  33. );
  34. SetDlgItemText( hwnd, IDC_DEST_DIRPATH, WizData.RouteDir );
  35. break;
  36. case WM_COMMAND:
  37. if (HIWORD(wParam) == BN_CLICKED) {
  38. switch (LOWORD(wParam)) {
  39. case IDC_ANS_YES:
  40. EnableWindow( GetDlgItem( hwnd, IDC_DEST_DIRPATH ), TRUE );
  41. EnableWindow( GetDlgItem( hwnd, IDC_BROWSE_DIR ), TRUE );
  42. break;
  43. case IDC_ANS_NO:
  44. EnableWindow( GetDlgItem( hwnd, IDC_DEST_DIRPATH ), FALSE );
  45. EnableWindow( GetDlgItem( hwnd, IDC_BROWSE_DIR ), FALSE );
  46. break;
  47. case IDC_BROWSE_DIR:
  48. DoBrowseDestDir( hwnd );
  49. break;
  50. }
  51. }
  52. break;
  53. case WM_NOTIFY:
  54. switch( ((LPNMHDR)lParam)->code ) {
  55. case PSN_SETACTIVE:
  56. if (Unattended) {
  57. UnAttendGetAnswer(
  58. UAA_ROUTE_FOLDER,
  59. (LPBYTE) &WizData.RouteStore,
  60. sizeof(WizData.RouteStore)
  61. );
  62. if (WizData.RouteStore) {
  63. UnAttendGetAnswer(
  64. UAA_DEST_DIRPATH,
  65. (LPBYTE) WizData.RouteDir,
  66. sizeof(WizData.RouteDir)/sizeof(WCHAR)
  67. );
  68. MakeDirectory( WizData.RouteDir );
  69. }
  70. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  71. return TRUE;
  72. }
  73. if (InstallMode != INSTALL_NEW) {
  74. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  75. return TRUE;
  76. }
  77. break;
  78. case PSN_WIZNEXT:
  79. WizData.RouteStore = IsDlgButtonChecked( hwnd, IDC_ANS_YES );
  80. if (WizData.RouteStore) {
  81. SendDlgItemMessage(
  82. hwnd,
  83. IDC_DEST_DIRPATH,
  84. WM_GETTEXT,
  85. sizeof(WizData.RouteDir),
  86. (LPARAM) WizData.RouteDir
  87. );
  88. if (!WizData.RouteDir[0]) {
  89. PopUpMsg( hwnd, IDS_DEST_DIR, TRUE, 0 );
  90. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  91. return TRUE;
  92. }
  93. MakeDirectory( WizData.RouteDir );
  94. } else {
  95. WizData.RouteDir[0] = 0;
  96. }
  97. break;
  98. }
  99. break;
  100. }
  101. return FALSE;
  102. }