summaryrefslogtreecommitdiff
path: root/shared/disable_standby.h
diff options
context:
space:
mode:
Diffstat (limited to 'shared/disable_standby.h')
-rw-r--r--shared/disable_standby.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/shared/disable_standby.h b/shared/disable_standby.h
new file mode 100644
index 00000000..399d0b9c
--- /dev/null
+++ b/shared/disable_standby.h
@@ -0,0 +1,30 @@
+#ifndef PREVENTSTANDBY_H_INCLUDED
+#define PREVENTSTANDBY_H_INCLUDED
+
+#ifdef FFS_WIN
+#include <wx/msw/wrapwin.h> //includes "windows.h"
+#endif
+
+namespace util
+{
+class DisableStandby
+{
+public:
+ DisableStandby()
+ {
+#ifdef FFS_WIN
+ ::SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED /* | ES_AWAYMODE_REQUIRED*/ );
+#endif
+ }
+
+ ~DisableStandby()
+ {
+#ifdef FFS_WIN
+ ::SetThreadExecutionState(ES_CONTINUOUS);
+#endif
+ }
+
+};
+}
+
+#endif // PREVENTSTANDBY_H_INCLUDED
bgstack15