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.

85 lines
2.0 KiB

  1. class CAssemblyDownload;
  2. typedef enum
  3. {
  4. DOWNLOADDLG_STATE_INIT = 0,
  5. DOWNLOADDLG_STATE_GETTING_APP_MANIFEST,
  6. DOWNLOADDLG_STATE_GETTING_OTHER_FILES,
  7. DOWNLOADDLG_STATE_ALL_DONE,
  8. DOWNLOADDLG_STATE_MAX
  9. } DOWNLOADDLG_STATE;
  10. class CDownloadDlg
  11. {
  12. private:
  13. DOWNLOADDLG_STATE _eState;
  14. public:
  15. HWND _hwndDlg;
  16. IBackgroundCopyJob *_pJob;
  17. CDownloadDlg();
  18. ~CDownloadDlg();
  19. const WCHAR * GetString(UINT id);
  20. VOID SetWindowTime(HWND hwnd, FILETIME filetime);
  21. UINT64 GetSystemTimeAsUINT64();
  22. VOID SignalAlert(HWND hwndDlg, UINT Type);
  23. const WCHAR *MapStateToString(BG_JOB_STATE state);
  24. UINT64 ScaleDownloadRate(double Rate, /*rate in seconds*/ const WCHAR **pFormat );
  25. UINT64 ScaleDownloadEstimate(double Time, /*time in seconds*/ const WCHAR **pFormat );
  26. VOID UpdateDialog(HWND hwndDlg);
  27. VOID InitDialog(HWND hwndDlg);
  28. VOID CheckHR(HWND hwnd, HRESULT Hr, bool bThrow);
  29. VOID BITSCheckHR(HWND hwnd, HRESULT Hr, bool bThrow);
  30. VOID DoCancel(HWND hwndDlg, bool PromptUser);
  31. VOID DoFinish(HWND hwndDlg);
  32. VOID DoClose(HWND hwndDlg);
  33. VOID HandleTimerTick(HWND hwndDlg);
  34. HRESULT HandleUpdate();
  35. HRESULT HandleCOMCallback(IBackgroundCopyJob* pJob, bool CriticalEvent);
  36. HRESULT CreateUI(int nShowCmd);
  37. VOID CreateJob(WCHAR* szJobURL);
  38. VOID ResumeJob(WCHAR* szJobGUID, WCHAR* szJobFileName);
  39. VOID SetJob(IBackgroundCopyJob * pJob);
  40. VOID SetJobObject(IBackgroundCopyJob *pJob);
  41. VOID SetDlgState(DOWNLOADDLG_STATE eState);
  42. };
  43. INT_PTR CALLBACK DialogProc(
  44. HWND hwndDlg, // handle to dialog box
  45. UINT uMsg, // message
  46. WPARAM wParam, // first message parameter
  47. LPARAM lParam // second message parameter
  48. );
  49. HRESULT CreateDialogObject(CDownloadDlg **ppDlg, IBackgroundCopyJob *pJob);
  50. #define WM_FINISH_DOWNLOAD WM_USER+1
  51. #define WM_CANCEL_DOWNLOAD WM_USER+2