Every time I boot my Win 7 system, the power keys are set to shut the system down. Every time, I reset the keys so that they cause the system to sleep. But sometimes I forget, and then programs are closed harshly.
I want to write a program that will force the power keys to cause the system to sleep rather than power down. Then I can run that program each time I boot, and I will avoid the problem.
Does anyone know the API calls to tell Win 7 that the power key should mean "sleep"?