+// ----------------------------------------------------------------------------
+// change the key name/hkey
+// ----------------------------------------------------------------------------
+
+// set the full key name
+void wxRegKey::SetName(const wxString& strKey)
+{
+ Close();
+
+ m_strKey = strKey;
+ m_hRootKey = aStdKeys[ExtractKeyName(m_strKey)].hkey;
+}
+
+// the name is relative to the parent key
+void wxRegKey::SetName(StdKey keyParent, const wxString& strKey)
+{
+ Close();
+
+ m_strKey = strKey;
+ RemoveTrailingSeparator(m_strKey);
+ m_hRootKey = aStdKeys[keyParent].hkey;
+}
+
+// the name is relative to the parent key
+void wxRegKey::SetName(const wxRegKey& keyParent, const wxString& strKey)
+{
+ Close();
+
+ // combine our name with parent's to get the full name
+ m_strKey = strKey;
+ if ( !strKey.IsEmpty() && strKey[0] != REG_SEPARATOR )
+ m_strKey += REG_SEPARATOR;
+
+ RemoveTrailingSeparator(m_strKey);
+
+ m_hRootKey = keyParent.m_hRootKey;
+}
+
+// hKey should be opened and will be closed in wxRegKey dtor
+void wxRegKey::SetHkey(HKEY hKey)
+{
+ Close();
+
+ m_hKey = hKey;
+}
+