mirror of
https://github.com/n00mkrad/flowframes.git
synced 2025-12-16 08:27:44 +01:00
Prevent Windows from going to sleep while Flowframes is running (needs testing)
This commit is contained in:
@@ -16,6 +16,7 @@ using Microsoft.WindowsAPICodePack.Taskbar;
|
||||
using Flowframes.MiscUtils;
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
#pragma warning disable IDE1006
|
||||
|
||||
@@ -23,6 +24,11 @@ namespace Flowframes
|
||||
{
|
||||
public partial class Form1 : Form
|
||||
{
|
||||
[Flags]
|
||||
public enum EXECUTION_STATE : uint { ES_AWAYMODE_REQUIRED = 0x00000040, ES_CONTINUOUS = 0x80000000, ES_DISPLAY_REQUIRED = 0x00000002, ES_SYSTEM_REQUIRED = 0x00000001 }
|
||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags); // PREVENT WINDOWS FROM GOING TO SLEEP
|
||||
|
||||
public bool initialized = false;
|
||||
public bool quickSettingsInitialized = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user