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.

109 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. dlgcfcpy.c
  5. Abstract:
  6. This file implements the dialog proc for the client file copies.
  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. ClientFileCopyDlgProc(
  16. HWND hwnd,
  17. UINT msg,
  18. WPARAM wParam,
  19. LPARAM lParam
  20. )
  21. {
  22. static BOOL OkToProceed = FALSE;
  23. static DWORD RangeMax = 0;
  24. HANDLE hThread;
  25. DWORD ThreadId;
  26. switch( msg ) {
  27. case WM_MY_PROGRESS:
  28. if (wParam == 0xfe) {
  29. lParam += RangeMax;
  30. SendDlgItemMessage( hwnd, IDC_COPY_PROGRESS, PBM_SETRANGE, 0, MAKELPARAM(0,(lParam)));
  31. SendDlgItemMessage( hwnd, IDC_COPY_PROGRESS, PBM_SETSTEP, 1, 0 );
  32. } else if (wParam == 0xff) {
  33. RangeMax = lParam;
  34. } else {
  35. SendDlgItemMessage( hwnd, IDC_COPY_PROGRESS, PBM_DELTAPOS, wParam, 0 );
  36. }
  37. break;
  38. case WM_NOTIFY:
  39. switch( ((LPNMHDR)lParam)->code ) {
  40. case PSN_SETACTIVE:
  41. {
  42. if (Unattended) {
  43. if (InstallMode & INSTALL_REMOVE) {
  44. UninstallThread( hwnd );
  45. } else if (PointPrintSetup) {
  46. PointPrintFileCopyThread( hwnd );
  47. } else {
  48. ClientFileCopyThread( hwnd );
  49. }
  50. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  51. return TRUE;
  52. }
  53. SetDlgItemText(
  54. hwnd,
  55. IDC_FC_WAITMSG,
  56. InstallMode & INSTALL_REMOVE ? GetString(IDS_DELETE_WAITMSG) : GetString(IDS_COPY_WAITMSG)
  57. );
  58. }
  59. hThread = CreateThread(
  60. NULL,
  61. 0,
  62. (InstallMode & INSTALL_REMOVE) ?
  63. (LPTHREAD_START_ROUTINE) UninstallThread :
  64. PointPrintSetup ?
  65. (LPTHREAD_START_ROUTINE) PointPrintFileCopyThread :
  66. (LPTHREAD_START_ROUTINE) ClientFileCopyThread,
  67. hwnd,
  68. 0,
  69. &ThreadId
  70. );
  71. if (hThread) {
  72. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  73. PropSheet_SetWizButtons( GetParent(hwnd), 0 );
  74. return FALSE;
  75. } else {
  76. //
  77. // popup an error
  78. //
  79. }
  80. break;
  81. }
  82. break;
  83. }
  84. return FALSE;
  85. }