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.

105 lines
2.7 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
  7. server file copy 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. FileCopyDlgProc(
  17. HWND hwnd,
  18. UINT msg,
  19. WPARAM wParam,
  20. LPARAM lParam
  21. )
  22. {
  23. static BOOL OkToProceed = FALSE;
  24. static DWORD RangeMax = 0;
  25. HANDLE hThread;
  26. DWORD ThreadId;
  27. switch( msg ) {
  28. case WM_INITDIALOG:
  29. SetDlgItemText(
  30. hwnd,
  31. IDC_FC_WAITMSG,
  32. InstallMode & INSTALL_REMOVE ? GetString(IDS_DELETE_WAITMSG) : GetString(IDS_COPY_WAITMSG)
  33. );
  34. break ;
  35. case WM_MY_PROGRESS:
  36. if (wParam == 0xfe) {
  37. lParam += RangeMax;
  38. SendDlgItemMessage( hwnd, IDC_COPY_PROGRESS, PBM_SETRANGE, 0, MAKELPARAM(0,(lParam)));
  39. SendDlgItemMessage( hwnd, IDC_COPY_PROGRESS, PBM_SETSTEP, 1, 0 );
  40. } else if (wParam == 0xff) {
  41. RangeMax = lParam;
  42. } else {
  43. SendDlgItemMessage( hwnd, IDC_COPY_PROGRESS, PBM_DELTAPOS, wParam, 0 );
  44. }
  45. break;
  46. case WM_NOTIFY:
  47. switch( ((LPNMHDR)lParam)->code ) {
  48. case PSN_SETACTIVE:
  49. if (Unattended) {
  50. if (InstallMode & INSTALL_REMOVE) {
  51. UninstallThread( hwnd );
  52. } else {
  53. ServerFileCopyThread( hwnd );
  54. }
  55. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  56. return TRUE;
  57. } else {
  58. hThread = CreateThread(
  59. NULL,
  60. 0,
  61. (InstallMode & INSTALL_REMOVE) ?
  62. (LPTHREAD_START_ROUTINE) UninstallThread :
  63. (LPTHREAD_START_ROUTINE) ServerFileCopyThread,
  64. hwnd,
  65. 0,
  66. &ThreadId
  67. );
  68. if (hThread) {
  69. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  70. PropSheet_SetWizButtons( GetParent(hwnd), 0 );
  71. return FALSE;
  72. } else {
  73. //
  74. // popup an error
  75. //
  76. }
  77. }
  78. break;
  79. }
  80. break;
  81. }
  82. return FALSE;
  83. }