Sign in to follow this  
Followers 0
Fullerene

Electric grid or UPS

10 posts in this topic

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!

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0