In a Windows Form application, use the SetSUspendState method (http://msdn.microsoft.com/fr-fr/library/system.windows.forms.application.setsuspendstate.aspx). The first parameter allows you to choose between SUspend and Hibernate.
For a non-Windows application, call the Win32 API directly: the SetSuspendState function is located in the powrprof.dll file.
source
share