How can i stop the host machine entering standby
mode while my application is running?
Is there any win32 api
call to do this?
There are two APIs, depending on what version of Windows.
XP,2000, 2003:
http://msdn.microsoft.com/en-us/library/aa373247(VS.85).aspx
Respond to PBT_APMQUERYSUSPEND.
Vista, 2008:
http://msdn.microsoft.com/en-us/library/aa373208(VS.85).aspx
There could be many valid reasons to prevent the computer from going to sleep. For example, watching a video, playing music, compiling a long running build, downloading large files, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With