summaryrefslogtreecommitdiff
path: root/zen/disable_standby.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:15:16 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:15:16 +0200
commitbd6336c629841c6db3a6ca53a936d629d34db53b (patch)
tree3721ef997864108df175ce677a8a7d4342a6f1d2 /zen/disable_standby.h
parent4.0 (diff)
downloadFreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.tar.gz
FreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.tar.bz2
FreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.zip
4.1
Diffstat (limited to 'zen/disable_standby.h')
-rw-r--r--zen/disable_standby.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/zen/disable_standby.h b/zen/disable_standby.h
new file mode 100644
index 00000000..ec112427
--- /dev/null
+++ b/zen/disable_standby.h
@@ -0,0 +1,27 @@
+#ifndef PREVENTSTANDBY_H_INCLUDED
+#define PREVENTSTANDBY_H_INCLUDED
+
+#ifdef FFS_WIN
+#include "win.h" //includes "windows.h"
+#endif
+
+namespace zen
+{
+class DisableStandby
+{
+public:
+#ifdef FFS_WIN
+ DisableStandby()
+ {
+ ::SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED /* | ES_AWAYMODE_REQUIRED*/ );
+ }
+
+ ~DisableStandby()
+ {
+ ::SetThreadExecutionState(ES_CONTINUOUS);
+ }
+#endif
+};
+}
+
+#endif // PREVENTSTANDBY_H_INCLUDED
bgstack15