summaryrefslogtreecommitdiff
path: root/shared/disable_standby.h
blob: 1a2a2b8a722602348dde600de71f360775435c30 (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 <wx/msw/wrapwin.h> //includes "windows.h"
#endif

namespace util
{
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