PDA

View Full Version : How to send the PC to standby or hibernation?



falconium
19th May 2010, 01:52
Hi,

Any idea? Is there any library for this?
I saw that there is a so called POWRPROF extension in MSDN, but I don't know how to use it in QT.
Do you have any suggestion?

Thanks!

MorrisLiang
19th May 2010, 02:30
It's a dll,so I guess you should take a look at QLibrary.

ChrisW67
19th May 2010, 02:30
I don't expect Qt has anything to directly address this requirement.

There will be a Windows-specific API call that you use on Windows in the same way that MSDN does. It will also likely vary between Win XP and Vista/Win 7 (usually a bunch of extra calls to sort security).

I assume that there is an equivalent on Mac, and probably no standard way on Linux.

squidge
19th May 2010, 09:43
Under Windows, you can try SetSystemPowerState

wysota
19th May 2010, 09:51
I assume that there is an equivalent on Mac, and probably no standard way on Linux.

You underestimate the power of Tux ;) You can either call an appropriate command (like hibernate) through QProcess or use /sys/power interface or make a direct call to HAL through DBus.