函数参考


_WinAPI_SetThreadExecutionState

Prevents the system from entering sleep or turning off the display while the current application is running.

#Include <WinAPIEx.au3>
_WinAPI_SetThreadExecutionState ( $iFlags )

参数

$iFlags The thread's execution requirements. This parameter can be one or more of the following values.

$ES_AWAYMODE_REQUIRED
$ES_CONTINUOUS
$ES_DISPLAY_REQUIRED
$ES_SYSTEM_REQUIRED
$ES_USER_PRESENT

返回值

Success The value is the previous thread execution state.
失败: 返回 0 并设置 @error 标志为非 0 值.

注意/说明

The _WinAPI_SetThreadExecutionState() function cannot be used to prevent the user from putting the computer to
sleep. Applications should respect that the user expects a certain behavior when they close the lid on their
laptop or press the power button.

This function does not stop the screen saver from executing.

相关

详情参考

在MSDN中搜索