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.

139 lines
3.9 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1997 **/
  4. /**********************************************************************/
  5. /*
  6. sfmfasoc.h
  7. prototypes for the file association property page.
  8. FILE HISTORY:
  9. 8/20/97 ericdav Code moved into file managemnet snapin
  10. */
  11. #ifndef _SFMFASOC_H
  12. #define _SFMFASOC_H
  13. #ifndef _SFMUTIL_H
  14. #include "sfmutil.h"
  15. #endif
  16. #if _MSC_VER >= 1000
  17. #pragma once
  18. #endif // _MSC_VER >= 1000
  19. class CAfpTypeCreator
  20. {
  21. public:
  22. CAfpTypeCreator(PAFP_TYPE_CREATOR pAfpTypeCreator)
  23. {
  24. ASSERT(pAfpTypeCreator != NULL);
  25. m_strCreator = pAfpTypeCreator->afptc_creator;
  26. m_strType = pAfpTypeCreator->afptc_type;
  27. m_strComment = pAfpTypeCreator->afptc_comment;
  28. m_dwId = pAfpTypeCreator->afptc_id;
  29. }
  30. // interface
  31. public:
  32. LPCTSTR QueryCreator() { return (LPCTSTR) m_strCreator; };
  33. int QueryCreatorLength() { return m_strCreator.GetLength(); };
  34. LPCTSTR QueryType() { return (LPCTSTR) m_strType; };
  35. int QueryTypeLength() { return m_strType.GetLength(); };
  36. LPCTSTR QueryComment() { return (LPCTSTR) m_strComment; };
  37. int QueryCommentLength() { return m_strComment.GetLength(); };
  38. DWORD QueryId() { return m_dwId; };
  39. void SetCreator(LPCTSTR pCreator) { m_strCreator = pCreator; };
  40. void SetType(LPCTSTR pType) { m_strType = pType; };
  41. void SetComment(LPCTSTR pComment) { m_strComment = pComment; };
  42. void SetId(DWORD dwId) { m_dwId = dwId; };
  43. // attributes
  44. private:
  45. CString m_strCreator;
  46. CString m_strType;
  47. CString m_strComment;
  48. DWORD m_dwId;
  49. };
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CMacFilesFileAssociation dialog
  52. class CMacFilesFileAssociation : public CPropertyPage
  53. {
  54. DECLARE_DYNCREATE(CMacFilesFileAssociation)
  55. // Construction
  56. public:
  57. CMacFilesFileAssociation();
  58. ~CMacFilesFileAssociation();
  59. // Dialog Data
  60. //{{AFX_DATA(CMacFilesFileAssociation)
  61. enum { IDD = IDP_SFM_FILE_ASSOCIATION };
  62. CListCtrl m_listctrlCreators;
  63. CComboBox m_comboExtension;
  64. CButton m_buttonEdit;
  65. CButton m_buttonDelete;
  66. CButton m_buttonAssociate;
  67. CButton m_buttonAdd;
  68. //}}AFX_DATA
  69. // Overrides
  70. // ClassWizard generate virtual function overrides
  71. //{{AFX_VIRTUAL(CMacFilesFileAssociation)
  72. protected:
  73. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  74. //}}AFX_VIRTUAL
  75. // Implementation
  76. protected:
  77. // Generated message map functions
  78. //{{AFX_MSG(CMacFilesFileAssociation)
  79. afx_msg void OnButtonAdd();
  80. afx_msg void OnButtonAssociate();
  81. afx_msg void OnButtonDelete();
  82. afx_msg void OnButtonEdit();
  83. virtual BOOL OnInitDialog();
  84. afx_msg void OnSelchangeComboExtension();
  85. afx_msg void OnEditchangeComboExtension();
  86. afx_msg void OnDblclkListTypeCreators(NMHDR* pNMHDR, LRESULT* pResult);
  87. afx_msg void OnClose();
  88. afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
  89. afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
  90. afx_msg void OnItemchangedListTypeCreators(NMHDR* pNMHDR, LRESULT* pResult);
  91. afx_msg void OnColumnclickListTypeCreators(NMHDR* pNMHDR, LRESULT* pResult);
  92. afx_msg void OnDestroy();
  93. afx_msg void OnDeleteitemListTypeCreators(NMHDR* pNMHDR, LRESULT* pResult);
  94. //}}AFX_MSG
  95. DECLARE_MESSAGE_MAP()
  96. void InitListCtrl();
  97. void ClearListCtrl();
  98. void SetCurSel(int nIndex);
  99. int GetCurSel();
  100. void InsertItem(CAfpTypeCreator * pItemData);
  101. void EnableControls(BOOL fEnable);
  102. DWORD SelectTypeCreator(DWORD dwId);
  103. DWORD SelectTypeCreator(CString & strCreator, CString & strType);
  104. DWORD Update();
  105. DWORD Refresh();
  106. CAfpTypeCreator * GetTCObject(int nIndex);
  107. public:
  108. CSFMPropertySheet * m_pSheet;
  109. int m_nSortColumn;
  110. };
  111. //{{AFX_INSERT_LOCATION}}
  112. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  113. #endif _SFMFASOC_H