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.

84 lines
2.2 KiB

  1. // settings.h : header file
  2. //
  3. #ifndef SETTINGS_H
  4. #define SETTINGS_H
  5. /////////////////////////////////////////////////////////////////////////////
  6. // CTrapSettingsDlg dialog
  7. class CTrapSettingsDlg;
  8. class CEventArray;
  9. // this message is posted by background threads to the UI thread, requesting
  10. // changes in the UI. wParam identifies the UI command (from the #defines below),
  11. // lParam identifies the actual parameters of the command.
  12. #define WM_UIREQUEST (WM_USER + 13)
  13. // the 'enable' state of the 'Reset' button should be changed to the state indicated
  14. // in lParam.
  15. #define UICMD_ENABLE_RESET 1
  16. UINT _thrRun(CTrapSettingsDlg *trapDlg);
  17. class CTrapSettingsDlg : public CDialog
  18. {
  19. // Construction
  20. public:
  21. UINT thrRun();
  22. CTrapSettingsDlg(CWnd* pParent = NULL); // standard constructor
  23. BOOL EditSettings();
  24. // Dialog Data
  25. //{{AFX_DATA(CTrapSettingsDlg)
  26. enum { IDD = IDD_SETTINGSDLG };
  27. CStatic m_statTrapLength;
  28. CEdit m_edtMessageLength;
  29. CEdit m_edtSeconds;
  30. CEdit m_edtTrapCount;
  31. CSpinButtonCtrl m_spinMessageLength;
  32. CButton m_btnResetThrottle;
  33. BOOL m_bLimitMsgLength;
  34. //}}AFX_DATA
  35. BOOL m_bTrimMessagesFirst;
  36. BOOL m_bThrottleEnabled;
  37. CWinThread* m_pthRegNotification;
  38. CEvent m_evTermination;
  39. CEvent m_evRegNotification;
  40. // Overrides
  41. // ClassWizard generated virtual function overrides
  42. //{{AFX_VIRTUAL(CTrapSettingsDlg)
  43. protected:
  44. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  45. //}}AFX_VIRTUAL
  46. // Implementation
  47. protected:
  48. // Generated message map functions
  49. //{{AFX_MSG(CTrapSettingsDlg)
  50. afx_msg void OnLimitMessageLength();
  51. virtual BOOL OnInitDialog();
  52. virtual void OnOK();
  53. afx_msg void OnRadioDisable();
  54. afx_msg void OnRadioEable();
  55. afx_msg void OnButtonReset();
  56. afx_msg BOOL OnHelpInfo(HELPINFO*);
  57. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  58. afx_msg void OnClose();
  59. afx_msg LRESULT OnUIRequest(WPARAM cmd, LPARAM lParam);
  60. virtual void OnCancel();
  61. //}}AFX_MSG
  62. DECLARE_MESSAGE_MAP()
  63. private:
  64. void EnableThrottleWindows(BOOL bEnableThrottle);
  65. SCODE GetTrapsPerSecond(LONG* pnTraps, LONG* pnSeconds);
  66. SCODE GetMessageLength(LONG* pnChars);
  67. void TerminateBackgroundThread();
  68. };
  69. #endif //SETTINGS_H