Jump to content

Electric grid or UPS


 Share

Recommended Posts

Please suggest what is the best way in AUTOIT! to find out if the computer currently works using electric grid or batteries (UPS device) ? I think there is some WINDOWS function responsible for such information but I didn't find anything in the help file.

Thanks a lot!

Link to comment
Share on other sites

Link to comment
Share on other sites

Maybe this gives you a start, found it in this thread.

http://msdn.microsoft.com/en-us/library/aa372715%28VS.85%29.aspx

http://www.codeproject.com/KB/system/OSEvents.aspx?fid=1528689

http://msdn.microsoft.com/en-us/library/aa373232(VS.85).aspx :

It seems ACLineStatus variable is what I need. The only question is how to incorporate this in my AUTOIT! script.

Link to comment
Share on other sites

Link to comment
Share on other sites

I'm a complete novice. Could you please show how to use this function

BOOL WINAPI GetSystemPowerStatus(

__out LPSYSTEM_POWER_STATUS lpSystemPowerStatus

);

using DllCall function in AUTOIT.

I start with

DllCall("kernel32.dll", "int", "GetSystemPowerStatus" ....)

How to work with lpSystemPowerStatus?

Thanks a lot!

Link to comment
Share on other sites

This will work for laptops - if they are on AC or DC , but how you can find if your desctop is on GRID or UPS power would be very tricky if impossible to check with AUTOIT.

It would be a pity if no way exists. The main task is to manage UPS which is connected to the computer through USB. Is it possible with AUTOIT?

P.S. The examples with the laptop battery were very useful to see anyway.

Edited by Fullerene
Link to comment
Share on other sites

  • Developers

It would be a pity if no way exists. The main task is to manage UPS which is connected to the computer through USB. Is it possible with AUTOIT?

P.S. The examples with the laptop battery were very useful to see anyway.

This will depend on the supplier's USB driver whether that has any means of interfacing since it isn't an internal battery.

Assume you also installed some software from the UPS supplier which can check the status of the UPS device attached?

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

This will depend on the supplier's USB driver whether that has any means of interfacing since it isn't an internal battery.

Assume you also installed some software from the UPS supplier which can check the status of the UPS device attached?

Yeah... You're right.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...