<p>How can i stop the host machine entering <code>standby</code> mode while my application is running?</p>

<p>Is there any <code>win32 api</code> call to do this?</p>

[{'answer_id': 56068, 'author': 'Matt Sheppard', 'author_id': 797, 'author_profile': 'https://Stackoverflow.com/users/797', 'pm_score': 2, 'selected': False, 'text': '<p>This article <a href="http://www.codeguru.com/cpp/w-p/system/messagehandling/article.php/c6907" rel="nofollow noreferrer">http://www.codeguru.com/cpp/w-p/system/messagehandling/article.php/c6907</a> provides a demo of how to do this from C++ (thought he article is framed as if you want to do it from Java, and provides a Java wrapper).</p>\n\n<p>The actual code in in a zip file at <a href="http://www.codeguru.com/dbfiles/get_file/standbydetectdemo_src.zip?id=6907&amp;lbl=STANDBYDETECTDEMO_SRC_ZIP&amp;ds=20040406" rel="nofollow noreferrer">http://www.codeguru.com/dbfiles/get_file/standbydetectdemo_src.zip?id=6907&amp;lbl=STANDBYDETECTDEMO_SRC_ZIP&amp;ds=20040406</a> and the C++ part of it is under com/ha/common/windows/standbydetector.</p>\n\n<p>Hopefully it will give you enough of a direction to get started.</p>\n'}, {'answer_id': 56080, 'author': 'Brannon', 'author_id': 5745, 'author_profile': 'https://Stackoverflow.com/users/5745', 'pm_score': 4, 'selected': True, 'text': '<p>There are two APIs, depending on what version of Windows.</p>\n\n<p>XP,2000, 2003:</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/aa373247(VS.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/aa373247(VS.85).aspx</a></p>\n\n<p>Respond to PBT_APMQUERYSUSPEND.</p>\n\n<p>Vista, 2008:</p>\n\n<p><a href="http://msdn.microsoft.com/en-us/library/aa373208(VS.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/aa373208(VS.85).aspx</a></p>\n\n<p>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.  </p>\n'}]
['https://Stackoverflow.com/questions/56046', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/123/']