Leaked source code of windows server 2003
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.

130 lines
4.2 KiB

  1. //=============================================================================
  2. // PageIni.h : Declaration of the CPageIni
  3. //=============================================================================
  4. #if !defined(AFX_PAGEINI_H__99C60D0D_C4C9_4FE9_AFD4_58E806AAD967__INCLUDED_)
  5. #define AFX_PAGEINI_H__99C60D0D_C4C9_4FE9_AFD4_58E806AAD967__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "MSConfigState.h"
  10. #include "PageBase.h"
  11. #define IMG_UNCHECKED 2
  12. #define IMG_CHECKED 3
  13. #define IMG_FUZZY 9
  14. #define IMG_FUZZY_RTL 10
  15. #define IMG_CHECKED_RTL 11
  16. #define DISABLE_STRING _T(";msconfig ")
  17. #define DISABLE_STRING_HDR _T(";msconfig [")
  18. #define TESTING_EXTENSION_KEY _T("IniPageExtension")
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CPageIni dialog
  21. class CPageIni : public CPropertyPage, public CPageBase
  22. {
  23. DECLARE_DYNCREATE(CPageIni)
  24. // Construction
  25. public:
  26. CPageIni();
  27. ~CPageIni();
  28. // Dialog Data
  29. //{{AFX_DATA(CPageIni)
  30. enum { IDD = IDD_PAGEINI };
  31. // NOTE - ClassWizard will add data members here.
  32. // DO NOT EDIT what you see in these blocks of generated code !
  33. //}}AFX_DATA
  34. // Overrides
  35. // ClassWizard generate virtual function overrides
  36. //{{AFX_VIRTUAL(CPageIni)
  37. protected:
  38. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  39. //}}AFX_VIRTUAL
  40. // Implementation
  41. protected:
  42. // Generated message map functions
  43. //{{AFX_MSG(CPageIni)
  44. virtual BOOL OnInitDialog();
  45. afx_msg void OnButtonDisable();
  46. afx_msg void OnButtonDisableAll();
  47. afx_msg void OnButtonEnable();
  48. afx_msg void OnButtonEnableAll();
  49. afx_msg void OnButtonMoveDown();
  50. afx_msg void OnButtonMoveUp();
  51. afx_msg void OnSelChangedTree(NMHDR* pNMHDR, LRESULT* pResult);
  52. afx_msg void OnButtonSearch();
  53. afx_msg void OnClickTree(NMHDR* pNMHDR, LRESULT* pResult);
  54. afx_msg void OnButtonEdit();
  55. afx_msg void OnEndLabelEdit(NMHDR* pNMHDR, LRESULT* pResult);
  56. afx_msg void OnButtonNew();
  57. afx_msg void OnBeginLabelEditIniTree(NMHDR* pNMHDR, LRESULT* pResult);
  58. afx_msg void OnKeyDownTree(NMHDR* pNMHDR, LRESULT* pResult);
  59. //}}AFX_MSG
  60. DECLARE_MESSAGE_MAP()
  61. public:
  62. void SetTabInfo(LPCTSTR szFilename);
  63. private:
  64. BOOL LoadINIFile(CStringArray & lines, int & iLastLine, BOOL fLoadBackupFile = FALSE);
  65. BOOL WriteINIFile(CStringArray & lines, int iLastLine, BOOL fUndoable = TRUE);
  66. void UpdateTreeView();
  67. int UpdateLine(HTREEITEM hti);
  68. void SetEnable(BOOL fEnable, HTREEITEM htiNode = NULL, BOOL fUpdateLine = TRUE, BOOL fBroadcast = TRUE);
  69. void MoveBranch(HWND hwndTree, HTREEITEM htiMove, HTREEITEM htiParent, HTREEITEM htiAfter);
  70. HTREEITEM CopyBranch(HWND hwndTree, HTREEITEM htiFrom, HTREEITEM htiToParent, HTREEITEM htiToAfter);
  71. void UpdateControls();
  72. HTREEITEM GetNextItem(HTREEITEM hti);
  73. TabState GetCurrentTabState();
  74. BOOL OnApply();
  75. void CommitChanges();
  76. void SetNormal();
  77. void SetDiagnostic();
  78. LPCTSTR GetName() { return m_strINIFile; };
  79. HWND GetDlgItemHWND(UINT nID)
  80. {
  81. HWND hwnd = NULL;
  82. CWnd * pWnd = GetDlgItem(nID);
  83. if (pWnd)
  84. hwnd = pWnd->m_hWnd;
  85. ASSERT(hwnd);
  86. return hwnd;
  87. }
  88. private:
  89. BOOL m_fModified;
  90. void SetModified(BOOL bChanged = TRUE)
  91. {
  92. m_fModified = bChanged;
  93. CPropertyPage::SetModified(bChanged);
  94. }
  95. private:
  96. CStringArray m_lines; // the lines of the INI file
  97. int m_iLastLine; // last real line in the m_line array
  98. CString m_strCaption; // contains the localized name of this page
  99. CString m_strINIFile; // the INI file this page is editing
  100. CString m_strTestExtension; // is set, this is appended to the file name
  101. CString m_strLastSearch; // last string searched for
  102. CImageList m_imagelist; // bitmaps for the tree view
  103. BOOL m_fImageList; // did the image list load correctly
  104. CWindow m_tree; // we'll attach this to the tree
  105. int m_checkedID; // image ID for checked image
  106. int m_uncheckedID; // image ID for unchecked image
  107. int m_fuzzyID; // image ID for the indetermined state.
  108. };
  109. //{{AFX_INSERT_LOCATION}}
  110. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  111. #endif // !defined(AFX_PAGEINI_H__99C60D0D_C4C9_4FE9_AFD4_58E806AAD967__INCLUDED_)