title: stop charging when battery full
body: <p>I want to stop charging laptop when it is full. I have tried using PowerManagement functions. Using them I can read the battery status but can't stop charging. </p>
  
  <p>Is it possible?</p>
  
  <p>How it can be achieved?</p>
  
  <p>My code is :</p>
  
  <pre><code>Type t = typeof(System.Windows.Forms.PowerStatus);
  PropertyInfo[] pi = t.GetProperties();
  PropertyInfo prop = null;
  object propValue = null;
  for (int i = 0; i &lt; pi.Length; i++)
  {
      prop = pi[i];
      propValue = prop.GetValue(SystemInformation.PowerStatus, null);
      int batteryLifePercent = (int)(SystemInformation.PowerStatus.BatteryLifePercent * 100);
      if (batteryLifePercent == 100) 
      {
          // stop charging
      }
  }
  </code></pre>
  
  <p>Thanks in Advance.</p>