@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: This will return the current status of the battery on a mobile device !!!!C# Signature: [DllImport("coredll.dll", SetLastError = true)] [return: MarshalAs(UnmanagedType.U4)] public static extern int GetSystemPowerStatusEx2(ref SYSTEM_POWER_STATUS_EX2 pSystemPowerStatusEx2, [MarshalAs(UnmanagedType.U4), In] int dwLen, [MarshalAs(UnmanagedType.Bool), In] bool fUpdate); !!!!VB Signature: Declare Function GetSystemPowerStatusEx2 Lib "Coredll.dll" (TODO) As TODO !!!!User-Defined Types: Structures.[SYSTEM_POWER_STATUS_EX2] !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: The return is the size of the structure. It returns 0 if there was an error. !!!!Tips & Tricks: Please add some! !!!!Sample Code: SYSTEM_POWER_STATUS_EX2 SystemPowerStatusEx2 = new SYSTEM_POWER_STATUS_EX2(); if (GetSystemPowerStatusEx2(ref SystemPowerStatusEx2, Marshal.SizeOf(SystemPowerStatusEx2), true) > 0) { //run some battery code } Documentation: GetSystemPowerStatusEx2@msdn on MSDN
Edit coredll.getsystem...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.