CRegistry

#ifndef __REGISTRY_H__ #define __REGISTRY_H__ class CRegistry { public: CRegistry(); ~CRegistry(); int m_nLastError; // CRegistry properties protected: HKEY m_hRootKey; BOOL m_bLazyWrite; CString m_strCurrentPath; public: inline BOOL PathIsValid() { return (m_strCurrentPath.GetLength() > 0); } inline CString GetCurrentPath() { return m_strCurrentPath; } inline HKEY GetRootKey() { return m_hRootKey; } //CRegistry methods public: BOOL ClearKey(); BOOL SetRootKey(HKEY hRootKey); BOOL CreateKey(CString strKey); BOOL DeleteKey(CString strKey); BOOL DeleteValue(CString strName); int GetDataSize(CString strValueName); DWORD GetDataType(CString strValueName); int GetSubKeyCount(); int GetValueCount(); BOOL KeyExists(CString strKey, HKEY hRootKey = NULL); BOOL SetKey(CString strKey, BOOL bCanCreate); BOOL ValueExists(CString strName); void RenameValue(CString strOldName, CString strNewName); // data reading functions COleDateTime ReadDateTime(CString strName, COleDateTime dtDefault); double ReadFloat(CString strName, double fDefault); CString ReadString(CString strName, CString strDefault); int ReadInt(CString strName, int nDefault); BOOL ReadBool(CString strName, BOOL bDefault); COLORREF ReadColor(CString strName, COLORREF rgbDefault); BOOL ReadFont(CString strName, CFont* pFont); BOOL ReadPoint(CString strName, CPoint* pPoint); BOOL ReadSize(CString strName, CSize* pSize); BOOL ReadRect(CString strName, CRect* pRect); DWORD ReadDword(CString strName, DWORD dwDefault); // data writing functions BOOL WriteBool(CString strName, BOOL bValue); BOOL WriteDateTime(CString strName, COleDateTime dtValue); BOOL WriteString(CString strName, CString strValue); BOOL WriteFloat(CString strName, double fValue); BOOL WriteInt(CString strName, int nValue); BOOL WriteColor(CString strName, COLORREF rgbValue); BOOL WriteFont(CString strName, CFont* pFont); BOOL WritePoint(CString strName, CPoint* pPoint); BOOL WriteSize(CString strNam
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值