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.

120 lines
3.2 KiB

  1. //
  2. //
  3. //
  4. #ifndef _MAPPING_PAGE_H
  5. #define _MAPPING_PAGE_H
  6. #include "resource.h"
  7. #include "ExchControls.h"
  8. #include "PropSheet.h"
  9. class CAppMappingPage :
  10. public WTL::CPropertyPageImpl<CAppMappingPage>,
  11. public WTL::CWinDataExchange<CAppMappingPage>
  12. {
  13. typedef WTL::CPropertyPageImpl<CAppMappingPage> baseClass;
  14. public:
  15. CAppMappingPage(CAppData * pData)
  16. {
  17. m_pData = pData;
  18. }
  19. ~CAppMappingPage()
  20. {
  21. }
  22. enum {IDD = IDD_APPMAP};
  23. BEGIN_MSG_MAP_EX(CAppMappingPage)
  24. MSG_WM_INITDIALOG(OnInitDialog)
  25. COMMAND_HANDLER_EX(IDC_ADD, BN_CLICKED, OnAdd)
  26. COMMAND_HANDLER_EX(IDC_EDIT, BN_CLICKED, OnEdit)
  27. COMMAND_HANDLER_EX(IDC_REMOVE, BN_CLICKED, OnRemove)
  28. COMMAND_HANDLER_EX(IDC_CACHE_ISAPI, BN_CLICKED, OnCacheISAPI)
  29. CHAIN_MSG_MAP(baseClass)
  30. END_MSG_MAP()
  31. BEGIN_DDX_MAP(CAppMappingPage)
  32. DDX_CHECK(IDC_CACHE_ISAPI, m_pData->m_CacheISAPI)
  33. DDX_CONTROL(IDC_LIST, m_list)
  34. END_DDX_MAP()
  35. LRESULT OnInitDialog(HWND hDlg, LPARAM lParam);
  36. void OnAdd(UINT nCode, UINT nID, HWND hWnd);
  37. void OnEdit(UINT nCode, UINT nID, HWND hWnd);
  38. void OnRemove(UINT nCode, UINT nID, HWND hWnd);
  39. void OnCacheISAPI(UINT nCode, UINT nID, HWND hWnd);
  40. BOOL OnKillActive();
  41. protected:
  42. CAppData * m_pData;
  43. CListViewExch m_list;
  44. };
  45. class CEditMap :
  46. public CDialogImpl<CEditMap>,
  47. public WTL::CWinDataExchange<CEditMap>
  48. {
  49. public:
  50. CEditMap() :
  51. m_script_engine(FALSE),
  52. m_file_exists(FALSE),
  53. m_verbs_index(0),
  54. m_new(FALSE)
  55. {
  56. m_exec[0] = 0;
  57. m_ext[0] = 0;
  58. m_verbs[0] = 0;
  59. }
  60. ~CEditMap()
  61. {
  62. }
  63. enum {IDD = IDD_EDITMAP};
  64. protected:
  65. BEGIN_MSG_MAP_EX(CEditMap)
  66. MSG_WM_INITDIALOG(OnInitDialog)
  67. COMMAND_HANDLER_EX(IDC_HELPBTN, BN_CLICKED, OnHelp)
  68. COMMAND_HANDLER_EX(IDOK, BN_CLICKED, OnOK)
  69. COMMAND_HANDLER_EX(IDCANCEL, BN_CLICKED, OnCancel)
  70. COMMAND_HANDLER_EX(IDC_ALL_VERBS, BN_CLICKED, OnVerbs)
  71. COMMAND_HANDLER_EX(IDC_LIMIT_VERBS, BN_CLICKED, OnVerbs)
  72. COMMAND_HANDLER_EX(IDC_EXTENSION, EN_CHANGE, OnExtChanged)
  73. COMMAND_HANDLER_EX(IDC_EXECUTABLE, EN_CHANGE, OnExecChanged)
  74. COMMAND_HANDLER_EX(IDC_VERBS, EN_CHANGE, OnVerbsChanged)
  75. END_MSG_MAP()
  76. BEGIN_DDX_MAP(CEditMap)
  77. DDX_TEXT(IDC_EXECUTABLE, m_exec)
  78. DDX_TEXT(IDC_EXTENSION, m_ext)
  79. DDX_TEXT(IDC_VERBS, m_verbs)
  80. DDX_RADIO(IDC_ALL_VERBS, m_verbs_index)
  81. DDX_CHECK(IDC_SCRIPT_ENGINE, m_script_engine)
  82. DDX_CHECK(IDC_FILE_EXISTS, m_file_exists)
  83. END_DDX_MAP()
  84. LRESULT OnInitDialog(HWND hDlg, LPARAM lParam);
  85. void OnBrowse(UINT nCode, UINT nID, HWND hWnd);
  86. void OnHelp(UINT nCode, UINT nID, HWND hWnd);
  87. void OnOK(UINT nCode, UINT nID, HWND hWnd);
  88. void OnCancel(UINT nCode, UINT nID, HWND hWnd);
  89. void OnVerbs(UINT nCode, UINT nID, HWND hWnd);
  90. void OnExtChanged(UINT nCode, UINT nID, HWND hWnd);
  91. void OnExecChanged(UINT nCode, UINT nID, HWND hWnd);
  92. void OnVerbsChanged(UINT nCode, UINT nID, HWND hWnd);
  93. public:
  94. TCHAR m_exec[MAX_PATH];
  95. TCHAR m_ext[MAX_PATH];
  96. CString m_prev_ext;
  97. TCHAR m_verbs[MAX_PATH];
  98. int m_verbs_index;
  99. BOOL m_script_engine, m_file_exists;
  100. BOOL m_new, m_bExtValid, m_bExecValid, m_bVerbsValid;
  101. DWORD m_flags;
  102. CFileChooser m_FileChooser;
  103. CAppData * m_pData;
  104. };
  105. #endif //_MAPPING_PAGE_H