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.

73 lines
1.8 KiB

  1. //
  2. //
  3. //
  4. #ifndef _PROCESS_OPT_H
  5. #define _PROCESS_OPT_H
  6. #include "resource.h"
  7. #include "ExchControls.h"
  8. #include "PropSheet.h"
  9. #define TIMEOUT_MIN 0
  10. #define TIMEOUT_MAX 2000000000
  11. class CProcessOptPage :
  12. public WTL::CPropertyPageImpl<CProcessOptPage>,
  13. public WTL::CWinDataExchange<CProcessOptPage>
  14. {
  15. typedef WTL::CPropertyPageImpl<CProcessOptPage> baseClass;
  16. public:
  17. CProcessOptPage(CAppData * pData)
  18. {
  19. m_pData = pData;
  20. }
  21. ~CProcessOptPage()
  22. {
  23. }
  24. enum {IDD = IDD_PROCESS_OPT};
  25. BEGIN_MSG_MAP_EX(CProcessOptPage)
  26. MSG_WM_INITDIALOG(OnInitDialog)
  27. COMMAND_HANDLER_EX(IDC_LOG_FAILS, BN_CLICKED, OnChangeData)
  28. COMMAND_HANDLER_EX(IDC_DEBUG_EXCEPTION, BN_CLICKED, OnChangeData)
  29. COMMAND_HANDLER_EX(IDC_CGI_TIMEOUT, EN_CHANGE, OnChangeData);
  30. CHAIN_MSG_MAP(baseClass)
  31. END_MSG_MAP()
  32. BEGIN_DDX_MAP(CProcessOptPage)
  33. DDX_CHECK(IDC_LOG_FAILS, m_pData->m_LogFailures)
  34. DDX_CHECK(IDC_DEBUG_EXCEPTION, m_pData->m_DebugExcept)
  35. DDX_INT_RANGE(IDC_CGI_TIMEOUT, m_pData->m_CgiTimeout, TIMEOUT_MIN, TIMEOUT_MAX)
  36. DDX_CONTROL(IDC_TIMEOUT_SPIN, m_TimeoutSpin)
  37. END_DDX_MAP()
  38. LRESULT OnInitDialog(HWND hDlg, LPARAM lParam);
  39. void OnChangeData(UINT nCode, UINT nID, HWND hWnd)
  40. {
  41. if (nCode == EN_CHANGE)
  42. {
  43. TCHAR buf[MAX_PATH];
  44. UINT len = GetDlgItemText(nID, buf, MAX_PATH);
  45. BOOL bEnable = (len != 0);
  46. // Disable OK and Apply buttons
  47. ::EnableWindow(::GetDlgItem(GetParent(), IDOK), bEnable);
  48. if (!bEnable)
  49. {
  50. SET_MODIFIED(FALSE);
  51. return;
  52. }
  53. }
  54. SET_MODIFIED(TRUE);
  55. }
  56. BOOL OnKillActive();
  57. void OnHelp();
  58. void OnDataValidateError(UINT nCtrlID, BOOL bSave, _XData& data);
  59. void OnDataExchangeError(UINT nCtrlID, BOOL bSave);
  60. protected:
  61. CAppData * m_pData;
  62. CUpDownCtrlExch m_TimeoutSpin;
  63. };
  64. #endif //_PROCESS_OPT_H