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.

91 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. dlgra.c
  5. Abstract:
  6. This file implements the dialog proc for the remote admin 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. RemoteAdminFileCopyDlgProc(
  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. SetDlgItemText(
  42. hwnd,
  43. IDC_FC_WAITMSG,
  44. GetString( InstallMode & INSTALL_REMOVE ? IDS_DELETE_WAITMSG : IDS_COPY_WAITMSG )
  45. );
  46. hThread = CreateThread(
  47. NULL,
  48. 0,
  49. (InstallMode & INSTALL_REMOVE) ?
  50. (LPTHREAD_START_ROUTINE) UninstallThread : RemoteAdminCopyThread,
  51. hwnd,
  52. 0,
  53. &ThreadId
  54. );
  55. if (hThread) {
  56. SetWindowLong( hwnd, DWL_MSGRESULT, -1 );
  57. PropSheet_SetWizButtons( GetParent(hwnd), 0 );
  58. return FALSE;
  59. } else {
  60. //
  61. // popup an error
  62. //
  63. }
  64. break;
  65. }
  66. break;
  67. }
  68. return FALSE;
  69. }