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.

127 lines
4.2 KiB

  1. #ifndef __PropWnd2_h__
  2. #define __PropWnd2_h__
  3. ////////////////////////////////////////////////////////////////////////////////////////////////////
  4. #pragma warning( disable : 4786 )
  5. #include <list>
  6. #include <map>
  7. #include "poldata.h"
  8. #include "controlID.h"
  9. using namespace std;
  10. ////////////////////////////////////////////////////////////////////////////////////////////////////
  11. LRESULT CALLBACK DefaultProc( HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam );
  12. class CPropertyDataWindow2
  13. {
  14. friend class CNmAkWiz;
  15. public: // Static functions
  16. static void MapControlsToRegKeys( void );
  17. private: // Static functions
  18. public: // Static Data
  19. static const int mcs_iTop;
  20. static const int mcs_iLeft;
  21. static const int mcs_iBorder;
  22. protected: // Static Data
  23. static map< UINT, CPolicyData::eKeyType > ms_ClassMap;
  24. static map< UINT, TCHAR* > ms_KeyMap;
  25. static map< UINT, TCHAR* > ms_ValueMap;
  26. protected: // DATA
  27. // Frame Window for data boxes
  28. TCHAR *m_szClassName;
  29. HWND m_hwnd;
  30. HWND m_hwndParent;
  31. UINT m_IDD;
  32. WNDPROC m_wndProc;
  33. RECT m_rect;
  34. list< UINT > m_checkIDList;
  35. list< HWND > m_enableList;
  36. list< CControlID * > m_condList;
  37. list< CControlID * > m_specialControlList;
  38. BOOL m_bInit;
  39. public: // construction / destruction
  40. CPropertyDataWindow2( HWND hwndParent, UINT uIDD, LPTSTR szClassName, WNDPROC wndProc, UINT PopUpHelpMenuTextId, int iX, int iY, int iWidth, int iHeight, BOOL bScroll = TRUE );
  41. CPropertyDataWindow2( HWND hwndParent, UINT uIDD, LPTSTR szClassName, UINT PopUpHelpMenuTextId, int iX, int iY, int iWidth, int iHeight, BOOL bScroll = TRUE );
  42. ~CPropertyDataWindow2( void );
  43. public: // Member fns
  44. inline HWND GetHwnd() { return m_hwnd; };
  45. inline int LoadString( UINT IDS, LPTSTR lpszBuffer, int cb ) { return ::LoadString( g_hInstance, IDS, lpszBuffer, cb ); }
  46. void ConnectControlsToCheck( UINT idCheck, UINT uCount, ... );
  47. void AddControl( CControlID *pControl );
  48. void SetEnableListID( UINT uCount, ... );
  49. void GetEditData( UINT id, TCHAR* sz, ULONG cb ) const;
  50. void SetEditData( UINT id, TCHAR* sz );
  51. ULONG GetEditDataLen( UINT id ) const;
  52. BOOL SetFocus( UINT id );
  53. BOOL GetCheck( UINT id ) const;
  54. void SetCheck( UINT id, BOOL bCheck );
  55. void ShowWindow( BOOL bShowWindow = TRUE );
  56. void EnableWindow( BOOL bEnable = TRUE );
  57. void ReadSettings( void );
  58. BOOL WriteSettings( void );
  59. void Reset();
  60. BOOL WriteToINF( HANDLE hFile, BOOL bCheckValues );
  61. int Spew( HWND hwndList, int iStartLine );
  62. protected: // Helper Fns
  63. BOOL _InitWindow( void );
  64. BOOL _SizeWindow( int X, int Y, int Width, int Height );
  65. void _PrepScrollBars( void );
  66. void _ReadIntSetting( UINT ID, int *pData );
  67. void _ReadEditSetting( UINT EditID );
  68. void _ReadCheckSetting( UINT ID);
  69. void _ReadComboSetting( UINT ComboID );
  70. void _ReadSliderSetting( CControlID * );
  71. void _ReadCheckSettings( void );
  72. BOOL _WriteIntSetting(UINT ID, int iData);
  73. BOOL _WriteEditSetting( UINT EditID );
  74. BOOL _WriteCheckSetting( UINT ID);
  75. BOOL _WriteComboSetting( UINT ComboID );
  76. BOOL _WriteSliderSetting( UINT ID );
  77. BOOL _WriteCheckSettings( void );
  78. // We need these friends so that the WebView data can be shared
  79. friend void ReadWebViewSettings(CPropertyDataWindow2 *pData);
  80. friend void WriteWebViewSettings(CPropertyDataWindow2 *pData);
  81. BOOL WriteStringValue(LPCTSTR szKeyName, LPCTSTR szValue);
  82. BOOL WriteNumberValue(LPCTSTR szKeyName, int nValue);
  83. void ReadStringValue(LPCTSTR szKeyName, LPTSTR szValue, UINT cchValueMax);
  84. void ReadNumberValue(LPCTSTR szKeyName, int * pnValue);
  85. void _WriteCheckToINF( HANDLE hFile, UINT ID, BOOL bCheckValues );
  86. void _WriteChecksToINF( HANDLE hFile, BOOL bCheckValues );
  87. void _WriteEditToINF( HANDLE hFile, UINT EditID, BOOL bCheckValues );
  88. void _WriteEditNumToINF( HANDLE hFile, UINT EditID, BOOL bCheckValues );
  89. void _WriteSliderToINF( HANDLE hFile, UINT SliderID, BOOL bCheckValues );
  90. void _WriteComboToINF( HANDLE hFile, UINT ComboID, BOOL bCheckValues );
  91. void _DeleteKey( HANDLE hFile, UINT ID );
  92. int _Spew( HWND hwndList, int iStartLine, CControlID *pControlID );
  93. };
  94. #endif // __PropWnd_h__