Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Coredll, prefix the name with the module name and a period.
GetSystemPowerStatusEx2 (Coredll)
.
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
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
}
Class to retrieve the power settings from Coredll.GetSystemPowerStatusEx2
2/9/2010 3:51:53 AM - -194.6.192.244
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).