Leaked source code of windows server 2003
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.

93 lines
2.2 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. CString _sTitle;
  15. public:
  16. HWND _hwndDlg;
  17. IBackgroundCopyJob *_pJob;
  18. UINT64 _ui64StartTime;
  19. UINT64 _ui64BytesFromPrevJobs;
  20. DWORD _dwJobCount;
  21. CDownloadDlg();
  22. ~CDownloadDlg();
  23. const WCHAR * GetString(UINT id);
  24. VOID SetWindowTime(HWND hwnd, FILETIME filetime);
  25. UINT64 GetSystemTimeAsUINT64();
  26. VOID SignalAlert(HWND hwndDlg, UINT Type);
  27. const WCHAR *MapStateToString(BG_JOB_STATE state);
  28. UINT64 ScaleDownloadRate(double Rate, /*rate in seconds*/ const WCHAR **pFormat );
  29. UINT64 ScaleDownloadEstimate(double Time, /*time in seconds*/ const WCHAR **pFormat );
  30. VOID UpdateDialog(HWND hwndDlg);
  31. VOID UpdateDialog(HWND hwndDlg, LPWSTR wzErrorMsg);
  32. HRESULT UpdateProgress( HWND hwndDlg);
  33. VOID InitDialog(HWND hwndDlg);
  34. VOID CheckHR(HWND hwnd, HRESULT Hr, bool bThrow);
  35. VOID BITSCheckHR(HWND hwnd, HRESULT Hr, bool bThrow);
  36. VOID DoCancel(HWND hwndDlg, bool PromptUser);
  37. VOID DoFinish(HWND hwndDlg);
  38. VOID DoClose(HWND hwndDlg);
  39. VOID HandleTimerTick(HWND hwndDlg);
  40. HRESULT HandleUpdate();
  41. HRESULT CreateUI(int nShowCmd);
  42. VOID CreateJob(WCHAR* szJobURL);
  43. VOID ResumeJob(WCHAR* szJobGUID, WCHAR* szJobFileName);
  44. VOID SetJob(IBackgroundCopyJob * pJob);
  45. VOID SetJobObject(IBackgroundCopyJob *pJob);
  46. VOID SetDlgState(DOWNLOADDLG_STATE eState);
  47. HRESULT SetDlgTitle(LPCWSTR pwzTitle);
  48. };
  49. INT_PTR CALLBACK DialogProc(
  50. HWND hwndDlg, // handle to dialog box
  51. UINT uMsg, // message
  52. WPARAM wParam, // first message parameter
  53. LPARAM lParam // second message parameter
  54. );
  55. HRESULT CreateDialogObject(CDownloadDlg **ppDlg);
  56. #define WM_FINISH_DOWNLOAD WM_USER+1
  57. #define WM_CANCEL_DOWNLOAD WM_USER+2
  58. #define WM_SETCALLBACKTIMER WM_USER+3