[This is preliminary documentation and subject to change.]
Best Practice (Designed for Microsoft® Windows® Logo)
Event handling applications such as phone answering machine applications, fax servers, and periodic maintenance or desktop management applications should call SetThreadExecutionState before and after handling each event.
This best practice allows the operating system to keep the computer awake while the event is being handled and then put the computer to sleep immediately thereafter.
Pretesting OnNow/ACPI Support.
http://www.microsoft.com/hwdev/onnow.htm for information about the OnNow initiative and technical specifications.