Results 1 to 4 of 4

Thread: Why will this batterystatus API work in winxp, but not in nt4.0?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2000
    Posts
    1,195

    Why will this batterystatus API work in winxp, but not in nt4.0?

    Code:
    Type SYSTEM_POWER_STATUS
    ACLineStatus As Byte
    BatteryFlag As Byte
    BatteryLifePercent As Byte
    Reserved1 As Byte
    BatteryLifeTime As Long
    BatteryFullLifeTime As Long
    End Type
    Declare Function GetSystemPowerStatus Lib "kernel32.dll" (lpSystemPowerStatus As SYSTEM_POWER_STATUS) As Long  
    
    Dim SysPower As SYSTEM_POWER_STATUS
    GetSystemPowerStatus SysPower
    With this code, SysPower.BatteryLifePercent returns 0 in nt 4.0.. but it works properly in winxp..

    anyone know how i can get this to work with nt 4.0?
    It also works in 9x..

  2. #2
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808
    It also seems to work on W2K
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2000
    Posts
    1,195
    anyone know why its not working in nt 4?

  4. #4
    sunnyl
    Guest
    Because it is not supported in NT. The API only works on Win2k/XP or Win95/98/ME.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width