]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/registry.cpp
checking that a wxWindow is of run-time type wxWindow is hopefully useless
[wxWidgets.git] / src / msw / registry.cpp
index c2aab338a665ba9cdc037cd7e7ccf60688acbf1c..ff832de32d59c09a4f3f46fe6c0319c1df6e998e 100644 (file)
 #endif
 
 #ifndef WX_PRECOMP
+    #include "wx/msw/wrapwin.h"
     #include "wx/string.h"
+    #include "wx/intl.h"
+    #include "wx/log.h"
 #endif
 
-#include  "wx/intl.h"
-#include  "wx/log.h"
-#include  "wx/file.h"
-#include  "wx/wfstream.h"
+#include "wx/file.h"
+#include "wx/wfstream.h"
 
 // Windows headers
-#include  "wx/msw/wrapwin.h"
-
 #ifdef __WXWINCE__
 #include "wx/msw/private.h"
 #include <winbase.h>
@@ -144,12 +143,10 @@ wxRegKey::StdKey wxRegKey::ExtractKeyName(wxString& strKey)
 {
   wxString strRoot = strKey.BeforeFirst(REG_SEPARATOR);
 
-  HKEY hRootKey = 0;
   size_t ui;
   for ( ui = 0; ui < nStdKeys; ui++ ) {
     if ( strRoot.CmpNoCase(aStdKeys[ui].szName) == 0 ||
          strRoot.CmpNoCase(aStdKeys[ui].szShortName) == 0 ) {
-      hRootKey = aStdKeys[ui].hkey;
       break;
     }
   }
@@ -157,7 +154,7 @@ wxRegKey::StdKey wxRegKey::ExtractKeyName(wxString& strKey)
   if ( ui == nStdKeys ) {
     wxFAIL_MSG(wxT("invalid key prefix in wxRegKey::ExtractKeyName."));
 
-    hRootKey = HKEY_CLASSES_ROOT;
+    ui = HKCR;
   }
   else {
     strKey = strKey.After(REG_SEPARATOR);
@@ -165,13 +162,13 @@ wxRegKey::StdKey wxRegKey::ExtractKeyName(wxString& strKey)
       strKey.Truncate(strKey.Len() - 1);
   }
 
-  return (wxRegKey::StdKey)(int)hRootKey;
+  return (StdKey)ui;
 }
 
 wxRegKey::StdKey wxRegKey::GetStdKeyFromHkey(WXHKEY hkey)
 {
   for ( size_t ui = 0; ui < nStdKeys; ui++ ) {
-    if ( (int) aStdKeys[ui].hkey == (int) hkey )
+    if ( aStdKeys[ui].hkey == (HKEY)hkey )
       return (StdKey)ui;
   }