/reporting/crashsender/ProgressDlg.h

http://crashrpt.googlecode.com/ · C Header · 86 lines · 49 code · 19 blank · 18 comment · 0 complexity · 02a426905faf0ee40fd263cd2fdf57d3 MD5 · raw file

  1. /*************************************************************************************
  2. This file is a part of CrashRpt library.
  3. Copyright (c) 2003-2013 The CrashRpt project authors. All Rights Reserved.
  4. Use of this source code is governed by a BSD-style license
  5. that can be found in the License.txt file in the root of the source
  6. tree. All contributing project authors may
  7. be found in the Authors.txt file in the root of the source tree.
  8. ***************************************************************************************/
  9. #pragma once
  10. #include "resource.h"
  11. #include "ErrorReportSender.h"
  12. #define WM_COMPLETECOLLECT (WM_APP+1)
  13. class CProgressDlg :
  14. public CDialogImpl<CProgressDlg>,
  15. public CDialogResize<CProgressDlg>
  16. {
  17. public:
  18. enum { IDD = IDD_PROGRESSDLG };
  19. enum ActionOnCancel
  20. {
  21. DONT_CLOSE,
  22. CLOSE_MYSELF,
  23. CLOSE_MYSELF_AND_PARENT
  24. };
  25. CProgressBarCtrl m_prgProgress;
  26. CListViewCtrl m_listView;
  27. CButton m_btnCancel;
  28. CStatic m_statText;
  29. BEGIN_DLGRESIZE_MAP(CProgressDlg)
  30. DLGRESIZE_CONTROL(IDC_PROGRESS, DLSZ_SIZE_X)
  31. DLGRESIZE_CONTROL(IDC_LIST, DLSZ_SIZE_X|DLSZ_SIZE_Y)
  32. DLGRESIZE_CONTROL(IDCANCEL, DLSZ_MOVE_Y)
  33. END_DLGRESIZE_MAP()
  34. BEGIN_MSG_MAP(CProgressDlg)
  35. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  36. MESSAGE_HANDLER(WM_CLOSE, OnClose)
  37. MESSAGE_HANDLER(WM_TIMER, OnTimer)
  38. COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
  39. COMMAND_ID_HANDLER(ID_MENU1_COPYSEL, OnCopySel)
  40. COMMAND_ID_HANDLER(ID_MENU1_COPYLOG, OnCopyLog)
  41. NOTIFY_HANDLER(IDC_LIST, NM_RCLICK, OnListRClick)
  42. CHAIN_MSG_MAP(CDialogResize<CProgressDlg>)
  43. END_MSG_MAP()
  44. // Handler prototypes (uncomment arguments if needed):
  45. // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
  46. // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
  47. // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
  48. LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
  49. LRESULT OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
  50. LRESULT OnTimer(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
  51. LRESULT OnListRClick(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/);
  52. LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
  53. LRESULT OnCopySel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
  54. LRESULT OnCopyLog(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
  55. // Displays the dialog and starts the timer.
  56. void Start(BOOL bCollectInfo, BOOL bMakeVisible=TRUE);
  57. // Stops the timer.
  58. void Stop();
  59. // Closes the dialog.
  60. void CloseDialog(int nVal);
  61. // This method places the data to clipboard.
  62. int SetClipboard(CString& sData);
  63. // Internal variables.
  64. ActionOnCancel m_ActionOnCancel; // What to do on cancel.
  65. ActionOnCancel m_ActionOnClose; // What to do on close.
  66. };