1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Windows Programming using C++

Discussion in 'Win32' started by HK, Sep 30, 2006.

  1. HK

    HK New Member

    Joined:
    Sep 30, 2006
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I need to wirte a program that will display the degration of a battery as it's nature of reducing its effective capacity during continous charging and discharging cycles. I looked at Microsoft website and I was able to locate this API called "CallNtPowerInformation". This will be very helpful. However, I have not done any windows programming before. Can someone recommend a book on that. Do i need to need to create a Win32 app for that matter.

    Thanks
     
  2. tiger12506

    tiger12506 New Member

    Joined:
    Jun 6, 2007
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    You might also see if GetSystemPowerStatus might be simpler...

    If the API calls do not need a HWND parameter, then you can probably use them without creating any windows. (within reason...)

    Code:
    #include <windows>
    
    int main() {
      SYSTEM_POWER_STATUS sps;
      GetSystemPowerStatus(&sps);
    }
    
    I say to use getsystempowerstatus because in order to use CallNtPowerInformation you have to include another header and a library file as dictated in the requirements section of this page ->
    http://msdn2.microsoft.com/en-US/library/aa372675.aspx
     

Share This Page