winapi - User's Preferred poweroff action - Windows -


i have program takes long time run , intended run unattended. in windows, best way determine users preferred poweroff action.

  • what power button does.
  • in windows 7, start menu logoff action (which shut down default).

how can determine these values on windows xp, windows vista , windows 7?

is there api this? (i.e. shutdown, suspend, or hibernate according users preferences)

if using managed code, there powergetactivescheme. there example of how use here: http://www.pinvoke.net/default.aspx/powrprof.powergetactivescheme


Comments