]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/power.cpp
fix crash which happened if you called SetAttr(NULL) followed by SetAttr(attr) (...
[wxWidgets.git] / src / msw / power.cpp
index cf96885bbb9c31675195314ff517fdd5c91cf74d..e6b74936a29b21af3a6614e66ed7b5d63a94d7c7 100644 (file)
 #include "wx/power.h"
 #include "wx/msw/private.h"
 
+#if !defined(__WINCE_STANDARDSDK__)
+
+#ifdef __WXWINCE__
+    typedef SYSTEM_POWER_STATUS_EX SYSTEM_POWER_STATUS;
+    BOOL GetSystemPowerStatus(SYSTEM_POWER_STATUS *status)
+    {
+        return GetSystemPowerStatusEx(status, TRUE);
+    }
+#endif
+
 // ----------------------------------------------------------------------------
 // helper functions
 // ----------------------------------------------------------------------------
@@ -45,12 +55,15 @@ static inline bool wxGetPowerStatus(SYSTEM_POWER_STATUS *sps)
     return true;
 }
 
+#endif
+
 // ============================================================================
 // implementation
 // ============================================================================
 
 wxPowerType wxGetPowerType()
 {
+#if !defined(__WINCE_STANDARDSDK__)
     SYSTEM_POWER_STATUS sps;
     if ( wxGetPowerStatus(&sps) )
     {
@@ -68,12 +81,14 @@ wxPowerType wxGetPowerType()
                 break;
         }
     }
+#endif
 
     return wxPOWER_UNKNOWN;
 }
 
 wxBatteryState wxGetBatteryState()
 {
+#if !defined(__WINCE_STANDARDSDK__)
     SYSTEM_POWER_STATUS sps;
     if ( wxGetPowerStatus(&sps) )
     {
@@ -91,8 +106,7 @@ wxBatteryState wxGetBatteryState()
                 return wxBATTERY_CRITICAL_STATE;
         }
     }
+#endif
 
     return wxBATTERY_UNKNOWN_STATE;
 }
-
-