iPAQGetAcAdapterPresent (ipaqutil)
Last changed: Ben Clayton-15.207.255.7

.
Summary
The iPAQGetAcAdapterPresent function determines if an AC adapter is present.

C# Signature:

[DllImport("iPAQUtil.dll", SetLastError=true)]
private static extern bool iPAQGetAcAdapterPresent (ref DWORD lpdwACPresent);

User-Defined Types:

using DWORD = UInt32;

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

public bool ACAdapterPresent
{
  get
  {
    // Try catch in case DLL call fails
    try
    {
     DWORD d = (DWORD)0;
     if (!iPAQGetAcAdapterPresent(ref d))
     {
      // failed..
     }
     else
     {
      return ((int)d == 1);
     }
     }
    catch (Exception )
    {
     // can't find function/dll
    }
    return false;
  }

}

Documentation