I have a program that takes a long time to run and is intended to run unattended. In Windows, what is the best way to determine the users preferred poweroff action.
How can I determine these values on Windows XP, Windows Vista and Windows 7?
Is there an API to do this? (i.e. Shutdown, Suspend, or Hibernate according to users preferences)
If you are using managed code, there is PowerGetActiveScheme. There is an example of how to use it here: http://www.pinvoke.net/default.aspx/powrprof.powergetactivescheme