summaryrefslogtreecommitdiff
path: root/zen/disable_standby.h
blob: ec11242731a8562f3c8e20ed8c432da23921c2d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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