00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#ifndef _WINREGKEY_H
00021
#define _WINREGKEY_H
00022
00023
#include <strstream>
00024
#include <vector>
00025
00030 class CWinRegKey
00031 {
00032
public:
00034
CWinRegKey( );
00035
00037
virtual ~CWinRegKey();
00038
00042
operator HKEY()
const;
00043
00047 HKEY
Detach(
void );
00048
00051
void Attach(HKEY hKey);
00052
00061 LONG
Open(HKEY hKeyParent, LPCTSTR lpszKeyName, REGSAM nSamDesired = KEY_ALL_ACCESS );
00062
00066 LONG
Close();
00067
00080 LONG
Create( HKEY hKeyParent,
00081 LPCTSTR lpszKeyName,
00082 LPTSTR lpszClass = NULL,
00083 DWORD dwOptions = REG_OPTION_NON_VOLATILE,
00084 REGSAM nSamDesired = KEY_ALL_ACCESS,
00085 LPSECURITY_ATTRIBUTES lpSecAttr = NULL ,
00086 LPDWORD lpdwDisposition = NULL);
00087
00093 LONG
SetValue(DWORD dwValue, LPCTSTR lpszValueName);
00094
00100 LONG SetValue(LPCTSTR lpszValue, LPCTSTR lpszValueName);
00101
00107 LONG
QueryValue(DWORD& dwValue, LPCTSTR lpszValueName);
00108
00114 LONG QueryValue(LPTSTR szValue, LPCTSTR lpszValueName, DWORD* pdwCount);
00115
00122 LONG
DeleteSubKey(LPCTSTR lpszSubKey);
00123
00128 LONG
RecurseDeleteKey(LPCTSTR lpszKey);
00129
00134 LONG
DeleteValue(LPCTSTR lpszValue);
00135
00140 LONG
EnumSubKeys( std::vector<std::string> & aKeyNames );
00141
00146 LONG
EnumValues( std::vector<std::string> & aValueNames );
00147
00148
private:
00149 HKEY m_hKey;
00150
00151 };
00152
#endif //_REGKEY_H