Looking for a way for a service to prevent a windows box from sleeping.
Is the SetThreadExecutionState api call the only way via .NET (C# or F#)?
A cursory search of the Internet shows that SetThreadExecutionState is the officially-mandated way to prevent the screensaver from appearing or the system from entering sleep, standby, or hibernate. The function works by resetting the system's idle timer.
It's one of those cases where the name of the function does not reflect its actual utility.
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.