Mastodon
Programmierung

Environment: SetSystemPowerState

This isn’t a question, it’s a tip!!
I’ve recently discovered a fancy, but most of the time useless,
API-function called
SetSystemPowerState, wich can be used to bring the system into
powersave-mode

Use it like this:
[code lang=”delphi”]SetSystemPowerState(False, True); //Forces the system down

//or

SetSystemPowerState(True, False); //Makes a “soft” off
[/code]
I didn’t really have any use of this, but it seems like many people asks
how to shutdown the system, so this is maybe a function for them???

I can think of another senario when this feature maybe useful:
A systemadministrator can make a program wich will be distubuted on all
computers in the system, and at the end of the day, lets say 8PM, every
computer goes into suspendmode and when the user comes back to work at
9AM all they have to do is to move the mouse and they can start working
where they left yesterday…

Have fun wink


Daniel Ivarsson
sol24@algonet.se
http://www.algonet.se/~sol24/Delphi/

[tags]Delphi, API[/tags]

0 Kommentare zu “Environment: SetSystemPowerState

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.