]>
git.saurik.com Git - wxWidgets.git/blob - interface/msw/registry.h
be3ccb58a485001bf88f4bde70c81029b7e4e6ba
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: msw/registry.h
3 // Purpose: documentation for wxRegKey class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
11 @headerfile registry.h wx/msw/registry.h
13 wxRegKey is a class representing the Windows registry (it is only available
14 under Windows). One can create, query and delete registry keys using this
17 The Windows registry is easy to understand. There are five registry keys,
20 HKEY_CLASSES_ROOT (HKCR)
21 HKEY_CURRENT_USER (HKCU)
22 HKEY_LOCAL_MACHINE (HKLM)
23 HKEY_CURRENT_CONFIG (HKCC)
26 After creating a key, it can hold a value. The values can be:
32 Expandable String Value
43 The constructor to set the full name of the key under a previously created
47 wxRegKey(const wxString
& strKey
);
48 wxRegKey(const wxRegKey
& keyParent
, const wxString
& strKey
);
57 Creates the key. Will fail if the key already exists and @e bOkIfExists is
60 bool Create(bool bOkIfExists
= @
true);
63 Deletes the subkey with all of its subkeys/values recursively.
65 void DeleteKey(const wxChar
* szKey
);
68 Deletes this key and all of its subkeys and values recursively.
73 Deletes the named value.
75 void DeleteValue(const wxChar
* szKey
);
78 Returns @true if the key exists.
85 bool GetFirstKey(wxString
& strKeyName
, long& lIndex
);
88 Gets the first value of this key.
90 bool GetFirstValue(wxString
& strValueName
, long& lIndex
);
93 Gets information about the key.
96 The number of subkeys.
99 The maximum length of the subkey name.
102 The number of values.
105 The maximum length of a value.
107 bool GetKeyInfo(size_t * pnSubKeys
, size_t * pnValues
,
108 size_t * pnMaxValueLen
);
111 Gets the name of the registry key.
113 wxString
GetName(bool bShortPrefix
= @
true);
118 bool GetNextKey(wxString
& strKeyName
, long& lIndex
);
121 Gets the next key value for this key.
123 bool GetNextValue(wxString
& strValueName
, long& lIndex
);
126 Returns @true if given subkey exists.
128 bool HasSubKey(const wxChar
* szKey
);
131 Returns @true if any subkeys exist.
136 Returns @true if the value exists.
138 bool HasValue(const wxChar
* szValue
);
141 Returns @true if any values exist.
146 Returns @true if this key is empty, nothing under this key.
151 Returns @true if the key is opened.
156 Explicitly opens the key. This method also allows the key to be opened in
157 read-only mode by passing @c Read() instead of default
158 @c Write() parameter.
160 bool Open(AccessMode mode
= Write
);
164 Retrieves the numeric value.
166 bool QueryValue(const wxChar
* szValue
, wxString
& strValue
);
167 bool QueryValue(const wxChar
* szValue
, long * plValue
);
173 bool Rename(const wxChar
* szNewName
);
178 bool RenameValue(const wxChar
* szValueOld
,
179 const wxChar
* szValueNew
);
183 Sets the given @e szValue which must be numeric, string or binary depending
184 on the overload used. If the value doesn't exist, it is created.
186 bool SetValue(const wxChar
* szValue
, long lValue
);
187 bool SetValue(const wxChar
* szValue
,
188 const wxString
& strValue
);
189 bool SetValue(const wxChar
* szValue
,
190 const wxMemoryBuffer
& buf
);