]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utils.cpp
Include wx/slider.h according to precompiled headers of wx/wx.h (with other minor...
[wxWidgets.git] / src / msw / utils.cpp
index 21e9a0fdfb3d137ca415b68aa3b7804fd5bf9585..d94f52caa2715f61fbe2534feb15430b50eab098 100644 (file)
     #include "wx/app.h"
     #include "wx/intl.h"
     #include "wx/log.h"
+    #include "wx/timer.h"
 #endif  //WX_PRECOMP
 
+#include "wx/msw/registry.h"
 #include "wx/apptrait.h"
 #include "wx/dynlib.h"
 #include "wx/dynload.h"
@@ -54,8 +56,6 @@
     #include <winsock.h>
 #endif
 
-#include "wx/timer.h"
-
 #if !defined(__GNUWIN32__) && !defined(__SALFORDC__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
     #include <direct.h>
 
@@ -288,11 +288,12 @@ bool wxGetUserName(wxChar *buf, int maxSize)
     wxCHECK_MSG( buf && ( maxSize > 0 ), false,
                     _T("empty buffer in wxGetUserName") );
 #if defined(__WXWINCE__)
-    wxRegKey key(wxRegKey::HKCU, wxT("Control Panel\\Owner\\Owner"));
+    wxLogNull noLog;
+    wxRegKey key(wxRegKey::HKCU, wxT("ControlPanel\\Owner"));
     if(!key.Open(wxRegKey::Read))
         return false;
     wxString name;
-    if(!key.QueryValue(wxEmptyString, name))
+    if(!key.QueryValue(wxT("Owner"),name))
         return false;
     wxStrncpy(buf, name.c_str(), maxSize-1);
     buf[maxSize-1] = _T('\0');
@@ -478,8 +479,8 @@ wxChar *wxGetUserHome(const wxString& WXUNUSED(user))
 }
 
 bool wxGetDiskSpace(const wxString& WXUNUSED_IN_WINCE(path),
-                    wxLongLong *WXUNUSED_IN_WINCE(pTotal),
-                    wxLongLong *WXUNUSED_IN_WINCE(pFree))
+                    wxDiskspaceSize_t *WXUNUSED_IN_WINCE(pTotal),
+                    wxDiskspaceSize_t *WXUNUSED_IN_WINCE(pFree))
 {
 #ifdef __WXWINCE__
     // TODO-CE
@@ -534,12 +535,20 @@ bool wxGetDiskSpace(const wxString& WXUNUSED_IN_WINCE(path),
 #endif
         if ( pTotal )
         {
-            *pTotal = wxLongLong(UL(bytesTotal).HighPart, UL(bytesTotal).LowPart);
+#if wxUSE_LONGLONG
+            *pTotal = wxDiskspaceSize_t(UL(bytesTotal).HighPart, UL(bytesTotal).LowPart);
+#else
+            *pTotal = wxDiskspaceSize_t(UL(bytesTotal).LowPart);
+#endif
         }
 
         if ( pFree )
         {
+#if wxUSE_LONGLONG
             *pFree = wxLongLong(UL(bytesFree).HighPart, UL(bytesFree).LowPart);
+#else
+            *pFree = wxDiskspaceSize_t(UL(bytesFree).LowPart);
+#endif
         }
     }
     else
@@ -567,7 +576,7 @@ bool wxGetDiskSpace(const wxString& WXUNUSED_IN_WINCE(path),
             return false;
         }
 
-        wxLongLong lBytesPerCluster = lSectorsPerCluster;
+        wxDiskspaceSize_t lBytesPerCluster = (wxDiskspaceSize_t) lSectorsPerCluster;
         lBytesPerCluster *= lBytesPerSector;
 
         if ( pTotal )
@@ -994,18 +1003,6 @@ bool wxShutdown(wxShutdownFlags WXUNUSED_IN_WINCE(wFlags))
 #endif // Win32/16
 }
 
-wxPowerType wxGetPowerType()
-{
-    // TODO
-    return wxPOWER_UNKNOWN;
-}
-
-wxBatteryState wxGetBatteryState()
-{
-    // TODO
-    return wxBATTERY_UNKNOWN_STATE;
-}
-
 // ----------------------------------------------------------------------------
 // misc
 // ----------------------------------------------------------------------------