Tuesday, January 17, 2012

Hibernate in XP & Code for Hibernate in Windows Application

Below are the steps to enable Hibernate in Windows XP

  1. Right click on Desktop.
  2. Click on properties.
  3. Go to screen save tab.
  4. Click on power button
  5. Select Hibernate tab
  6. Check the checkbox “Enabled Hibernate”
  7. Apply the settings. 

To provide this feature programatically in our .Net windows application



using System.Windows.Forms;

namespace CodeKicks.WinApp.Machine
{
    public static class MyMachineHelper
    {
        public static void DoHibernate()
        {
            //Application.SetSuspendState(PowerState.Suspend, true, false);
            Application.SetSuspendState(PowerState.Hibernate, true, false);
        }
    }
}

No comments:

Post a Comment