What API or tools can I use to query the capabilities of the system and choose the most appropriate on for putting the PC to Sleep, Hibernate or shutdown mode?
Thanks for any pointers.
What API or tools can I use to query the capabilities of the system and choose the most appropriate on for putting the PC to Sleep, Hibernate or shutdown mode?
Thanks for any pointers.
Look at SystemInformation.PowerStatus, then you can call Application.SetSuspendState to put the PC to Sleep or Hibernate like:
Application.SetSuspendState(PowerState.Hibernate, true, true);
I found this from googling - just tried it and it worked fine: