Geeks With Blogs

WinToolZone - Spelunking Microsoft Technologies
I work as a developer on the Common Language Runtime (CLR) team, specifically in the areas of exception handling and CLR hosting.

The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion. All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Inside and Out... An attempt to understand technology better...
I just finished implementing support for getting the global memory details and the battery charge details in CERapi - my managed RAPI implementation. To get these details, simply obtain the CESystemInformation instance and use the GlobalMemoryInformation and BatteryInformation properties to get the details, as shown in the code snippet below (si, in the snippet below, is reference to CESystemInformation object):

                                           // Global Memory Details
 				CEGlobalMemory gm = si.GlobalMemoryInformation;
				Console.WriteLine("Memory Load: {0}",gm.MemoryLoad);
				Console.WriteLine("Total Physical Memory: {0}",gm.TotalPhysicalMemory);
				// Battery Details
				CEBattery bat = si.BatteryInformation;
				Console.WriteLine("ACLine: {0}",bat.ACLine.ToString());
				Console.WriteLine("Main Battery Remain: {0}%",bat.MainBatteryRemainLifePercent);
				Console.WriteLine("Main Battery Status: {0}",bat.MainBatteryCharge);
				Console.WriteLine("Backup Battery Remain: {0}%",bat.BackupBatteryRemainLifePercent);
				Console.WriteLine("Backup Battery Status: {0}",bat.BackupBatteryCharge);

Do you have any suggestions on what functionality you would like to see in CERAPI? If so, mail me.
Posted on Tuesday, February 15, 2005 7:22 PM .NET Framework , .NET Framework V1.X , VS.NET 2002/2003 , VS 2005 , .NET Compact Framework , Embedded Development | Back to top

Comments on this post: Global Memory and Battery Status Support in CERapi

# Download CERapi - the managed Windows CE Remote API
Requesting Gravatar...

Windows CE Remote API (RAPI) is the mechanism via which desktop applications can talk with the Windows...
Left by Inside and Out... on Jul 10, 2006 8:32 PM

# re: Global Memory and Battery Status Support in CERapi
Requesting Gravatar...
Cool API
Left by NetoRosatelli on Mar 23, 2007 2:42 AM

Your comment:
 (will show your gravatar)

Copyright © Gaurav Khanna | Powered by: