http://msdn.microsoft.com/en-us/ ... 8%28v=vs.85%29.aspx
官网看到的,调用上面的例子(未测试)Func _PowerKeepAlive()
#cs
; Flags:
; ES_SYSTEM_REQUIRED (0x01) -> Resets system Idle timer
; ES_DISPLAY_REQUIRED (0x02) -> Resets display Idle timer
; ES_CONTINUOUS (0x80000000) -> Forces 'continuous mode' -> the above 2 will not need to continuously be reset
#ce
Local $aRet=DllCall('kernel32.dll','long','SetThreadExecutionState','long',0x80000003)
If @error Then Return SetError(2,@error,0x80000000)
Return $aRet[0] ; Previous state (typically 0x80000000 [-2147483648])
EndFunc
|