Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
4/14/2010
Handling Low Memory States
How to: Determine Available Memory
Preventing Automatic Power Down
How to: Program an Application for Windows Mobile Standard to Turn the Backlight On or Off
How to: Suspend the Device
Managing Variables, Stacks, and Heaps on Windows Mobile Devices
Getting Memory Status and Processor Information
System Out of Memory Dialog Box
The Windows Embedded CE GetSystemPowerStatusEx2function can be called to return the SYSTEM_POWER_STATUS_EX2structure. This structure contains important details about the power state of the device. Three of the most useful details in this structure are the ACLineStatus, BatteryFlag, and BatteryLifePercentmembers.
To produce accurate and complete information, device manufacturers must populate this data from their battery drivers, as shown in the following code:
Copy Code | |
---|---|
SYSTEM_POWER_STATUS_EX2 wrstat = {0}; if (!GetSystemPowerStatusEx2(&wrstat, sizeof(wrstat), FALSE)) { MessageBox(hWnd,_T("Couldn't get power state"), _T("Error"),MB_OK); } else { // Extract the power status information you need. } |
See Also
Concepts
Handling Application HibernationHandling Low Memory States
How to: Determine Available Memory
Preventing Automatic Power Down
How to: Program an Application for Windows Mobile Standard to Turn the Backlight On or Off
How to: Suspend the Device
Managing Variables, Stacks, and Heaps on Windows Mobile Devices
Getting Memory Status and Processor Information
System Out of Memory Dialog Box