コード例 #1
0
 private static void SetState(EXECUTION_STATE state)
 {
     Logger.Info("Setting System State to [{0}]", EXECUTION_STATE.ES_CONTINUOUS);
     try
     {
         SetThreadExecutionState(state);
     }
     catch (Exception e)
     {
         Logger.Error("An error has occurred while setting system state. {0}", e.ToString());
     }
 }
コード例 #2
0
ファイル: SleepBarricade.cs プロジェクト: EbenZhang/EZPlayer
        private void PreventSleep()
        {
            var lastState = SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS
                | EXECUTION_STATE.ES_DISPLAY_REQUIRED
                | EXECUTION_STATE.ES_SYSTEM_REQUIRED
                | EXECUTION_STATE.ES_AWAYMODE_REQUIRED);//Away mode for Windows >= Vista
            if (lastState == EXECUTION_STATE.ES_INVALID)
            {
                lastState = SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS
                    | EXECUTION_STATE.ES_DISPLAY_REQUIRED
                    | EXECUTION_STATE.ES_SYSTEM_REQUIRED); //Windows < Vista, forget away mode
            }

            if (m_initialExcutionState == EXECUTION_STATE.ES_INVALID)
            {
                m_initialExcutionState = lastState;
            }
        }
コード例 #3
0
 private static extern UInt32 CallNtPowerInformation(POWER_INFORMATION_LEVEL InformationLevel, IntPtr lpInputBuffer, UInt32 nInputBufferSize, out EXECUTION_STATE lpOutputBuffer, Int32 nOutputBufferSize);
コード例 #4
0
 protected static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE state);
コード例 #5
0
 static extern uint SetThreadExecutionState(EXECUTION_STATE esFlags);
コード例 #6
0
 [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
コード例 #7
0
ファイル: TvHome.cs プロジェクト: Christoph21x/ARGUS-TV
 private extern static EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE state);
コード例 #8
0
ファイル: EsoWindow.cs プロジェクト: VasiliySk/FishHelper
 private static extern EXECUTION_STATE SetThreadExecutionStateNative(EXECUTION_STATE esFlags);
コード例 #9
0
 internal static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE state);
コード例 #10
0
 static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE flags); 
コード例 #11
0
 public void Execute(object o = null)
 {
     Initialized        = true;
     LastExecutionState = WinAPI.SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS | EXECUTION_STATE.ES_SYSTEM_REQUIRED | EXECUTION_STATE.ES_DISPLAY_REQUIRED);
     Program.Reader.ReadAsync("Hibernation denied.");
 }
コード例 #12
0
ファイル: PowerHelper.cs プロジェクト: sat1582/CODEFramework
 internal static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE state);
コード例 #13
0
ファイル: MapAssembly.cs プロジェクト: alfredodev/mono-tools
	public static EXECUTION_STATE SetThreadExecutionState (EXECUTION_STATE esFlags)
	{
		Console.WriteLine ("Kernel32:SetThreadExecutionState called");
		return EXECUTION_STATE.ES_CONTINUOUS;
	}
コード例 #14
0
 public NonSuspendableAction()
 {
     // Forces the system to be in the working state until next call that uses ES_CONTINUOUS:
     previousState = Kernel32.SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS | EXECUTION_STATE.ES_SYSTEM_REQUIRED);
 }
コード例 #15
0
ファイル: Form1.cs プロジェクト: bojordan/CupOfCoffee
 static extern uint SetThreadExecutionState(EXECUTION_STATE esFlags);
コード例 #16
0
 private extern static EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE state);
コード例 #17
0
ファイル: EsoWindow.cs プロジェクト: VasiliySk/RotationHelper
 public EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags)
 {
     return(SetThreadExecutionStateNative(esFlags));
 }
コード例 #18
0
 public static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
コード例 #19
0
 public static void ResetStandbyTimer()
 {
     EXECUTION_STATE es = SetThreadExecutionState(EXECUTION_STATE.ES_DISPLAY_REQUIRED | EXECUTION_STATE.ES_SYSTEM_REQUIRED);
 }
コード例 #20
0
 public NonSuspendableAction()
 {
     // Forces the system to be in the working state until next call that uses ES_CONTINUOUS:
     previousState = Kernel32.SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS | EXECUTION_STATE.ES_SYSTEM_REQUIRED);
 }
コード例 #21
0
ファイル: Utilities.cs プロジェクト: gitscamI/MiningService
 private static extern EXECUTION_STATE SetThreadExecutionState(
     EXECUTION_STATE flags);
コード例 #22
0
ファイル: Win32.cs プロジェクト: HITSUN2015/duplicati
 public static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
コード例 #23
0
 protected static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE state);